Exemplo n.º 1
0
        protected void btn_AddOption_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                ProductVariantMgr myProductVariantMgr = new ProductVariantMgr();

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

                // Product Variant
                e2Data[] UpdateData =
                {
                    new e2Data("OptionID",           OptionID),
                    new e2Data("Variant_PropertyID", _variant_propertyid),
                    new e2Data("Option_Name",        tbx_AddOption_Name.Text),
                    new e2Data("Option_Value",       tbx_AddOption_Value.Text),
                    new e2Data("SortOrder",          (myProductVariantMgr.Count_Variant_Property_Option(_variant_propertyid) + 1).ToString()),
                    new e2Data("IsActive",           chkbox_AddOption_IsActive.Checked.ToString())
                };

                myProductVariantMgr.Add_Product_Variant_Property_Option(UpdateData);

                Control_FillData_Option();
                RadGrid_Options.Rebind();
            }
        }
Exemplo n.º 2
0
        private void Control_Init()
        {
            ProductVariantMgr myProductVariantMgr = new ProductVariantMgr();

            GridView_Product_Variants.DataSource = myProductVariantMgr.Get_Product_Variants();
            GridView_Product_Variants.DataBind();
        }
Exemplo n.º 3
0
        private void Control_Init()
        {
            ProductVariantMgr myProductVariantMgr = new ProductVariantMgr();

            List <Variant> myVariants = myProductVariantMgr.Get_Product_Variants();

            DataList_VariantList.DataSource = myVariants;
            DataList_VariantList.DataBind();


            if (DataEval.IsEmptyQuery(_product_variantid))
            {
                _product_variantid             = myVariants[0].Product_VariantID;
                ViewState["Product_VariantID"] = _product_variantid;
            }

            ProductAttributeMgr myProductAttributeMgr = new ProductAttributeMgr();

            GridView_Attributes.DataSource = myProductAttributeMgr.Get_Product_Attribute_Types(_product_variantid);
            GridView_Attributes.DataBind();

            lbl_Variant.Text = myProductVariantMgr.Get_Product_Variant(_product_variantid).Variant_Name;

            MultiView_Attribute.SetActiveView(View_VariantList);
        }
Exemplo n.º 4
0
        protected void btn_Update_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                ProductMgr myProductMgr = new ProductMgr();

                e2Data[] UpdateData =
                {
                    new e2Data("ProductID",         _productid),
                    new e2Data("Product_Title",     tbx_Product_Title.Text),
                    new e2Data("Title_Type",        rbtn_Product_Title_Type.SelectedValue),
                    new e2Data("Product_SKU",       tbx_Product_SKU.Text),
                    new e2Data("ManufacturerID",    droplist_Product_ManufacturerID.SelectedValue),
                    new e2Data("Manufacturer_SKU",  tbx_Product_Manufacturer_SKU.Text),
                    new e2Data("CurrencyID",        droplist_Product_CurrencyID.SelectedValue),
                    new e2Data("RRP_Price",         RadNumericTextBox_Product_RRP.Text),
                    new e2Data("IsActive",          chkbox_Product_IsActive.Checked.ToString()),
                    new e2Data("LastUpdate_Date",   DateTime.Now.ToString()),
                    new e2Data("LastUpdate_UserID", Security.Users.UserStatus.Current_UserID(this.Page))
                };
                myProductMgr.Edit_Product(UpdateData);

                // Product Specification
                ProductVariantMgr myProductVariantMgr = new ProductVariantMgr();
                myProductVariantMgr.Edit_Product_Properties(PlaceHolder_Product_Spec, _product_variantid, ProductID);

                Panel_Updated.Visible = true;
            }
        }
Exemplo n.º 5
0
        protected void GridView_Product_Variants_Sorting(object sender, GridViewSortEventArgs e)
        {
            ProductVariantMgr myProductVariantMgr = new ProductVariantMgr();

            GridView_Product_Variants.DataSource = myProductVariantMgr.Get_Product_Variants(e.SortExpression, e.SortDirection.ToString());
            GridView_Product_Variants.DataBind();
        }
