protected void frmAttributeMapping_ItemCommand(object sender, FormViewCommandEventArgs e) { DropDownList ddlSuppliers = (DropDownList)frmAttributeMapping.FindControl("ddlSuppliers"); TextBox txtSupplierAttributeName = (TextBox)frmAttributeMapping.FindControl("txtSupplierAttributeName"); DropDownList ddlAttributeType = (DropDownList)frmAttributeMapping.FindControl("ddlAttributeType"); if (e.CommandName.ToString() == "Add") { MDMSVC.DC_MasterAttributeMapping newObj = new MDMSVC.DC_MasterAttributeMapping { MasterAttributeMapping_Id = Guid.NewGuid(), SupplierMasterAttribute = txtSupplierAttributeName.Text, Supplier_Id = Guid.Parse(ddlSuppliers.SelectedValue), SystemMasterAttribute_Id = Guid.Parse(ddlAttributeType.SelectedValue), Create_Date = DateTime.Now, Create_User = System.Web.HttpContext.Current.User.Identity.Name, IsActive = true, Status = "MAPPED" }; var result = MapSvc.Mapping_Attribute_Add(newObj); BootstrapAlert.BootstrapAlertMessage(msgAlert, result.StatusMessage, (BootstrapAlertType)(result.StatusCode)); if (result.StatusCode == MDMSVC.ReadOnlyMessageStatusCode.Success) { BinfFormViewInEditMode(newObj.MasterAttributeMapping_Id); } } else if (e.CommandName.ToString() == "Modify") { DropDownList ddlStatus = (DropDownList)frmAttributeMapping.FindControl("ddlStatus"); Guid myRow_Id = Guid.Parse(grdSearchResults.SelectedDataKey.Value.ToString()); MDMSVC.DC_MasterAttributeMapping newObj = new MDMSVC.DC_MasterAttributeMapping { MasterAttributeMapping_Id = myRow_Id, SupplierMasterAttribute = txtSupplierAttributeName.Text, Supplier_Id = Guid.Parse(ddlSuppliers.SelectedValue), SystemMasterAttribute_Id = Guid.Parse(ddlAttributeType.SelectedValue), Edit_Date = DateTime.Now, Edit_User = System.Web.HttpContext.Current.User.Identity.Name, Create_Date = DateTime.Now, Create_User = System.Web.HttpContext.Current.User.Identity.Name, IsActive = true, Status = ddlStatus.SelectedItem.Text }; var result = MapSvc.Mapping_Attribute_Update(newObj); BootstrapAlert.BootstrapAlertMessage(msgAlert, result.StatusMessage, (BootstrapAlertType)(result.StatusCode)); } ; }
protected void grdSearchResults_RowCommand(object sender, GridViewCommandEventArgs e) { msgAlert.Style.Add("display", "none"); msgAlertHdr.Style.Add("display", "none"); Guid myRow_Id = Guid.Parse(e.CommandArgument.ToString()); if (e.CommandName.ToString() == "Select") { BinfFormViewInEditMode(myRow_Id); } else if (e.CommandName.ToString() == "SoftDelete") { MDMSVC.DC_MasterAttributeMapping newObj = new MDMSVC.DC_MasterAttributeMapping { MasterAttributeMapping_Id = myRow_Id, Edit_Date = DateTime.Now, Edit_User = System.Web.HttpContext.Current.User.Identity.Name, Create_Date = DateTime.Now, Create_User = System.Web.HttpContext.Current.User.Identity.Name, IsActive = false, }; var result = MapSvc.Mapping_Attribute_Update(newObj); BootstrapAlert.BootstrapAlertMessage(msgAlertHdr, result.StatusMessage, (BootstrapAlertType)(result.StatusCode)); fillSearchGrid(grdSearchResults.PageIndex); } else if (e.CommandName.ToString() == "UnDelete") { MDMSVC.DC_MasterAttributeMapping newObj = new MDMSVC.DC_MasterAttributeMapping { MasterAttributeMapping_Id = myRow_Id, Edit_Date = DateTime.Now, Edit_User = System.Web.HttpContext.Current.User.Identity.Name, Create_Date = DateTime.Now, Create_User = System.Web.HttpContext.Current.User.Identity.Name, IsActive = true, }; var result = MapSvc.Mapping_Attribute_Update(newObj); BootstrapAlert.BootstrapAlertMessage(msgAlertHdr, result.StatusMessage, (BootstrapAlertType)(result.StatusCode)); fillSearchGrid(grdSearchResults.PageIndex); } }