/// <summary> /// Deletes a ExemptionType record /// </summary> public static int Delete(ExemptionTypeDO DO) { SqlParameter _ExemptionTypeID = new SqlParameter("ExemptionTypeID", SqlDbType.Int); _ExemptionTypeID.Value = DO.ExemptionTypeID; SqlParameter[] _params = new SqlParameter[] { _ExemptionTypeID }; return DataCommon.ExecuteScalar("[dbo].[ExemptionType_Delete]", _params, "dbo"); }
/// <summary> /// Creates a new ExemptionType record /// </summary> public static int Create(ExemptionTypeDO DO) { SqlParameter _Description = new SqlParameter("Description", SqlDbType.VarChar); _Description.Value = DO.Description; SqlParameter[] _params = new SqlParameter[] { _Description }; return DataCommon.ExecuteScalar("[dbo].[ExemptionType_Insert]", _params, "dbo"); }
/// <summary> /// Updates a ExemptionType record and returns the number of records affected /// </summary> public static int Update(ExemptionTypeDO DO) { SqlParameter _ExemptionTypeID = new SqlParameter("ExemptionTypeID", SqlDbType.Int); SqlParameter _Description = new SqlParameter("Description", SqlDbType.VarChar); _ExemptionTypeID.Value = DO.ExemptionTypeID; _Description.Value = DO.Description; SqlParameter[] _params = new SqlParameter[] { _ExemptionTypeID, _Description }; return DataCommon.ExecuteScalar("[dbo].[ExemptionType_Update]", _params, "dbo"); }
/// <summary> /// Gets all ExemptionType records /// </summary> public static ExemptionTypeDO[] GetAll() { SafeReader sr = DataCommon.ExecuteSafeReader("[dbo].[ExemptionType_GetAll]", new SqlParameter[] { }, "dbo"); List<ExemptionTypeDO> objs = new List<ExemptionTypeDO>(); while(sr.Read()){ ExemptionTypeDO obj = new ExemptionTypeDO(); obj.ExemptionTypeID = sr.GetInt32(sr.GetOrdinal("ExemptionTypeID")); obj.Description = sr.GetString(sr.GetOrdinal("Description")); objs.Add(obj); } return objs.ToArray(); }
/// <summary> /// Selects ExemptionType records by PK /// </summary> public static ExemptionTypeDO[] GetByPK(Int32 ExemptionTypeID) { SqlParameter _ExemptionTypeID = new SqlParameter("ExemptionTypeID", SqlDbType.Int); _ExemptionTypeID.Value = ExemptionTypeID; SqlParameter[] _params = new SqlParameter[] { _ExemptionTypeID }; SafeReader sr = DataCommon.ExecuteSafeReader("[dbo].[ExemptionType_GetByPK]", _params, "dbo"); List<ExemptionTypeDO> objs = new List<ExemptionTypeDO>(); while(sr.Read()) { ExemptionTypeDO obj = new ExemptionTypeDO(); obj.ExemptionTypeID = sr.GetInt32(sr.GetOrdinal("ExemptionTypeID")); obj.Description = sr.GetString(sr.GetOrdinal("Description")); objs.Add(obj); } return objs.ToArray(); }