Exemplo n.º 6
0
        private void Control_FillData()
        {
            string Product_VariantID = Request["Product_VariantID"];
            bool   variantFound      = false;

            if (!DataEval.IsEmptyQuery(Product_VariantID))
            {
                ProductVariantMgr myProductVariantMgr = new ProductVariantMgr();

                if (myProductVariantMgr.Chk_Product_Variant(Product_VariantID))
                {
                    Variant myVariant = myProductVariantMgr.Get_Product_Variant(Product_VariantID);

                    lbl_Variant_Name.Text = myVariant.Variant_Name;
                    tbx_Variant_Name.Text = myVariant.Variant_Name;
                    lbl_Variant_Type.Text = StringEnum.GetStringValue(myVariant.Variant_Type);
                    tbx_Table_Name.Text   = myVariant.Table_Name;

                    // Spliter
                    tbx_Spliter_Name.Text = "";

                    variantFound = true;
                }
            }

            if (!variantFound)
            {
                Response.Redirect("Default.aspx");
            }
        }
Exemplo n.º 7
0
        protected void RadGrid_VariantSpliter_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            ProductVariantMgr myProductVariantMgr = new ProductVariantMgr();

            RadGrid_VariantSpliter.DataSource = myProductVariantMgr.Get_Product_Variant_Spliters(Request["Product_VariantID"]);
            //RadGrid_VariantSpliter.DataBind();
        }
Exemplo n.º 8
0
        private void Control_Init()
        {
            string Variant_PropertyID = Request["Variant_PropertyID"];

            if (!DataEval.IsEmptyQuery(Variant_PropertyID))
            {
                ProductVariantMgr myProductVariantMgr = new ProductVariantMgr();

                Variant_Property myVariant_Property = myProductVariantMgr.Get_Product_Variant_Property(Variant_PropertyID);

                _variant_propertyid             = myVariant_Property.Variant_PropertyID;
                ViewState["Variant_PropertyID"] = _variant_propertyid;

                // Fill the form
                Panel_Input_Options.Visible = false;
                Panel_Updated.Visible       = false;

                tbx_Property_Name.Text    = myVariant_Property.Property_Name;
                lbl_InputOption.Text      = myVariant_Property.Input_Option.ToString();
                tbx_Default_Value.Text    = myVariant_Property.Default_Value;
                tbx_Tooltips.Text         = myVariant_Property.Tooltips;
                tbx_Field_Name.Text       = myVariant_Property.Field_Name;
                chkbox_IsRequired.Checked = myVariant_Property.IsRequired;
                chkbox_IsFilter.Checked   = myVariant_Property.IsFilter;
                chkbox_IsSort.Checked     = myVariant_Property.IsSort;

                switch (myVariant_Property.Input_Option)
                {
                case Input_Option.TextBox:
                    break;

                case Input_Option.NumberBox:
                    break;

                case Input_Option.DropdownList:
                    Display_Input_Options();
                    break;

                case Input_Option.RadioButtonList:
                    Display_Input_Options();
                    break;

                case Input_Option.DatePicker:
                    break;

                case Input_Option.CheckBox:
                    break;

                case Input_Option.CheckBoxList:
                    Display_Input_Options();
                    break;

                case Input_Option.ImageURL:
                    break;
                }
            }
        }
