public static string AssignedToMe(string cgi) { try { CryptoJS objcryptoJS = new CryptoJS(); string ContractorAppId = string.Empty; 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(); } clsInstructor_Approval objRiskApp = new clsInstructor_Approval(); objRiskApp.InstructorId = Convert.ToInt32(ContractorAppId); objRiskApp.MDE_Owner_AuthorisedUserId = Convert.ToInt32(HttpContext.Current.Session["UserAuthId"]); objRiskApp.CreatedDate = DateTime.Now; objRiskApp.CreatedBy = HttpContext.Current.Session["UserAuthId"].ToString(); objRiskApp.UpdatedDate = Convert.ToDateTime("1/1/1900"); objRiskApp.UpdatedBy = ""; objRiskApp.Notes = ""; objRiskApp.IsActive = 1; if (!Instructor_ApprovalDAL.InsertInstructor_Approval(objRiskApp)) { } } catch (Exception) { ErrorHandler.ErrorPage(); } return("MDE_InstructorApps.aspx?InstructApps=active"); }
public static Boolean InsertUpdateInstructor_Approval(clsInstructor_Approval objInstructor_Approval) { bool isAdded = false; string SpName = "usp_InsertUpdateInstructor_Approval"; try { using (IDbConnection db = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["databaseConnection"])) { db.Execute(SpName, objInstructor_Approval, commandType: CommandType.StoredProcedure); } isAdded = true; } catch (Exception ex) { ErrorHandler.ErrorLogging(ex, false); ErrorHandler.ReadError(); } return(isAdded); }
public static clsInstructor_Approval SelectInstructor_ApprovalById(int?MDEInsApprId) { clsInstructor_Approval objInstructor_Approval = new clsInstructor_Approval(); bool isnull = true; string SpName = "usp_SelectInstructor_Approval"; var objPar = new DynamicParameters(); if (String.IsNullOrEmpty(MDEInsApprId.ToString())) { throw new ArgumentException("Function parameters cannot be blank!"); } else { try { objPar.Add("@MDEInsApprId", MDEInsApprId, dbType: DbType.Int32); using (IDbConnection db = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["databaseConnection"])) { objInstructor_Approval = db.Query <clsInstructor_Approval>(SpName, objPar, commandType: CommandType.StoredProcedure).SingleOrDefault(); isnull = false; } } catch (Exception ex) { ErrorHandler.ErrorLogging(ex, false); ErrorHandler.ReadError(); } } if (isnull) { return(null); } else { return(objInstructor_Approval); } }