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