Exemplo n.º 9
0
        protected void RadGrid_VariantSpliter_RowDrop(object sender, GridDragDropEventArgs e)
        {
            if (string.IsNullOrEmpty(e.HtmlElement) && e.DestDataItem.OwnerGridID == RadGrid_VariantSpliter.ClientID)
            {
                if (e.DraggedItems[0].OwnerGridID == RadGrid_VariantSpliter.ClientID)
                {
                    #region items are Spliter

                    if (e.DestDataItem != null)
                    {
                        ProductVariantMgr myProductVariantMgr = new ProductVariantMgr();

                        Variant_Spliter myVariant_Spliter = myProductVariantMgr.Get_Product_Variant_Spliter(e.DestDataItem.GetDataKeyValue("Variant_SpliterID").ToString());

                        List <Variant_Spliter> myVariant_Spliters = myProductVariantMgr.Get_Product_Variant_Spliters(myVariant_Spliter.Product_VariantID, "SortOrder");

                        Variant_Spliter draggedVariant_Spliter = Get_Variant_Spliter_in_List(myVariant_Spliters, e.DraggedItems[0].GetDataKeyValue("Variant_SpliterID").ToString());
                        Variant_Spliter destVariant_Spliter    = Get_Variant_Spliter_in_List(myVariant_Spliters, e.DestDataItem.GetDataKeyValue("Variant_SpliterID").ToString());

                        int destIndex = myVariant_Spliters.IndexOf(destVariant_Spliter);

                        if (e.DropPosition == GridItemDropPosition.Above && e.DestDataItem.ItemIndex > e.DraggedItems[0].ItemIndex)
                        {
                            destIndex -= 1;
                        }
                        if (e.DropPosition == GridItemDropPosition.Below && e.DestDataItem.ItemIndex < e.DraggedItems[0].ItemIndex)
                        {
                            destIndex += 1;
                        }

                        myVariant_Spliters.Remove(draggedVariant_Spliter);
                        myVariant_Spliters.Insert(destIndex, draggedVariant_Spliter);

                        foreach (Variant_Spliter Variant_Spliter in myVariant_Spliters)
                        {
                            // Product Variant
                            e2Data[] UpdateData =
                            {
                                new e2Data("Variant_SpliterID", Variant_Spliter.Variant_SpliterID),
                                new e2Data("SortOrder",         (myVariant_Spliters.IndexOf(Get_Variant_Spliter_in_List(myVariant_Spliters, Variant_Spliter.Variant_SpliterID)) + 1).ToString())
                            };

                            myProductVariantMgr.Edit_Product_Variant_Spliter(UpdateData);
                        }
                    }

                    #endregion

                    Control_Init();
                }
            }
        }
Exemplo n.º 10
0
        protected void lbtn_Property_Delete_Command(object sender, CommandEventArgs e)
        {
            if (!DataEval.IsEmptyQuery(e.CommandArgument.ToString()))
            {
                ProductVariantMgr myProductVariantMgr = new ProductVariantMgr();

                // Remove Property and it's options
                myProductVariantMgr.Remove_Product_Variant_Property_Option_ByPropertyID(e.CommandArgument.ToString());
                myProductVariantMgr.Remove_Product_Variant_Property(e.CommandArgument.ToString());

                Control_Init();
            }
        }
Exemplo n.º 11
0
        protected void lbtn_DeleteOption_Command(object sender, CommandEventArgs e)
        {
            if (!DataEval.IsEmptyQuery(e.CommandArgument.ToString()))
            {
                ProductVariantMgr myProductVariantMgr = new ProductVariantMgr();

                // Need to add code for check option usage later

                // Remove Option
                myProductVariantMgr.Remove_Product_Variant_Property_Option(e.CommandArgument.ToString());

                RadGrid_Options.Rebind();
            }
        }
Exemplo n.º 12
0
        private void Control_Init()
        {
            string Variant_SpliterID = Request["Variant_SpliterID"];

            if (!DataEval.IsEmptyQuery(Variant_SpliterID))
            {
                ProductVariantMgr myProductVariantMgr = new ProductVariantMgr();

                Variant_Spliter myVariant_Spliter = myProductVariantMgr.Get_Product_Variant_Spliter(Variant_SpliterID);

                _variant_spliterid             = myVariant_Spliter.Variant_SpliterID;
                ViewState["Variant_SpliterID"] = _variant_spliterid;

                tbx_Spliter_Name.Text = myVariant_Spliter.Spliter_Name;
            }
        }
