/// <summary> /// Updates a ProceedingType record and returns the number of records affected /// </summary> public static int Update(ProceedingTypeDO DO) { SqlParameter _ProceedingTypeID = new SqlParameter("ProceedingTypeID", SqlDbType.VarChar); _ProceedingTypeID.Value = DO.ProceedingTypeID; SqlParameter[] _params = new SqlParameter[] { _ProceedingTypeID }; string pid = ConfigurationManager.AppSettings["ePermitDAL"]; return DataCommon.ExecuteScalar("[dbo].[ProceedingType_Update]", _params, pid); }
/// <summary> /// Creates a new ProceedingType record using async /// </summary> public static async Task CreateAsync(ProceedingTypeDO DO) { SqlParameter _ProceedingTypeID = new SqlParameter("ProceedingTypeID", SqlDbType.VarChar); _ProceedingTypeID.Value = DO.ProceedingTypeID; SqlParameter[] _params = new SqlParameter[] { _ProceedingTypeID }; string pid = ConfigurationManager.AppSettings["ePermitDAL"]; await DataCommon.ExecuteNonQueryAsync("[dbo].[ProceedingType_Insert]", _params, pid); }
/// <summary> /// Selects ProceedingType records by PK /// </summary> public static async Task<ProceedingTypeDO[]> GetByPKAsync(String ProceedingTypeID) { SqlParameter _ProceedingTypeID = new SqlParameter("ProceedingTypeID", SqlDbType.VarChar); _ProceedingTypeID.Value = ProceedingTypeID; SqlParameter[] _params = new SqlParameter[] { _ProceedingTypeID }; string pid = ConfigurationManager.AppSettings["ePermitDAL"]; SafeReader sr = await DataCommon.ExecuteSafeReaderAsync("[dbo].[ProceedingType_GetByPK]", _params, pid); List<ProceedingTypeDO> objs = new List<ProceedingTypeDO>(); while(sr.Read()) { ProceedingTypeDO obj = new ProceedingTypeDO(); obj.ProceedingTypeID = sr.GetString(sr.GetOrdinal("ProceedingTypeID")); objs.Add(obj); } return objs.ToArray(); }
/// <summary> /// Gets all ProceedingType records /// </summary> public static async Task<ProceedingTypeDO[]> GetAllAsync() { string pid = ConfigurationManager.AppSettings["ePermitDAL"]; SafeReader sr = await DataCommon.ExecuteSafeReaderAsync("[dbo].[ProceedingType_GetAll]", new SqlParameter[] { }, pid); List<ProceedingTypeDO> objs = new List<ProceedingTypeDO>(); while(sr.Read()){ ProceedingTypeDO obj = new ProceedingTypeDO(); obj.ProceedingTypeID = sr.GetString(sr.GetOrdinal("ProceedingTypeID")); objs.Add(obj); } return objs.ToArray(); }