public static string Deficient(string cgi) { CryptoJS objcryptoJS = new CryptoJS(); string strURL = string.Empty; string ContractorAppId = string.Empty; try { ContractorAppId = cgi.ToString() == null ? string.Empty : cgi.ToString(); if (GlobalMethods.ValueIsNull(ContractorAppId).Length > 0) { ContractorAppId = objcryptoJS.AES_decrypt(HttpUtility.UrlEncode(cgi), AppConstants.secretKey, AppConstants.initVec).ToString(); } List <clsSupervisor> objSPCont = new List <clsSupervisor>(); objSPCont = SupervisorDAL.SelectDynamicSupervisor("SupervisorId = " + ContractorAppId + "", "SupervisorId"); if (objSPCont != null) { objSPCont[0].IsActive = 3; if (!SupervisorDAL.UpdateSupervisor(objSPCont[0])) { } } } catch (Exception) { ErrorHandler.ErrorPage(); } return("MDESuperAppView.aspx?superapps=active&cgi=" + cgi + ""); }
public static string Disapprove(string cgi) { CryptoJS objcryptoJS = new CryptoJS(); string strURL = string.Empty; string ContractorAppId = string.Empty; try { ContractorAppId = cgi.ToString() == null ? string.Empty : cgi.ToString(); if (GlobalMethods.ValueIsNull(ContractorAppId).Length > 0) { ContractorAppId = objcryptoJS.AES_decrypt(HttpUtility.UrlEncode(cgi), AppConstants.secretKey, AppConstants.initVec).ToString(); } List <clsSupervisor> objSPCont = new List <clsSupervisor>(); objSPCont = SupervisorDAL.SelectDynamicSupervisor("SupervisorId = " + ContractorAppId + "", "SupervisorId"); if (objSPCont != null) { objSPCont[0].IsActive = 0; if (SupervisorDAL.UpdateSupervisor(objSPCont[0])) { List <clsUserRole> lstURole = new List <clsUserRole>(); lstURole = UserRoleDAL.SelectDynamicUserRole("RoleId = 5 and AuthorizedUserId = " + objSPCont[0].CreatedBy + "", "UserRoleId"); if (lstURole != null) { if (lstURole.Count > 0) { // It should get only one record per ROle. if (!UserRoleDAL.DeleteUserRole(lstURole[0].UserRoleId)) { } } } } } } catch (Exception) { ErrorHandler.ErrorPage(); } return("MDESuperAppView.aspx?superapps=active&cgi=" + cgi + ""); }
public static string Approve(string cgi) { CryptoJS objcryptoJS = new CryptoJS(); string strURL = string.Empty; string ContractorAppId = string.Empty; try { ContractorAppId = cgi.ToString() == null ? string.Empty : cgi.ToString(); if (GlobalMethods.ValueIsNull(ContractorAppId).Length > 0) { ContractorAppId = objcryptoJS.AES_decrypt(HttpUtility.UrlEncode(cgi), AppConstants.secretKey, AppConstants.initVec).ToString(); } List <clsSupervisor> objSPCont = new List <clsSupervisor>(); objSPCont = SupervisorDAL.SelectDynamicSupervisor("SupervisorId = " + ContractorAppId + "", "SupervisorId"); if (objSPCont != null) { objSPCont[0].IsActive = 1; if (SupervisorDAL.UpdateSupervisor(objSPCont[0])) { List <clsUserRole> lstURole = new List <clsUserRole>(); lstURole = UserRoleDAL.SelectDynamicUserRole("RoleId = 5 and AuthorizedUserId = " + objSPCont[0].CreatedBy + "", "UserRoleId"); if (lstURole != null) { if (lstURole.Count > 0) { //ROLE HAS BEEN ASSIGNED. THEREFORE, DONT ADD ANOTHER ROLE. } else { clsUserRole objURole = new clsUserRole(); objURole.RoleId = 5; objURole.AuthorizedUserId = Convert.ToInt32(objSPCont[0].CreatedBy); objURole.IsActive = 1; objURole.CreatedDate = DateTime.Now; objURole.CreatedBy = HttpContext.Current.Session["UserAuthId"].ToString(); objURole.UpdatedDate = Convert.ToDateTime("1/1/1900"); objURole.UpdatedBy = ""; objURole.Notes = ""; if (!UserRoleDAL.InsertUserRole(objURole)) { } } } else { clsUserRole objURole = new clsUserRole(); objURole.RoleId = 5; objURole.AuthorizedUserId = Convert.ToInt32(objSPCont[0].CreatedBy); objURole.IsActive = 1; objURole.CreatedDate = DateTime.Now; objURole.CreatedBy = HttpContext.Current.Session["UserAuthId"].ToString(); objURole.UpdatedDate = Convert.ToDateTime("1/1/1900"); objURole.UpdatedBy = ""; objURole.Notes = ""; if (!UserRoleDAL.InsertUserRole(objURole)) { } } } } } catch (Exception) { ErrorHandler.ErrorPage(); } return("MDESuperAppView.aspx?superapps=active&cgi=" + cgi + ""); }