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