Exemplo n.º 13
0
        protected void lbtn_Variant_Select_Command(object sender, CommandEventArgs e)
        {
            if (!DataEval.IsEmptyQuery(e.CommandArgument.ToString()))
            {
                _product_variantid             = e.CommandArgument.ToString();
                ViewState["Product_VariantID"] = _product_variantid;

                ProductVariantMgr   myProductVariantMgr   = new ProductVariantMgr();
                ProductAttributeMgr myProductAttributeMgr = new ProductAttributeMgr();

                lbl_Variant.Text = myProductVariantMgr.Get_Product_Variant(_product_variantid).Variant_Name;

                GridView_Attributes.DataSource = myProductAttributeMgr.Get_Product_Attribute_Types(_product_variantid);
                GridView_Attributes.DataBind();
            }
        }
Exemplo n.º 14
0
        private void Control_FillData()
        {
            // ViewState
            ViewState["CategoryID"]      = _categoryid;
            ViewState["ProductEdit_URL"] = _productedit_url;

            ProductVariantMgr myProductVariantMgr = new ProductVariantMgr();
            ProductMgr        myProductMgr        = new ProductMgr();

            // Search
            tbx_Search_Product_SKU.Text      = "";
            tbx_Search_Manufacturer_SKU.Text = "";
            tbx_Search_Product_Title.Text    = "";

            ViewState["Search_Field"] = _search_field;
            ViewState["Keyword"]      = _keyword;

            // Filter: Product Variant
            droplist_Filter_Product_Variant.DataSource     = myProductVariantMgr.Get_Product_Variants();
            droplist_Filter_Product_Variant.DataTextField  = "Variant_Name";
            droplist_Filter_Product_Variant.DataValueField = "Product_VariantID";
            droplist_Filter_Product_Variant.DataBind();

            // Add an empty
            ListItem myEmpty_Product_Variant = new ListItem();

            myEmpty_Product_Variant.Text  = "Select a Product Variant";
            myEmpty_Product_Variant.Value = "-1";
            droplist_Filter_Product_Variant.Items.Insert(0, myEmpty_Product_Variant);

            droplist_Filter_Product_Variant.SelectedIndex = 0;

            // Filter: manufacturer

            droplist_Filter_Manufacturer.DataSource     = myProductMgr.Get_Manufacturers("Name", true.ToString());
            droplist_Filter_Manufacturer.DataTextField  = "Name";
            droplist_Filter_Manufacturer.DataValueField = "ManufacturerID";
            droplist_Filter_Manufacturer.DataBind();

            ListItem myEmpty_Manufacturer = new ListItem();

            myEmpty_Manufacturer.Text  = "Select a Manufacturer";
            myEmpty_Manufacturer.Value = "-1";
            droplist_Filter_Manufacturer.Items.Insert(0, myEmpty_Manufacturer);

            droplist_Filter_Manufacturer.SelectedIndex = 0;
        }
Exemplo n.º 15
0
        private void Create_Property_Options(string Variant_PropertyID)
        {
            string OptionID = Nexus.Core.Tools.IDGenerator.Get_New_GUID();

            ProductVariantMgr myProductVariantMgr = new ProductVariantMgr();

            e2Data[] UpdateData =
            {
                new e2Data("OptionID",           OptionID),
                new e2Data("Variant_PropertyID", Variant_PropertyID),
                new e2Data("Option_Name",        "Default Name"),
                new e2Data("Option_Value",       "Default Value"),
                new e2Data("SortOrder",          "1")
            };

            myProductVariantMgr.Add_Product_Variant_Property_Option(UpdateData);
        }
Exemplo n.º 16
0
        protected void btn_UpdateVariant_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                ProductVariantMgr myProductVariantMgr = new ProductVariantMgr();

                e2Data[] UpdateData =
                {
                    new e2Data("Variant_SpliterID", _variant_spliterid),
                    new e2Data("Spliter_Name",      tbx_Spliter_Name.Text)
                };

                myProductVariantMgr.Edit_Product_Variant_Spliter(UpdateData);

                btn_Cancel_Click(sender, e);
            }
        }
