/// <summary> /// Deletes a ClimateNorm record /// </summary> public static int Delete(ClimateNormDO DO) { SqlParameter _ClimateNormID = new SqlParameter("ClimateNormID", SqlDbType.Int); _ClimateNormID.Value = DO.ClimateNormID; SqlParameter[] _params = new SqlParameter[] { _ClimateNormID }; return DataCommon.ExecuteScalar("[dbo].[ClimateNorm_Delete]", _params, "dbo"); }
/// <summary> /// Creates a new ClimateNorm record /// </summary> public static int Create(ClimateNormDO DO) { SqlParameter _PermitKey = new SqlParameter("PermitKey", SqlDbType.Int); SqlParameter _AveragePrecipitationWinter = new SqlParameter("AveragePrecipitationWinter", SqlDbType.Decimal); SqlParameter _AveragePrecipitationSpring = new SqlParameter("AveragePrecipitationSpring", SqlDbType.Decimal); SqlParameter _AveragePrecipitationSummer = new SqlParameter("AveragePrecipitationSummer", SqlDbType.Decimal); SqlParameter _AveragePrecipitationFall = new SqlParameter("AveragePrecipitationFall", SqlDbType.Decimal); SqlParameter _SeasonalTemperatureRangeWinter = new SqlParameter("SeasonalTemperatureRangeWinter", SqlDbType.Decimal); SqlParameter _SeasonalTemperatureRangeSpring = new SqlParameter("SeasonalTemperatureRangeSpring", SqlDbType.Decimal); SqlParameter _SeasonalTemperatureRangeSummer = new SqlParameter("SeasonalTemperatureRangeSummer", SqlDbType.Decimal); SqlParameter _SeasonalTemperatureRangeFall = new SqlParameter("SeasonalTemperatureRangeFall", SqlDbType.Decimal); _PermitKey.Value = DO.PermitKey; _AveragePrecipitationWinter.Value = DO.AveragePrecipitationWinter; _AveragePrecipitationSpring.Value = DO.AveragePrecipitationSpring; _AveragePrecipitationSummer.Value = DO.AveragePrecipitationSummer; _AveragePrecipitationFall.Value = DO.AveragePrecipitationFall; _SeasonalTemperatureRangeWinter.Value = DO.SeasonalTemperatureRangeWinter; _SeasonalTemperatureRangeSpring.Value = DO.SeasonalTemperatureRangeSpring; _SeasonalTemperatureRangeSummer.Value = DO.SeasonalTemperatureRangeSummer; _SeasonalTemperatureRangeFall.Value = DO.SeasonalTemperatureRangeFall; SqlParameter[] _params = new SqlParameter[] { _PermitKey, _AveragePrecipitationWinter, _AveragePrecipitationSpring, _AveragePrecipitationSummer, _AveragePrecipitationFall, _SeasonalTemperatureRangeWinter, _SeasonalTemperatureRangeSpring, _SeasonalTemperatureRangeSummer, _SeasonalTemperatureRangeFall }; return DataCommon.ExecuteScalar("[dbo].[ClimateNorm_Insert]", _params, "dbo"); }
/// <summary> /// Gets all ClimateNorm records /// </summary> public static ClimateNormDO[] GetAll() { SafeReader sr = DataCommon.ExecuteSafeReader("[dbo].[ClimateNorm_GetAll]", new SqlParameter[] { }, "dbo"); List<ClimateNormDO> objs = new List<ClimateNormDO>(); while(sr.Read()){ ClimateNormDO obj = new ClimateNormDO(); obj.ClimateNormID = sr.GetInt32(sr.GetOrdinal("ClimateNormID")); obj.PermitKey = sr.GetInt32(sr.GetOrdinal("PermitKey")); obj.AveragePrecipitationWinter = sr.GetDecimal(sr.GetOrdinal("AveragePrecipitationWinter")); obj.AveragePrecipitationSpring = sr.GetDecimal(sr.GetOrdinal("AveragePrecipitationSpring")); obj.AveragePrecipitationSummer = sr.GetDecimal(sr.GetOrdinal("AveragePrecipitationSummer")); obj.AveragePrecipitationFall = sr.GetDecimal(sr.GetOrdinal("AveragePrecipitationFall")); obj.SeasonalTemperatureRangeWinter = sr.GetDecimal(sr.GetOrdinal("SeasonalTemperatureRangeWinter")); obj.SeasonalTemperatureRangeSpring = sr.GetDecimal(sr.GetOrdinal("SeasonalTemperatureRangeSpring")); obj.SeasonalTemperatureRangeSummer = sr.GetDecimal(sr.GetOrdinal("SeasonalTemperatureRangeSummer")); obj.SeasonalTemperatureRangeFall = sr.GetDecimal(sr.GetOrdinal("SeasonalTemperatureRangeFall")); objs.Add(obj); } return objs.ToArray(); }