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