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