Example #1
0
 protected void OnDeleteApproverAction_Click(object sender, EventArgs e)
 {
     if (ddlApproverType.SelectedValue == "N")
     {
         string script = "function ferrorMsg(){alert('You cannot delete this approver. This is default approver.'); Sys.Application.remove_load(ferrorMsg);}Sys.Application.add_load(ferrorMsg);";
         ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", script, true);
     }
     else
     {
         if (!string.IsNullOrEmpty(hfApproverActionID.Value))  // delete if an existing record
         {
             SQMModelMgr.DeleteINCFORMAPPROVERLIST(new PSsqmEntities(), Convert.ToDecimal(hfApproverActionID.Value));
             hfApproverActionID.Value = "";
             if (OnApproverActionCommand != null)
             {
                 OnApproverActionCommand("delete");
             }
             BindApproverListR(SQMModelMgr.SelectINCFORMAPPROVERLIST(new PSsqmEntities(), SessionManager.EffLocation.BusinessOrg.BUS_ORG_ID, SessionManager.EffLocation.Plant.PLANT_ID, "R").ToList(), SessionManager.EffLocation, "busorg");
             BindApproverListA(SQMModelMgr.SelectINCFORMAPPROVERLIST(new PSsqmEntities(), SessionManager.EffLocation.BusinessOrg.BUS_ORG_ID, SessionManager.EffLocation.Plant.PLANT_ID, "A").ToList(), SessionManager.EffLocation, "busorg");
         }
     }
 }