Exemplo n.º 17
0
        private void Product_Control_Init(bool IsPagePostBack = false)
        {
            if (!DataEval.IsEmptyQuery(_product_variantid))
            {
                if (!IsPagePostBack)
                {
                    PlaceHolder_Product_Spec.Controls.Clear();
                }

                ProductVariantMgr myProductVariantMgr = new ProductVariantMgr();
                myProductVariantMgr.Product_Form_Generator(
                    PlaceHolder_Product_Spec,
                    droplist_Product_VariantID.SelectedValue,
                    Product_FormMode.Create,
                    IsPagePostBack
                    );
            }
        }
Exemplo n.º 18
0
        protected void lbtn_DeleteSpliter_Command(object sender, CommandEventArgs e)
        {
            if (!DataEval.IsEmptyQuery(e.CommandArgument.ToString()))
            {
                ProductVariantMgr myProductVariantMgr = new ProductVariantMgr();

                if (myProductVariantMgr.Chk_Variant_Spliter_usage(e.CommandArgument.ToString()))
                {
                    Nexus.Core.Tools.AlertMessage.Show_Alert(this.Page, "<h4>Selected spliter already have properties <br /> Please delete them before apply this action.</h4>", "Action failed!", 450, 150);
                }
                else
                {
                    myProductVariantMgr.Remove_Product_Variant_Spliter(e.CommandArgument.ToString());

                    Control_Init();
                }
            }
        }
Exemplo n.º 19
0
        protected void RadGrid_Options_RowDrop(object sender, GridDragDropEventArgs e)
        {
            if (e.DestDataItem != null &&
                string.IsNullOrEmpty(e.HtmlElement) &&
                e.DestDataItem.OwnerGridID == RadGrid_Options.ClientID)
            {
                ProductVariantMgr myProductVariantMgr = new ProductVariantMgr();

                Property_Option myProperty_Option = myProductVariantMgr.Get_Product_Variant_Property_Option(e.DestDataItem.GetDataKeyValue("OptionID").ToString());

                List <Property_Option> myProperty_Options = myProductVariantMgr.Get_Product_Variant_Property_Options(myProperty_Option.Variant_PropertyID, "SortOrder");

                Property_Option draggedProperty_Option = Get_Property_Option_in_List(myProperty_Options, e.DraggedItems[0].GetDataKeyValue("OptionID").ToString());
                Property_Option destProperty_Option    = Get_Property_Option_in_List(myProperty_Options, e.DestDataItem.GetDataKeyValue("OptionID").ToString());

                int destIndex = myProperty_Options.IndexOf(destProperty_Option);

                if (e.DropPosition == GridItemDropPosition.Above && e.DestDataItem.ItemIndex > e.DraggedItems[0].ItemIndex)
                {
                    destIndex -= 1;
                }
                if (e.DropPosition == GridItemDropPosition.Below && e.DestDataItem.ItemIndex < e.DraggedItems[0].ItemIndex)
                {
                    destIndex += 1;
                }

                myProperty_Options.Remove(draggedProperty_Option);
                myProperty_Options.Insert(destIndex, draggedProperty_Option);

                foreach (Property_Option Property_Option in myProperty_Options)
                {
                    // Product Variant
                    e2Data[] UpdateData =
                    {
                        new e2Data("OptionID",  Property_Option.OptionID),
                        new e2Data("SortOrder", (myProperty_Options.IndexOf(Get_Property_Option_in_List(myProperty_Options, Property_Option.OptionID)) + 1).ToString())
                    };

                    myProductVariantMgr.Edit_Product_Variant_Property_Option(UpdateData);
                }

                RadGrid_Options.Rebind();
            }
        }
Exemplo n.º 20
0
        private void Product_Control_Init(bool IsPagePostBack = false)
        {
            if (!DataEval.IsEmptyQuery(_product_variantid))
            {
                if (!IsPagePostBack)
                {
                    PlaceHolder_Product_Spec.Controls.Clear();
                }

                ProductVariantMgr myProductVariantMgr = new ProductVariantMgr();
                myProductVariantMgr.Product_Form_Generator(
                    PlaceHolder_Product_Spec,
                    _product_variantid,
                    Product_FormMode.Edit,
                    IsPagePostBack,
                    _productid
                    );
            }
        }
