예제 #1
0
        public void RequestLicense(Object sender, EventArgs e)
        {
            if (ProductList.SelectedItem != null && LicenseTypeList.SelectedItem != null && Cost.Text != "0")
            {
                string locProductListID = ProductList.SelectedItem.Value;
                string locLicenseType   = LicenseTypeList.SelectedItem.Value;
                if (locProductListID != "" && locLicenseType != "")
                {
                    Database locDB = new Database();
                    locDB.ConectDB("SendRequestLicense( '" + (string)Session["UserName"] + "', " + Inventions.GetInstance().CurrentProductID +
                                   ", " + Inventions.GetInstance().LicenseType + ")", ReaderRequestLicense);

                    if (IsOk1 == "1")
                    {
                        Error1.Visible = false;
                        Error2.Visible = false;
                    }
                    if (IsOk1 == "-1")
                    {
                        Error1.Visible = true;
                        Error2.Visible = false;
                    }
                    if (IsOk1 == "-2")
                    {
                        Error1.Visible = false;
                        Error2.Visible = true;
                    }

                    DataBind();
                }
            }
        }
예제 #2
0
        public void AddFastAction(Object sender, EventArgs e)
        {
            if ((IsIfAction.Checked == false && ProductList.SelectedItem != null && ProductList2.SelectedItem != null &&
                 ActionList2.SelectedItem != null && CountIndex1.Text != "") ||
                (IsIfAction.Checked == true && ProductList.SelectedItem != null && ActionList2.SelectedItem != null))
            {
                string locProductListID  = ProductList.SelectedItem.Value;
                string locProductList2ID = ProductList2.SelectedItem.Value;
                string locActionList2ID  = ActionList2.SelectedItem.Value;

                if (IsIfAction.Checked == true && locProductList2ID == "-")
                {
                    locProductList2ID = "0";
                }


                if ((IsIfAction.Checked == false && locProductListID != "" && locProductList2ID != "" && locActionList2ID != "") ||
                    (IsIfAction.Checked == true && locProductListID != "" && locActionList2ID != ""))
                {
                    Database locDB = new Database();
                    locDB.ConectDB("AddReceivingProduct( '" + (string)Session["UserName"] + "', " + locProductListID + ", " +
                                   locActionList2ID + ", " + locProductList2ID + ", " + CountIndex1.Text + ", " +
                                   IsIfAction.Checked + ")", null);

                    locDB.ConectDB("CalcLicenseCost( '" + (string)Session["UserName"] + "', " + Inventions.GetInstance().CurrentProductID +
                                   ", " + Inventions.GetInstance().LicenseType + ")", ReaderCost);

                    Inventions.GetInstance().GetFastAction((string)Session["UserName"]);
                    DataBind();
                    IfActionsNumberList1.DataSource = CreateIfActionsNumberListDataSource2();
                    IfActionsNumberList1.DataBind();
                }
            }
        }
예제 #3
0
        DataView CreateIfActionsNumberListDataSource2()
        {
            Database locDB = new Database();

            return(locDB.GetDataSource("GetIfActionsNumber ('" + (string)Session["UserName"] + "', " +
                                       Inventions.GetInstance().CurrentProductID + ")"));
        }
예제 #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Inventions.GetInstance() == null)
            {
                Inventions locInventions = new Inventions(1);
            }
            QueryStringParameter locParameters = (QueryStringParameter)FastActionList.SelectParameters[0];

            locParameters.DefaultValue = (string)Session["UserName"];
            QueryStringParameter locParameters2 = (QueryStringParameter)IfActionList.SelectParameters[0];

            locParameters2.DefaultValue = (string)Session["UserName"];


            int OldIndex3 = ActionList2.SelectedIndex;

            ActionList2.DataSource     = CreateActionListDataSource();
            ActionList2.DataTextField  = "TextField";
            ActionList2.DataValueField = "ValueField";
            ActionList2.DataBind();
            ActionList2.SelectedIndex = OldIndex3;

            int OldIndex5 = ProductList.SelectedIndex;

            ProductList.DataSource     = CreateProductListDataSource();
            ProductList.DataTextField  = "TextField";
            ProductList.DataValueField = "ValueField";
            ProductList.DataBind();
            ProductList.SelectedIndex = OldIndex5;
            int OldIndex6 = ProductList2.SelectedIndex;

            ProductList2.DataSource     = CreateProductListDataSource2();
            ProductList2.DataTextField  = "TextField";
            ProductList2.DataValueField = "ValueField";
            ProductList2.DataBind();
            ProductList2.SelectedIndex = OldIndex6;
            int OldIndex7 = ProductList3.SelectedIndex;

            ProductList3.DataSource     = CreateProductListDataSource2();
            ProductList3.DataTextField  = "TextField";
            ProductList3.DataValueField = "ValueField";
            ProductList3.DataBind();
            ProductList3.SelectedIndex = OldIndex7;

            int OldIndex8 = IfActionsNumberList1.SelectedIndex;

            IfActionsNumberList1.DataSource     = CreateIfActionsNumberListDataSource2();
            IfActionsNumberList1.DataTextField  = "TextField";
            IfActionsNumberList1.DataValueField = "ValueField";
            IfActionsNumberList1.DataBind();
            IfActionsNumberList1.SelectedIndex = OldIndex8;

            int OldIndex9 = LicenseTypeList.SelectedIndex;

            LicenseTypeList.DataSource     = CreateLicenseTypeSource();
            LicenseTypeList.DataTextField  = "TextField";
            LicenseTypeList.DataValueField = "ValueField";
            LicenseTypeList.DataBind();
            LicenseTypeList.SelectedIndex = OldIndex9;
        }
