protected void btnSave_Click(object sender, EventArgs e)
        {
            ProductCategory pcObj = new ProductCategory(0, txt_cat_name.Value, txt_cat_name_en.Value, txt_cat_desc.Value, txt_cat_desc_en.Value, Convert.ToInt32(cb_P_catID.SelectedValue), isActive.Checked, 1, txtSelectedFile.Value, Convert.ToInt32(txtOrder.Value));

            proCateController.InsertCategory(pcObj);
            Response.Redirect(Request.RawUrl);
        }
Ejemplo n.º 2
0
        protected void grvCategories_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "AddNew")
            {
                GridViewRow     editRow            = grvColor.FooterRow;
                ProductCategory newProductCategory = new ProductCategory(
                    0,
                    (editRow.FindControl("txt_New_Product_Category_Name") as HtmlInputText).Value,
                    (editRow.FindControl("txt_New_Product_Category_Name") as HtmlInputText).Value,
                    (editRow.FindControl("txt_New_Product_Category_Desc") as TextBox).Text,
                    (editRow.FindControl("txt_New_Product_Category_Desc") as TextBox).Text, 0,
                    (editRow.FindControl("chkNewIsHidden") as CheckBox).Checked, 1,
                    (editRow.FindControl("txt_New_Product_Category_Image") as HtmlInputText).Value, 0
                    );

                ch.InsertCategory(newProductCategory);

                grvColor.ShowFooter = false;
                BindData();
            }
        }