Exemplo n.º 21
0
        private void Control_FillData()
        {
            ProductVariantMgr myProductVariantMgr = new ProductVariantMgr();

            droplist_AddAttribute_VariantID.Items.Clear();

            droplist_AddAttribute_VariantID.DataSource     = myProductVariantMgr.Get_Product_Variants();
            droplist_AddAttribute_VariantID.DataTextField  = "Variant_Name";
            droplist_AddAttribute_VariantID.DataValueField = "Product_VariantID";
            droplist_AddAttribute_VariantID.DataBind();
            droplist_AddAttribute_VariantID.SelectedIndex = 0;

            tbx_AddAttribute_Name.Text           = "";
            tbx_AddAttribute_Description.Text    = "";
            chkbox_AddAttribute_IsActive.Checked = true;

            tbx_EditAttribute_Name.Text           = "";
            tbx_EditAttribute_Description.Text    = "";
            chkbox_EditAttribute_IsActive.Checked = true;
        }
Exemplo n.º 22
0
        protected void RadGrid_VariantSpliter_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                GridDataItem myItem   = (GridDataItem)e.Item;
                string       myItemID = myItem.GetDataKeyValue("Variant_SpliterID").ToString();

                HyperLink myAddPropertyLink = (HyperLink)myItem["Variant_SpliterID"].FindControl("hlink_AddProperty");
                myAddPropertyLink.Attributes["href"]    = "#";
                myAddPropertyLink.Attributes["onclick"] = string.Format("return Show_ControlManager('PoP_PropertyCreate.aspx?Variant_SpliterID={0}&Action=Create');", myItemID);

                HyperLink myEditLink = (HyperLink)myItem["Variant_SpliterID"].FindControl("hlink_EditSpliter");
                myEditLink.Attributes["href"]    = "#";
                myEditLink.Attributes["onclick"] = string.Format("return Show_ControlManager('PoP_SpliterEditor.aspx?Variant_SpliterID={0}');", myItemID);

                LinkButton myDeleteLink = (LinkButton)myItem["Variant_SpliterID"].FindControl("lbtn_DeleteSpliter");
                myDeleteLink.OnClientClick = string.Format("return confirm('Are you sure you want to delete spliter \"{0}\" ?');", DataBinder.Eval(myItem.DataItem, "Spliter_Name"));
            }

            if (e.Item is GridNestedViewItem)
            {
                GridNestedViewItem myNestedItem = (GridNestedViewItem)e.Item;
                string             myItemID     = myNestedItem.ParentItem.GetDataKeyValue("Variant_SpliterID").ToString();

                RadGrid myRadGrid = (RadGrid)myNestedItem.FindControl("RadGrid_VariantProperties");

                ProductVariantMgr myProductVariantMgr = new ProductVariantMgr();

                List <Variant_Property> myVariant_Properties = myProductVariantMgr.Get_Product_Variant_Properties_BySpliterID(myItemID);

                if (myVariant_Properties.Count < 1)
                {
                    myRadGrid.Visible = false;
                }
                else
                {
                    myRadGrid.DataSource = myVariant_Properties;
                    myRadGrid.DataBind();
                }
            }
        }
Exemplo n.º 23
0
        protected void lbtn_EditOption_Command(object sender, CommandEventArgs e)
        {
            if (!DataEval.IsEmptyQuery(e.CommandArgument.ToString()))
            {
                ProductVariantMgr myProductVariantMgr = new ProductVariantMgr();

                // Load options
                Property_Option myProperty_Option = myProductVariantMgr.Get_Product_Variant_Property_Option(e.CommandArgument.ToString());

                // Need to add code for enable edit value later

                Control_FillData_Option();
                tbx_EditOption_Name.Text           = myProperty_Option.Option_Name;
                tbx_EditOption_Value.Text          = myProperty_Option.Option_Value;
                chkbox_EditOption_IsActive.Checked = myProperty_Option.IsActive;
                btn_EditOption.CommandArgument     = myProperty_Option.OptionID;


                MultiView_InputOption.SetActiveView(View_Edit);
            }
        }