예제 #5
0
 public void LicenseTypeChange(Object sender, EventArgs e)
 {
     if (LicenseTypeList.SelectedItem != null)
     {
         Inventions.GetInstance().LicenseType = LicenseTypeList.SelectedItem.Value;
         Database locDB = new Database();
         locDB.ConectDB("CalcLicenseCost( '" + (string)Session["UserName"] + "', " + Inventions.GetInstance().CurrentProductID +
                        ", " + Inventions.GetInstance().LicenseType + ")", ReaderCost);
     }
 }
예제 #6
0
        public void ProductListChange(Object sender, EventArgs e)
        {
            if (ProductList.SelectedItem != null)
            {
                string locProductListID = ProductList.SelectedItem.Value;

                Inventions.GetInstance().CurrentProductID = locProductListID;
                Inventions.GetInstance().GetFastAction((string)Session["UserName"]);
                Database locDB = new Database();
                locDB.ConectDB("CalcLicenseCost( '" + (string)Session["UserName"] + "', " + Inventions.GetInstance().CurrentProductID +
                               ", " + Inventions.GetInstance().LicenseType + ")", ReaderCost);
                DataBind();
            }
            IfActionsNumberList1.DataSource = CreateIfActionsNumberListDataSource2();
            IfActionsNumberList1.DataBind();
        }
예제 #7
0
        public void DeleteIfActions(Object sender, EventArgs e)
        {
            for (int i = 0; i < IfActionList1.Items.Count; i++)
            {
                CheckBox locCheckBox = IfActionList1.Items[i].FindControl("CheckIfAction") as CheckBox;
                if (locCheckBox.Checked == true)
                {
                    Label locLabelN1 = IfActionList1.Items[i].FindControl("N1") as Label;
                    Label locLabelN2 = IfActionList1.Items[i].FindControl("N2") as Label;
                    //Label locLabelN3 = IfActionList1.Items[i].FindControl("N3") as Label;

                    Database locDB = new Database();
                    locDB.Exec("DeleteIfAction (" + locLabelN1.Text + ", " + locLabelN2.Text + ")");
                    locDB.ConectDB("CalcLicenseCost( '" + (string)Session["UserName"] + "', " + Inventions.GetInstance().CurrentProductID +
                                   ", " + Inventions.GetInstance().LicenseType + ")", ReaderCost);
                }
            }
            Inventions.GetInstance().GetIfAction((string)Session["UserName"]);
            DataBind();
        }
예제 #8
0
        public void AddIFAction(Object sender, EventArgs e)
        {
            if (IfActionsNumberList1.SelectedItem != null && ProductList3.SelectedItem != null &&
                CountIndex2.Text != "")
            {
                string locIfActionsNumber = IfActionsNumberList1.SelectedItem.Value;
                string locProductList3ID  = ProductList3.SelectedItem.Value;


                if (locIfActionsNumber != "" && locProductList3ID != "")
                {
                    Database locDB = new Database();
                    locDB.ConectDB("AddIfAction( '" + (string)Session["UserName"] + "', " + Inventions.GetInstance().CurrentProductID + ", " +
                                   locIfActionsNumber + ", " + locProductList3ID + ", " + CountIndex2.Text + ")", null);
                    locDB.ConectDB("CalcLicenseCost( '" + (string)Session["UserName"] + "', " + Inventions.GetInstance().CurrentProductID +
                                   ", " + Inventions.GetInstance().LicenseType + ")", ReaderCost);

                    Inventions.GetInstance().GetIfAction((string)Session["UserName"]);
                    DataBind();
                }
            }
        }