Example #1
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);
        }
Example #2
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");
            }
        }
Example #3
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();
            }
        }
Example #4
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);
            }
        }