Example #1
0
        protected void btn_Add_Option_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                ProductAttributeMgr myProductAttributeMgr = new ProductAttributeMgr();

                // Create Attribute Options
                string AttributeID = Nexus.Core.Tools.IDGenerator.Get_New_GUID();

                e2Data[] UpdateData =
                {
                    new e2Data("AttributeID",       AttributeID),
                    new e2Data("Attribute_IndexID", _attribute_indexid),
                    new e2Data("Attribute_Name",    tbx_AttributeName.Text),
                    new e2Data("IsPreSelected",     chkbox_IsPreSelected.Checked.ToString()),
                    new e2Data("Price_Adjustment",  RadNumericTextBox_PriceAdjustment.Text),
                    new e2Data("Weight_Adjustment", RadNumericTextBox_WeightAdjustment.Text),
                    new e2Data("SortOrder",         "0"),
                    new e2Data("IsActive",          chkbox_IsActive.Checked.ToString())
                };

                myProductAttributeMgr.Add_Product_Attribute(UpdateData);

                Control_Init();

                MultiView_OptionForm.SetActiveView(View_Button);
            }
        }
Example #2
0
        protected void lbtn_Edit_Option_Command(object sender, CommandEventArgs e)
        {
            if (!DataEval.IsEmptyQuery(e.CommandArgument.ToString()))
            {
                ProductAttributeMgr myProductAttributeMgr = new ProductAttributeMgr();

                Product_Attribute myProduct_Attribute = myProductAttributeMgr.Get_Product_Attribute(e.CommandArgument.ToString());

                tbx_AttributeName.Text                  = myProduct_Attribute.Attribute_Name;
                chkbox_IsPreSelected.Checked            = myProduct_Attribute.IsPreSelected;
                RadNumericTextBox_PriceAdjustment.Text  = myProduct_Attribute.Price_Adjustment.ToString();
                RadNumericTextBox_WeightAdjustment.Text = myProduct_Attribute.Weight_Adjustment.ToString();
                chkbox_IsActive.Checked                 = myProduct_Attribute.IsActive;
                chkbox_IsActive.Enabled                 = true;

                btn_Add_Option.Visible            = false;
                btn_Update_Option.Visible         = true;
                btn_Update_Option.CommandArgument = myProduct_Attribute.AttributeID;

                btn_Cancel.Visible      = true;
                btn_CloseWindow.Visible = false;

                MultiView_OptionForm.SetActiveView(View_Form);
            }
        }
Example #3
0
        protected void btn_Update_Option_Command(object sender, CommandEventArgs e)
        {
            if (Page.IsValid && !DataEval.IsEmptyQuery(e.CommandArgument.ToString()))
            {
                ProductAttributeMgr myProductAttributeMgr = new ProductAttributeMgr();

                e2Data[] UpdateData =
                {
                    new e2Data("AttributeID",       e.CommandArgument.ToString()),
                    new e2Data("Attribute_Name",    tbx_AttributeName.Text),
                    new e2Data("IsPreSelected",     chkbox_IsPreSelected.Checked.ToString()),
                    new e2Data("Price_Adjustment",  RadNumericTextBox_PriceAdjustment.Text),
                    new e2Data("Weight_Adjustment", RadNumericTextBox_WeightAdjustment.Text),
                    new e2Data("IsActive",          chkbox_IsActive.Checked.ToString())
                };

                myProductAttributeMgr.Edit_Product_Attribute(UpdateData);

                Control_Init();

                // Check Update Type
                AttributeIndex myAttributeIndex = myProductAttributeMgr.Get_Product_AttributeIndex(_attribute_indexid);

                switch (myAttributeIndex.Input_Option)
                {
                case Input_Option.TextBox:
                    Panel_Updated.Visible = true;
                    break;

                case Input_Option.NumberBox:
                    Panel_Updated.Visible = true;
                    break;

                case Input_Option.DropdownList:
                    MultiView_OptionForm.SetActiveView(View_Button);
                    break;

                case Input_Option.RadioButtonList:
                    MultiView_OptionForm.SetActiveView(View_Button);
                    break;

                case Input_Option.DatePicker:
                    Panel_Updated.Visible = true;
                    break;

                case Input_Option.CheckBox:
                    Panel_Updated.Visible = true;
                    break;

                case Input_Option.CheckBoxList:
                    MultiView_OptionForm.SetActiveView(View_Button);
                    break;

                case Input_Option.ImageURL:
                    Panel_Updated.Visible = true;
                    break;
                }
            }
        }
Example #4
0
        protected void btn_Show_AddForm_Click(object sender, EventArgs e)
        {
            Reset_Form();

            btn_Add_Option.Visible    = true;
            btn_Update_Option.Visible = false;
            btn_Cancel.Visible        = true;
            btn_CloseWindow.Visible   = false;

            MultiView_OptionForm.SetActiveView(View_Form);
        }
Example #5
0
        private void Display_Input_Options()
        {
            ProductAttributeMgr myProductAttributeMgr = new ProductAttributeMgr();

            Reset_Form();

            btn_CloseWindow.Visible = false;

            MultiView_OptionForm.SetActiveView(View_Button);
            Panel_Input_Options.Visible = true;

            RadGrid_Options.Rebind();
        }
Example #6
0
        private void Display_Form()
        {
            ProductAttributeMgr myProductAttributeMgr = new ProductAttributeMgr();

            Product_Attribute myProduct_Attribute = myProductAttributeMgr.Get_Product_Attribute_ByIndexID(_attribute_indexid);

            tbx_AttributeName.Text                  = myProduct_Attribute.Attribute_Name;
            chkbox_IsPreSelected.Checked            = myProduct_Attribute.IsPreSelected;
            RadNumericTextBox_PriceAdjustment.Text  = myProduct_Attribute.Price_Adjustment.ToString();
            RadNumericTextBox_WeightAdjustment.Text = myProduct_Attribute.Weight_Adjustment.ToString();
            chkbox_IsActive.Checked                 = myProduct_Attribute.IsActive;
            chkbox_IsActive.Enabled                 = false;

            btn_Add_Option.Visible            = false;
            btn_Update_Option.Visible         = true;
            btn_Update_Option.CommandArgument = myProduct_Attribute.AttributeID;

            btn_Cancel.Visible      = false;
            btn_CloseWindow.Visible = true;

            MultiView_OptionForm.SetActiveView(View_Form);
            Panel_Input_Options.Visible = false;
        }
Example #7
0
 protected void btn_Cancel_Click(object sender, EventArgs e)
 {
     MultiView_OptionForm.SetActiveView(View_Button);
 }