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 <clsTrainingProvider> objSPCont = new List <clsTrainingProvider>(); objSPCont = TrainingProviderDAL.SelectDynamicTrainingProvider("TPId = " + ContractorAppId + "", "TPId"); if (objSPCont != null) { objSPCont[0].IsActive = 0; if (TrainingProviderDAL.UpdateTrainingProvider(objSPCont[0])) { List <clsUserRole> lstURole = new List <clsUserRole>(); lstURole = UserRoleDAL.SelectDynamicUserRole("RoleId = 2 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("MDE_TPAppView.aspx?tpapps=active&cgi=" + cgi + ""); }