/// <summary> /// Creates a new PerformanceStandardType record using async /// </summary> public static async Task<int> CreateAsync(PerformanceStandardTypeDO DO) { SqlParameter _Description = new SqlParameter("Description", SqlDbType.VarChar); _Description.Value = DO.Description; SqlParameter[] _params = new SqlParameter[] { _Description }; string pid = ConfigurationManager.AppSettings["ePermitDAL"]; return await DataCommon.ExecuteScalarAsync("[dbo].[PerformanceStandardType_Insert]", _params, pid); }
/// <summary> /// Updates a PerformanceStandardType record and returns the number of records affected /// </summary> public static int Update(PerformanceStandardTypeDO DO) { SqlParameter _PerformanceStandardTypeID = new SqlParameter("PerformanceStandardTypeID", SqlDbType.Int); SqlParameter _Description = new SqlParameter("Description", SqlDbType.VarChar); _PerformanceStandardTypeID.Value = DO.PerformanceStandardTypeID; _Description.Value = DO.Description; SqlParameter[] _params = new SqlParameter[] { _PerformanceStandardTypeID, _Description }; string pid = ConfigurationManager.AppSettings["ePermitDAL"]; return DataCommon.ExecuteScalar("[dbo].[PerformanceStandardType_Update]", _params, pid); }
/// <summary> /// Gets all PerformanceStandardType records /// </summary> public static async Task<PerformanceStandardTypeDO[]> GetAllAsync() { string pid = ConfigurationManager.AppSettings["ePermitDAL"]; SafeReader sr = await DataCommon.ExecuteSafeReaderAsync("[dbo].[PerformanceStandardType_GetAll]", new SqlParameter[] { }, pid); List<PerformanceStandardTypeDO> objs = new List<PerformanceStandardTypeDO>(); while(sr.Read()){ PerformanceStandardTypeDO obj = new PerformanceStandardTypeDO(); obj.PerformanceStandardTypeID = sr.GetInt32(sr.GetOrdinal("PerformanceStandardTypeID")); obj.Description = sr.GetString(sr.GetOrdinal("Description")); objs.Add(obj); } return objs.ToArray(); }
/// <summary> /// Selects PerformanceStandardType records by PK /// </summary> public static async Task<PerformanceStandardTypeDO[]> GetByPKAsync(Int32 PerformanceStandardTypeID) { SqlParameter _PerformanceStandardTypeID = new SqlParameter("PerformanceStandardTypeID", SqlDbType.Int); _PerformanceStandardTypeID.Value = PerformanceStandardTypeID; SqlParameter[] _params = new SqlParameter[] { _PerformanceStandardTypeID }; string pid = ConfigurationManager.AppSettings["ePermitDAL"]; SafeReader sr = await DataCommon.ExecuteSafeReaderAsync("[dbo].[PerformanceStandardType_GetByPK]", _params, pid); List<PerformanceStandardTypeDO> objs = new List<PerformanceStandardTypeDO>(); while(sr.Read()) { PerformanceStandardTypeDO obj = new PerformanceStandardTypeDO(); obj.PerformanceStandardTypeID = sr.GetInt32(sr.GetOrdinal("PerformanceStandardTypeID")); obj.Description = sr.GetString(sr.GetOrdinal("Description")); objs.Add(obj); } return objs.ToArray(); }
/// <summary> /// Deletes a PerformanceStandardType record /// </summary> public static async Task<int> DeleteAsync(PerformanceStandardTypeDO DO) { SqlParameter _PerformanceStandardTypeID = new SqlParameter("PerformanceStandardTypeID", SqlDbType.Int); _PerformanceStandardTypeID.Value = DO.PerformanceStandardTypeID; SqlParameter[] _params = new SqlParameter[] { _PerformanceStandardTypeID }; string pid = ConfigurationManager.AppSettings["ePermitDAL"]; return await DataCommon.ExecuteScalarAsync("[dbo].[PerformanceStandardType_Delete]", _params, pid); }