/// <summary> /// Deletes a ThreatenedAndEndangeredSpeciesList record /// </summary> public static int Delete(ThreatenedAndEndangeredSpeciesListDO DO) { SqlParameter _PermitKey = new SqlParameter("PermitKey", SqlDbType.Int); SqlParameter _ThreatenedAndEndangeredSpecies = new SqlParameter("ThreatenedAndEndangeredSpecies", SqlDbType.VarChar); _PermitKey.Value = DO.PermitKey; _ThreatenedAndEndangeredSpecies.Value = DO.ThreatenedAndEndangeredSpecies; SqlParameter[] _params = new SqlParameter[] { _PermitKey, _ThreatenedAndEndangeredSpecies }; return DataCommon.ExecuteScalar("[dbo].[ThreatenedAndEndangeredSpeciesList_Delete]", _params, "dbo"); }
/// <summary> /// Creates a new ThreatenedAndEndangeredSpeciesList record /// </summary> public static void Create(ThreatenedAndEndangeredSpeciesListDO DO) { SqlParameter _PermitKey = new SqlParameter("PermitKey", SqlDbType.Int); SqlParameter _ThreatenedAndEndangeredSpecies = new SqlParameter("ThreatenedAndEndangeredSpecies", SqlDbType.VarChar); _PermitKey.Value = DO.PermitKey; _ThreatenedAndEndangeredSpecies.Value = DO.ThreatenedAndEndangeredSpecies; SqlParameter[] _params = new SqlParameter[] { _PermitKey, _ThreatenedAndEndangeredSpecies }; DataCommon.ExecuteNonQuery("[dbo].[ThreatenedAndEndangeredSpeciesList_Insert]", _params, "dbo"); }
/// <summary> /// Gets all ThreatenedAndEndangeredSpeciesList records /// </summary> public static ThreatenedAndEndangeredSpeciesListDO[] GetAll() { SafeReader sr = DataCommon.ExecuteSafeReader("[dbo].[ThreatenedAndEndangeredSpeciesList_GetAll]", new SqlParameter[] { }, "dbo"); List<ThreatenedAndEndangeredSpeciesListDO> objs = new List<ThreatenedAndEndangeredSpeciesListDO>(); while(sr.Read()){ ThreatenedAndEndangeredSpeciesListDO obj = new ThreatenedAndEndangeredSpeciesListDO(); obj.PermitKey = sr.GetInt32(sr.GetOrdinal("PermitKey")); obj.ThreatenedAndEndangeredSpecies = sr.GetString(sr.GetOrdinal("ThreatenedAndEndangeredSpecies")); objs.Add(obj); } return objs.ToArray(); }
/// <summary> /// Selects ThreatenedAndEndangeredSpeciesList records by PK /// </summary> public static ThreatenedAndEndangeredSpeciesListDO[] GetByPK(Int32 PermitKey, String ThreatenedAndEndangeredSpecies) { SqlParameter _PermitKey = new SqlParameter("PermitKey", SqlDbType.Int); SqlParameter _ThreatenedAndEndangeredSpecies = new SqlParameter("ThreatenedAndEndangeredSpecies", SqlDbType.VarChar); _PermitKey.Value = PermitKey; _ThreatenedAndEndangeredSpecies.Value = ThreatenedAndEndangeredSpecies; SqlParameter[] _params = new SqlParameter[] { _PermitKey, _ThreatenedAndEndangeredSpecies }; SafeReader sr = DataCommon.ExecuteSafeReader("[dbo].[ThreatenedAndEndangeredSpeciesList_GetByPK]", _params, "dbo"); List<ThreatenedAndEndangeredSpeciesListDO> objs = new List<ThreatenedAndEndangeredSpeciesListDO>(); while(sr.Read()) { ThreatenedAndEndangeredSpeciesListDO obj = new ThreatenedAndEndangeredSpeciesListDO(); obj.PermitKey = sr.GetInt32(sr.GetOrdinal("PermitKey")); obj.ThreatenedAndEndangeredSpecies = sr.GetString(sr.GetOrdinal("ThreatenedAndEndangeredSpecies")); objs.Add(obj); } return objs.ToArray(); }