Exemplo n.º 24
0
        protected void btn_Create_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                string Product_VariantID = Nexus.Core.Tools.IDGenerator.Get_New_GUID_PlainText();

                ProductVariantMgr myProductVariantMgr = new ProductVariantMgr();

                e2Data[] UpdateData =
                {
                    new e2Data("Product_VariantID", Product_VariantID),
                    new e2Data("Variant_Name",      tbx_Variant_Name.Text),
                    new e2Data("Variant_Type",      droplist_Variant_Type.SelectedValue),
                    new e2Data("Table_Name",        tbx_Table_Name.Text)
                };

                myProductVariantMgr.Add_Product_Variant(UpdateData);

                Control_FillData();
                Control_Init();
            }
        }
Exemplo n.º 25
0
        protected void btn_EditOption_Command(object sender, CommandEventArgs e)
        {
            if (Page.IsValid && !DataEval.IsEmptyQuery(e.CommandArgument.ToString()))
            {
                ProductVariantMgr myProductVariantMgr = new ProductVariantMgr();

                // Product Variant
                e2Data[] UpdateData =
                {
                    new e2Data("OptionID",     e.CommandArgument.ToString()),
                    new e2Data("Option_Name",  tbx_EditOption_Name.Text),
                    new e2Data("Option_Value", tbx_EditOption_Value.Text),
                    new e2Data("IsActive",     chkbox_EditOption_IsActive.Checked.ToString())
                };

                myProductVariantMgr.Edit_Product_Variant_Property_Option(UpdateData);

                Control_FillData_Option();
                RadGrid_Options.Rebind();
                MultiView_InputOption.SetActiveView(View_Add);
            }
        }
Exemplo n.º 26
0
        protected void btn_UpdateVariant_Click(object sender, EventArgs e)
        {
            string Product_VariantID = Request["Product_VariantID"];

            if (Page.IsValid && !DataEval.IsEmptyQuery(Product_VariantID))
            {
                ProductVariantMgr myProductVariantMgr = new ProductVariantMgr();


                // Product Variant
                e2Data[] UpdateData =
                {
                    new e2Data("Product_VariantID", Product_VariantID),
                    new e2Data("Variant_Name",      tbx_Variant_Name.Text),
                    new e2Data("Table_Name",        tbx_Table_Name.Text)
                };

                myProductVariantMgr.Edit_Product_Variant(UpdateData);

                Control_FillData();
            }
        }
Exemplo n.º 27
0
        protected void btn_UpdateProperty_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                ProductVariantMgr myProductVariantMgr = new ProductVariantMgr();

                e2Data[] UpdateData =
                {
                    new e2Data("Variant_PropertyID", _variant_propertyid),
                    new e2Data("Property_Name",      tbx_Property_Name.Text),
                    new e2Data("Default_Value",      tbx_Default_Value.Text),
                    new e2Data("Tooltips",           tbx_Tooltips.Text),
                    new e2Data("IsRequired",         chkbox_IsRequired.Checked.ToString()),
                    new e2Data("IsFilter",           chkbox_IsFilter.Checked.ToString()),
                    new e2Data("IsSort",             chkbox_IsSort.Checked.ToString()),
                    new e2Data("Field_Name",         tbx_Field_Name.Text)
                };

                myProductVariantMgr.Edit_Product_Variant_Property(UpdateData);

                Panel_Updated.Visible = true;
            }
        }
Exemplo n.º 28
0
        protected void lbtn_Edit_Command(object sender, CommandEventArgs e)
        {
            if (!DataEval.IsEmptyQuery(e.CommandArgument.ToString()))
            {
                Control_FillData();

                ProductAttributeMgr myProductAttributeMgr = new ProductAttributeMgr();

                Attribute_Type myAttribute_Type = myProductAttributeMgr.Get_Product_Attribute_Type(e.CommandArgument.ToString());

                ProductVariantMgr myProductVariantMgr = new ProductVariantMgr();

                lbl_editAttribute_VariantID.Text = myProductVariantMgr.Get_Product_Variant(myAttribute_Type.Product_VariantID).Variant_Name;

                tbx_EditAttribute_Name.Text           = myAttribute_Type.Attribute_Name;
                tbx_EditAttribute_Description.Text    = myAttribute_Type.Description;
                chkbox_EditAttribute_IsActive.Checked = myAttribute_Type.IsActive;

                btn_EditAttribute_Update.CommandArgument = myAttribute_Type.Attribute_TypeID;

                MultiView_Attribute.SetActiveView(View_Edit);
            }
        }
