Beispiel #1
0
        protected void btn_Show_AddForm_Click(object sender, EventArgs e)
        {
            // Reset Form
            Control_FillData();
            droplist_InputOption.Enabled = true;

            // Reset Buttons
            btn_Add_Attribute.Visible    = true;
            btn_Update_Attribute.Visible = false;
            btn_Cancel.Visible           = true;

            MultiView_AttributeForm.SetActiveView(View_Form);
        }
Beispiel #2
0
        protected void btn_Add_Attribute_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                ProductAttributeMgr myProductAttributeMgr = new ProductAttributeMgr();

                string Attribute_IndexID = Nexus.Core.Tools.IDGenerator.Get_New_GUID();

                e2Data[] UpdateData =
                {
                    new e2Data("Attribute_IndexID", Attribute_IndexID),
                    new e2Data("ProductID",         _productid),
                    new e2Data("Attribute_TypeID",  droplist_Attribute_TypeID.SelectedValue),
                    new e2Data("Display_Text",      tbx_DisplayText.Text),
                    new e2Data("IsRequired",        chkbox_IsRequired.Checked.ToString()),
                    new e2Data("Input_OptionID",    droplist_InputOption.SelectedValue),
                    new e2Data("SortOrder",         "0"),
                    new e2Data("IsActive",          chkbox_IsActive.Checked.ToString())
                };

                myProductAttributeMgr.Add_Product_AttributeIndex(UpdateData);

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

                e2Data[] UpdateData_Option =
                {
                    new e2Data("AttributeID",       AttributeID),
                    new e2Data("Attribute_IndexID", Attribute_IndexID),
                    new e2Data("Attribute_Name",    "Default Option"),
                    new e2Data("IsPreSelected",     true.ToString()),
                    new e2Data("Price_Adjustment",  "0.00"),
                    new e2Data("Weight_Adjustment", "0.00"),
                    new e2Data("SortOrder",         "1"),
                    new e2Data("IsActive",          true.ToString())
                };

                myProductAttributeMgr.Add_Product_Attribute(UpdateData_Option);

                Control_Init();

                MultiView_AttributeForm.SetActiveView(View_Button);
            }
        }
Beispiel #3
0
        protected void lbtn_Edit_Attribute_Command(object sender, CommandEventArgs e)
        {
            if (!DataEval.IsEmptyQuery(e.CommandArgument.ToString()))
            {
                ProductAttributeMgr myProductAttributeMgr = new ProductAttributeMgr();

                AttributeIndex myAttributeIndex = myProductAttributeMgr.Get_Product_AttributeIndex(e.CommandArgument.ToString());

                droplist_Attribute_TypeID.SelectedValue = myAttributeIndex.Attribute_TypeID;
                tbx_DisplayText.Text               = myAttributeIndex.Display_Text;
                chkbox_IsRequired.Checked          = myAttributeIndex.IsRequired;
                droplist_InputOption.SelectedValue = StringEnum.GetStringValue(myAttributeIndex.Input_Option);
                droplist_InputOption.Enabled       = false;
                chkbox_IsActive.Checked            = myAttributeIndex.IsActive;

                btn_Add_Attribute.Visible            = false;
                btn_Update_Attribute.Visible         = true;
                btn_Update_Attribute.CommandArgument = myAttributeIndex.Attribute_IndexID;
                btn_Cancel.Visible = true;

                MultiView_AttributeForm.SetActiveView(View_Form);
            }
        }
Beispiel #4
0
        protected void btn_Update_Attribute_Command(object sender, CommandEventArgs e)
        {
            if (Page.IsValid && !DataEval.IsEmptyQuery(e.CommandArgument.ToString()))
            {
                ProductAttributeMgr myProductAttributeMgr = new ProductAttributeMgr();

                e2Data[] UpdateData =
                {
                    new e2Data("Attribute_IndexID", e.CommandArgument.ToString()),
                    new e2Data("Attribute_TypeID",  droplist_Attribute_TypeID.SelectedValue),
                    new e2Data("Display_Text",      tbx_DisplayText.Text),
                    new e2Data("IsRequired",        chkbox_IsRequired.Checked.ToString()),
                    new e2Data("Input_OptionID",    droplist_InputOption.SelectedValue),
                    new e2Data("IsActive",          chkbox_IsActive.Checked.ToString())
                };

                myProductAttributeMgr.Edit_Product_AttributeIndex(UpdateData);

                Control_Init();

                MultiView_AttributeForm.SetActiveView(View_Button);
            }
        }
Beispiel #5
0
 protected void btn_Cancel_Click(object sender, EventArgs e)
 {
     MultiView_AttributeForm.SetActiveView(View_Button);
 }
Beispiel #6
0
        private void Control_Init()
        {
            RadGrid_Attributes.Rebind();

            MultiView_AttributeForm.SetActiveView(View_Button);
        }