/// <summary> /// Deletes a CulturalResourceManagement record /// </summary> public static int Delete(CulturalResourceManagementDO DO) { SqlParameter _CulturalResourceManagementID = new SqlParameter("CulturalResourceManagementID", SqlDbType.Int); _CulturalResourceManagementID.Value = DO.CulturalResourceManagementID; SqlParameter[] _params = new SqlParameter[] { _CulturalResourceManagementID }; return DataCommon.ExecuteScalar("[dbo].[CulturalResourceManagement_Delete]", _params, "dbo"); }
/// <summary> /// Creates a new CulturalResourceManagement record /// </summary> public static int Create(CulturalResourceManagementDO DO) { SqlParameter _PermitKey = new SqlParameter("PermitKey", SqlDbType.Int); SqlParameter _NRHPEligible = new SqlParameter("NRHPEligible", SqlDbType.Bit); SqlParameter _AdditionalInvestigationRequired = new SqlParameter("AdditionalInvestigationRequired", SqlDbType.Bit); SqlParameter _MitigationRequired = new SqlParameter("MitigationRequired", SqlDbType.Bit); SqlParameter _PlannedMitigation = new SqlParameter("PlannedMitigation", SqlDbType.DateTime); SqlParameter _ActualMitigation = new SqlParameter("ActualMitigation", SqlDbType.DateTime); SqlParameter _PlannedDisturbance = new SqlParameter("PlannedDisturbance", SqlDbType.DateTime); SqlParameter _Disturbance = new SqlParameter("Disturbance", SqlDbType.DateTime); SqlParameter _DescriptionOfMitigationEfforts = new SqlParameter("DescriptionOfMitigationEfforts", SqlDbType.VarChar); _PermitKey.Value = DO.PermitKey; _NRHPEligible.Value = DO.NRHPEligible; _AdditionalInvestigationRequired.Value = DO.AdditionalInvestigationRequired; _MitigationRequired.Value = DO.MitigationRequired; _PlannedMitigation.Value = DO.PlannedMitigation; _ActualMitigation.Value = DO.ActualMitigation; _PlannedDisturbance.Value = DO.PlannedDisturbance; _Disturbance.Value = DO.Disturbance; _DescriptionOfMitigationEfforts.Value = DO.DescriptionOfMitigationEfforts; SqlParameter[] _params = new SqlParameter[] { _PermitKey, _NRHPEligible, _AdditionalInvestigationRequired, _MitigationRequired, _PlannedMitigation, _ActualMitigation, _PlannedDisturbance, _Disturbance, _DescriptionOfMitigationEfforts }; return DataCommon.ExecuteScalar("[dbo].[CulturalResourceManagement_Insert]", _params, "dbo"); }
/// <summary> /// Gets all CulturalResourceManagement records /// </summary> public static CulturalResourceManagementDO[] GetAll() { SafeReader sr = DataCommon.ExecuteSafeReader("[dbo].[CulturalResourceManagement_GetAll]", new SqlParameter[] { }, "dbo"); List<CulturalResourceManagementDO> objs = new List<CulturalResourceManagementDO>(); while(sr.Read()){ CulturalResourceManagementDO obj = new CulturalResourceManagementDO(); obj.CulturalResourceManagementID = sr.GetInt32(sr.GetOrdinal("CulturalResourceManagementID")); obj.PermitKey = sr.GetInt32(sr.GetOrdinal("PermitKey")); obj.NRHPEligible = sr.GetBoolean(sr.GetOrdinal("NRHPEligible")); obj.AdditionalInvestigationRequired = sr.GetBoolean(sr.GetOrdinal("AdditionalInvestigationRequired")); obj.MitigationRequired = sr.GetBoolean(sr.GetOrdinal("MitigationRequired")); obj.PlannedMitigation = sr.GetDateTime(sr.GetOrdinal("PlannedMitigation")); obj.PlannedDisturbance = sr.GetDateTime(sr.GetOrdinal("PlannedDisturbance")); obj.DescriptionOfMitigationEfforts = sr.GetString(sr.GetOrdinal("DescriptionOfMitigationEfforts")); if (sr.IsDBNull(sr.GetOrdinal("ActualMitigation"))) { obj.ActualMitigation = null; } else { obj.ActualMitigation = sr.GetDateTime(sr.GetOrdinal("ActualMitigation")); } if (sr.IsDBNull(sr.GetOrdinal("Disturbance"))) { obj.Disturbance = null; } else { obj.Disturbance = sr.GetDateTime(sr.GetOrdinal("Disturbance")); } objs.Add(obj); } return objs.ToArray(); }