Exemplo n.º 29
0
        protected void btn_CreateSpliter_Click(object sender, EventArgs e)
        {
            string Product_VariantID = Request["Product_VariantID"];

            if (Page.IsValid && !DataEval.IsEmptyQuery(Product_VariantID))
            {
                string Variant_SpliterID = Nexus.Core.Tools.IDGenerator.Get_New_GUID_PlainText();

                ProductVariantMgr myProductVariantMgr = new ProductVariantMgr();

                // Product Variant
                e2Data[] UpdateData =
                {
                    new e2Data("Variant_SpliterID", Variant_SpliterID),
                    new e2Data("Product_VariantID", Product_VariantID),
                    new e2Data("Spliter_Name",      tbx_Spliter_Name.Text),
                    new e2Data("SortOrder",         (myProductVariantMgr.Count_Variant_Spliter(Product_VariantID) + 1).ToString())
                };

                myProductVariantMgr.Add_Product_Variant_Spliter(UpdateData);

                Control_Init();
            }
        }
Exemplo n.º 30
0
        protected void btn_CreateProperty_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                string Variant_SpliterID = Request["Variant_SpliterID"];

                if (!DataEval.IsEmptyQuery(Variant_SpliterID))
                {
                    ProductVariantMgr myProductVariantMgr = new ProductVariantMgr();

                    Variant_Spliter myVariant_Spliter = myProductVariantMgr.Get_Product_Variant_Spliter(Variant_SpliterID);

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

                    e2Data[] UpdateData =
                    {
                        new e2Data("Variant_PropertyID", Variant_PropertyID),
                        new e2Data("Product_VariantID",  myVariant_Spliter.Product_VariantID),
                        new e2Data("Variant_SpliterID",  myVariant_Spliter.Variant_SpliterID),
                        new e2Data("Property_Name",      tbx_Property_Name.Text),
                        new e2Data("Input_Option",       droplist_InputOption.SelectedValue),
                        new e2Data("Default_Value",      tbx_Default_Value.Text),
                        new e2Data("Tooltips",           tbx_Tooltips.Text),
                        new e2Data("IsRequired",         chkbox_IsRequired.Checked.ToString()),
                        new e2Data("IsFilter",           chkbox_IsFilter.Checked.ToString()),
                        new e2Data("IsSort",             chkbox_IsSort.Checked.ToString()),
                        new e2Data("SortOrder",          (myProductVariantMgr.Count_Variant_Property(myVariant_Spliter.Variant_SpliterID) + 1).ToString()),
                        new e2Data("Field_Name",         tbx_Field_Name.Text)
                    };

                    myProductVariantMgr.Add_Product_Variant_Property(UpdateData);

                    Input_Option myInput_Option = (Input_Option)StringEnum.Parse(typeof(Input_Option), droplist_InputOption.SelectedValue, true);

                    switch (myInput_Option)
                    {
                    case Input_Option.TextBox:
                        break;

                    case Input_Option.NumberBox:
                        break;

                    case Input_Option.DropdownList:
                        Create_Property_Options(Variant_PropertyID);
                        break;

                    case Input_Option.RadioButtonList:
                        Create_Property_Options(Variant_PropertyID);
                        break;

                    case Input_Option.DatePicker:
                        break;

                    case Input_Option.CheckBox:
                        break;

                    case Input_Option.CheckBoxList:
                        Create_Property_Options(Variant_PropertyID);
                        break;

                    case Input_Option.ImageURL:
                        break;
                    }

                    btn_Cancel_Click(sender, e);
                }
            }
        }