protected void frmSupplierProductCategory_ItemCommand(object sender, FormViewCommandEventArgs e) { Guid mySupplier_Id = Guid.Parse(Request.QueryString["Supplier_Id"]); DropDownList ddlProductCategory = (DropDownList)frmSupplierProductCategory.FindControl("ddlProductCategory"); DropDownList ddlProductCategorySubType = (DropDownList)frmSupplierProductCategory.FindControl("ddlProductCategorySubType"); // HtmlInputCheckBox chckbIsDefaultSupplier = (HtmlInputCheckBox)frmSupplierProductCategory.FindControl("chckbIsDefaultSupplier"); MDMSVC.DC_Message _msg = new MDMSVC.DC_Message(); dvMsg.Visible = true; if (e.CommandName.ToString() == "Add") { MDMSVC.DC_Supplier_ProductCategory newObj = new MDMSVC.DC_Supplier_ProductCategory { ProductCategory = ddlProductCategory.SelectedItem.Text, ProductCategorySubType = ddlProductCategorySubType.SelectedItem.Text, Create_Date = DateTime.Now, Supplier_Id = mySupplier_Id, //IsDefaultSupplier = chckbIsDefaultSupplier.Checked, Create_User = System.Web.HttpContext.Current.User.Identity.Name, IsActive = true, Status = "ACT" }; _msg = _objMaster.AddUpdateSupplier_ProductCategory(newObj); if (Convert.ToInt32(_msg.StatusCode) == Convert.ToInt32(BootstrapAlertType.Success)) { frmSupplierProductCategory.ChangeMode(FormViewMode.Insert); frmSupplierProductCategory.DataBind(); BindPageData(); BootstrapAlert.BootstrapAlertMessage(dvMsg, _msg.StatusMessage, BootstrapAlertType.Success); } else { BootstrapAlert.BootstrapAlertMessage(dvMsg, _msg.StatusMessage, (BootstrapAlertType)_msg.StatusCode); } } if (e.CommandName.ToString() == "Modify") { Guid myRow_Id = Guid.Parse(grdSupplierProductCategory.SelectedDataKey.Value.ToString()); MDMSVC.DC_Supplier_ProductCategory newObj = new MDMSVC.DC_Supplier_ProductCategory { Supplier_ProductCategory_Id = myRow_Id, Supplier_Id = mySupplier_Id, ProductCategory = ddlProductCategory.SelectedItem.Text, ProductCategorySubType = ddlProductCategorySubType.SelectedItem.Text, //IsDefaultSupplier = chckbIsDefaultSupplier.Checked, Edit_Date = DateTime.Now, Edit_User = System.Web.HttpContext.Current.User.Identity.Name, IsActive = true, Status = "ACT" }; _msg = _objMaster.AddUpdateSupplier_ProductCategory(newObj); if (Convert.ToInt32(_msg.StatusCode) == Convert.ToInt32(BootstrapAlertType.Success)) { frmSupplierProductCategory.ChangeMode(FormViewMode.Insert); frmSupplierProductCategory.DataBind(); BindPageData(); BootstrapAlert.BootstrapAlertMessage(dvMsg, _msg.StatusMessage, BootstrapAlertType.Success); } else { BootstrapAlert.BootstrapAlertMessage(dvMsg, _msg.StatusMessage, (BootstrapAlertType)_msg.StatusCode); } } }