public static Boolean InsertUpdateLK_InstructorMatch(clsLK_InstructorMatch objLK_InstructorMatch) { bool isAdded = false; string SpName = "usp_InsertUpdateLK_InstructorMatch"; try { using (IDbConnection db = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["databaseConnection"])) { db.Execute(SpName, objLK_InstructorMatch, commandType: CommandType.StoredProcedure); } isAdded = true; } catch (Exception ex) { ErrorHandler.ErrorLogging(ex, false); ErrorHandler.ReadError(); } return(isAdded); }
public static clsLK_InstructorMatch SelectLK_InstructorMatchById(int?Instructor_match_Id) { clsLK_InstructorMatch objLK_InstructorMatch = new clsLK_InstructorMatch(); bool isnull = true; string SpName = "usp_SelectLK_InstructorMatch"; var objPar = new DynamicParameters(); if (String.IsNullOrEmpty(Instructor_match_Id.ToString())) { throw new ArgumentException("Function parameters cannot be blank!"); } else { try { objPar.Add("@Instructor_match_Id", Instructor_match_Id, dbType: DbType.Int32); using (IDbConnection db = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["databaseConnection"])) { objLK_InstructorMatch = db.Query <clsLK_InstructorMatch>(SpName, objPar, commandType: CommandType.StoredProcedure).SingleOrDefault(); isnull = false; } } catch (Exception ex) { ErrorHandler.ErrorLogging(ex, false); ErrorHandler.ReadError(); } } if (isnull) { return(null); } else { return(objLK_InstructorMatch); } }