protected void frmSupplierMarket_ItemCommand(object sender, FormViewCommandEventArgs e) { Guid mySupplier_Id = Guid.Parse(Request.QueryString["Supplier_Id"]); TextBox txtSupplierMarketName = (TextBox)frmSupplierMarket.FindControl("txtSupplierMarketName"); TextBox txtSupplierMarketCode = (TextBox)frmSupplierMarket.FindControl("txtSupplierMarketCode"); MDMSVC.DC_Message _msg = new MDMSVC.DC_Message(); if (e.CommandName.ToString() == "Add") { MDMSVC.DC_SupplierMarket newObj = new MDMSVC.DC_SupplierMarket { Supplier_Id = mySupplier_Id, IsActive = true, Name = txtSupplierMarketName.Text.Trim(), Code = txtSupplierMarketCode.Text.Trim(), Status = "ACT", Create_Date = DateTime.Now, Create_User = System.Web.HttpContext.Current.User.Identity.Name }; _msg = _objMaster.AddUpdateSupplierMarket(newObj); if (Convert.ToInt32(_msg.StatusCode) == Convert.ToInt32(BootstrapAlertType.Success)) { frmSupplierMarket.ChangeMode(FormViewMode.Insert); frmSupplierMarket.DataBind(); bindSUpplierMarketsGrid(); 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(grdSupplierMarkets.SelectedDataKey.Value.ToString()); MDMSVC.DC_SupplierMarket newObj = new MDMSVC.DC_SupplierMarket { Supplier_Market_Id = myRow_Id, Supplier_Id = mySupplier_Id, IsActive = true, Name = txtSupplierMarketName.Text.Trim(), Code = txtSupplierMarketCode.Text.Trim(), Edit_Date = DateTime.Now, Edit_User = System.Web.HttpContext.Current.User.Identity.Name }; _msg = _objMaster.AddUpdateSupplierMarket(newObj); if (Convert.ToInt32(_msg.StatusCode) == Convert.ToInt32(BootstrapAlertType.Success)) { frmSupplierMarket.ChangeMode(FormViewMode.Insert); frmSupplierMarket.DataBind(); bindSUpplierMarketsGrid(); BootstrapAlert.BootstrapAlertMessage(dvMsg, _msg.StatusMessage, BootstrapAlertType.Success); } else { BootstrapAlert.BootstrapAlertMessage(dvMsg, _msg.StatusMessage, (BootstrapAlertType)_msg.StatusCode); } } }