public ActionResult NewPermit(NewPermitVM model)
        {
            if (!ModelState.IsValid)
                return PartialView(model);

            try
            {
                PermitDO newPermit = new PermitDO() { SiteName = model.SiteName };
                int permitKey = PermitBLL.Save(newPermit, (int)myCoalUser.GetInstance().RegistrationId);
                AjaxResult result = new AjaxResult(AjaxResult.AjaxStatus.OK, "The permit was created");
                result.Data.Add("PermitKey", permitKey);
                return Json(result);
            }
            catch (Exception ex)
            {
                AjaxResult result = new AjaxResult(AjaxResult.AjaxStatus.ERROR, ex.Message);
                return Json(result);
            }
        }
示例#2
0
        /// <summary>
        /// Selects Permit records by PK
        /// </summary>
        public static PermitDO[] GetByPK(Int32 PermitKey)
        {
            SqlParameter _PermitKey = new SqlParameter("PermitKey", SqlDbType.Int);

            _PermitKey.Value = PermitKey;

            SqlParameter[] _params = new SqlParameter[] {
                _PermitKey
            };

            SafeReader sr = DataCommon.ExecuteSafeReader("[dbo].[Permit_GetByPK]", _params, "dbo");

            List<PermitDO> objs = new List<PermitDO>();

            while(sr.Read())
            {
                PermitDO obj = new PermitDO();

                obj.PermitKey = sr.GetInt32(sr.GetOrdinal("PermitKey"));
                obj.PermitID = sr.GetString(sr.GetOrdinal("PermitID"));
                obj.ApplicationTypeID = sr.GetString(sr.GetOrdinal("ApplicationTypeID"));
                obj.PermitStatusID = sr.GetString(sr.GetOrdinal("PermitStatusID"));
                obj.ApplicationNumber = sr.GetString(sr.GetOrdinal("ApplicationNumber"));
                if (sr.IsDBNull(sr.GetOrdinal("ApplicationDescriptionOfInterests"))) { obj.ApplicationDescriptionOfInterests = null; } else { obj.ApplicationDescriptionOfInterests = sr.GetString(sr.GetOrdinal("ApplicationDescriptionOfInterests")); }
                if (sr.IsDBNull(sr.GetOrdinal("SiteName"))) { obj.SiteName = null; } else { obj.SiteName = sr.GetString(sr.GetOrdinal("SiteName")); }
                if (sr.IsDBNull(sr.GetOrdinal("MineTypeID"))) { obj.MineTypeID = null; } else { obj.MineTypeID = sr.GetString(sr.GetOrdinal("MineTypeID")); }
                if (sr.IsDBNull(sr.GetOrdinal("MSHAID"))) { obj.MSHAID = null; } else { obj.MSHAID = sr.GetString(sr.GetOrdinal("MSHAID")); }
                if (sr.IsDBNull(sr.GetOrdinal("ReminedAcres"))) { obj.ReminedAcres = null; } else { obj.ReminedAcres = sr.GetInt32(sr.GetOrdinal("ReminedAcres")); }
                if (sr.IsDBNull(sr.GetOrdinal("LegalDescriptionOfAccess"))) { obj.LegalDescriptionOfAccess = null; } else { obj.LegalDescriptionOfAccess = sr.GetString(sr.GetOrdinal("LegalDescriptionOfAccess")); }
                if (sr.IsDBNull(sr.GetOrdinal("Latitude"))) { obj.Latitude = null; } else { obj.Latitude = sr.GetString(sr.GetOrdinal("Latitude")); }
                if (sr.IsDBNull(sr.GetOrdinal("Longitude"))) { obj.Longitude = null; } else { obj.Longitude = sr.GetString(sr.GetOrdinal("Longitude")); }
                if (sr.IsDBNull(sr.GetOrdinal("NewspaperName"))) { obj.NewspaperName = null; } else { obj.NewspaperName = sr.GetString(sr.GetOrdinal("NewspaperName")); }
                if (sr.IsDBNull(sr.GetOrdinal("NearestTown"))) { obj.NearestTown = null; } else { obj.NearestTown = sr.GetString(sr.GetOrdinal("NearestTown")); }
                if (sr.IsDBNull(sr.GetOrdinal("LegalRightToEnter"))) { obj.LegalRightToEnter = null; } else { obj.LegalRightToEnter = sr.GetString(sr.GetOrdinal("LegalRightToEnter")); }
                if (sr.IsDBNull(sr.GetOrdinal("SubjectOfLitigation"))) { obj.SubjectOfLitigation = null; } else { obj.SubjectOfLitigation = sr.GetBoolean(sr.GetOrdinal("SubjectOfLitigation")); }
                if (sr.IsDBNull(sr.GetOrdinal("StatusOfLitigation"))) { obj.StatusOfLitigation = null; } else { obj.StatusOfLitigation = sr.GetString(sr.GetOrdinal("StatusOfLitigation")); }
                if (sr.IsDBNull(sr.GetOrdinal("LandsUnsuitable"))) { obj.LandsUnsuitable = null; } else { obj.LandsUnsuitable = sr.GetBoolean(sr.GetOrdinal("LandsUnsuitable")); }
                if (sr.IsDBNull(sr.GetOrdinal("LifeOfMineYears"))) { obj.LifeOfMineYears = null; } else { obj.LifeOfMineYears = sr.GetInt32(sr.GetOrdinal("LifeOfMineYears")); }
                if (sr.IsDBNull(sr.GetOrdinal("AnnualAnticipatedProductionInTons"))) { obj.AnnualAnticipatedProductionInTons = null; } else { obj.AnnualAnticipatedProductionInTons = sr.GetInt32(sr.GetOrdinal("AnnualAnticipatedProductionInTons")); }
                if (sr.IsDBNull(sr.GetOrdinal("TotalAnticipatedProductionInTons"))) { obj.TotalAnticipatedProductionInTons = null; } else { obj.TotalAnticipatedProductionInTons = sr.GetInt32(sr.GetOrdinal("TotalAnticipatedProductionInTons")); }
                if (sr.IsDBNull(sr.GetOrdinal("LifeOfMineComments"))) { obj.LifeOfMineComments = null; } else { obj.LifeOfMineComments = sr.GetString(sr.GetOrdinal("LifeOfMineComments")); }
                if (sr.IsDBNull(sr.GetOrdinal("BondFormID"))) { obj.BondFormID = null; } else { obj.BondFormID = sr.GetString(sr.GetOrdinal("BondFormID")); }
                if (sr.IsDBNull(sr.GetOrdinal("OtherBondFormDescription"))) { obj.OtherBondFormDescription = null; } else { obj.OtherBondFormDescription = sr.GetString(sr.GetOrdinal("OtherBondFormDescription")); }
                if (sr.IsDBNull(sr.GetOrdinal("CulturalResourcesDescription"))) { obj.CulturalResourcesDescription = null; } else { obj.CulturalResourcesDescription = sr.GetString(sr.GetOrdinal("CulturalResourcesDescription")); }
                if (sr.IsDBNull(sr.GetOrdinal("UniqueSpecialCharacteristicsAndGeologicFormations"))) { obj.UniqueSpecialCharacteristicsAndGeologicFormations = null; } else { obj.UniqueSpecialCharacteristicsAndGeologicFormations = sr.GetString(sr.GetOrdinal("UniqueSpecialCharacteristicsAndGeologicFormations")); }
                if (sr.IsDBNull(sr.GetOrdinal("UniqueSpecialCharacteristicsAdverselyAffectedByMining"))) { obj.UniqueSpecialCharacteristicsAdverselyAffectedByMining = null; } else { obj.UniqueSpecialCharacteristicsAdverselyAffectedByMining = sr.GetBoolean(sr.GetOrdinal("UniqueSpecialCharacteristicsAdverselyAffectedByMining")); }
                if (sr.IsDBNull(sr.GetOrdinal("GeologicInformationUndersirable"))) { obj.GeologicInformationUndersirable = null; } else { obj.GeologicInformationUndersirable = sr.GetBoolean(sr.GetOrdinal("GeologicInformationUndersirable")); }
                if (sr.IsDBNull(sr.GetOrdinal("AverageWindDirection"))) { obj.AverageWindDirection = null; } else { obj.AverageWindDirection = sr.GetString(sr.GetOrdinal("AverageWindDirection")); }
                if (sr.IsDBNull(sr.GetOrdinal("AverageWindVelocity"))) { obj.AverageWindVelocity = null; } else { obj.AverageWindVelocity = sr.GetDecimal(sr.GetOrdinal("AverageWindVelocity")); }
                if (sr.IsDBNull(sr.GetOrdinal("PrimeFarmlandSoils"))) { obj.PrimeFarmlandSoils = null; } else { obj.PrimeFarmlandSoils = sr.GetBoolean(sr.GetOrdinal("PrimeFarmlandSoils")); }
                if (sr.IsDBNull(sr.GetOrdinal("ResourcesAffectedByProposedOperation"))) { obj.ResourcesAffectedByProposedOperation = null; } else { obj.ResourcesAffectedByProposedOperation = sr.GetBoolean(sr.GetOrdinal("ResourcesAffectedByProposedOperation")); }
                if (sr.IsDBNull(sr.GetOrdinal("ResourcesAffectedByProposedOperationDescription"))) { obj.ResourcesAffectedByProposedOperationDescription = null; } else { obj.ResourcesAffectedByProposedOperationDescription = sr.GetString(sr.GetOrdinal("ResourcesAffectedByProposedOperationDescription")); }
                if (sr.IsDBNull(sr.GetOrdinal("ProposedMiningWithinPublicRoads"))) { obj.ProposedMiningWithinPublicRoads = null; } else { obj.ProposedMiningWithinPublicRoads = sr.GetBoolean(sr.GetOrdinal("ProposedMiningWithinPublicRoads")); }
                if (sr.IsDBNull(sr.GetOrdinal("ProposedMiningWithinPublicRoadsDescription"))) { obj.ProposedMiningWithinPublicRoadsDescription = null; } else { obj.ProposedMiningWithinPublicRoadsDescription = sr.GetString(sr.GetOrdinal("ProposedMiningWithinPublicRoadsDescription")); }
                if (sr.IsDBNull(sr.GetOrdinal("AdjacentToValleyHoldingStream"))) { obj.AdjacentToValleyHoldingStream = null; } else { obj.AdjacentToValleyHoldingStream = sr.GetBoolean(sr.GetOrdinal("AdjacentToValleyHoldingStream")); }
                if (sr.IsDBNull(sr.GetOrdinal("AdjacentToValleyHoldingStreamDescription"))) { obj.AdjacentToValleyHoldingStreamDescription = null; } else { obj.AdjacentToValleyHoldingStreamDescription = sr.GetString(sr.GetOrdinal("AdjacentToValleyHoldingStreamDescription")); }
                if (sr.IsDBNull(sr.GetOrdinal("AlluvialValleyFloorDeterminationRequested"))) { obj.AlluvialValleyFloorDeterminationRequested = null; } else { obj.AlluvialValleyFloorDeterminationRequested = sr.GetBoolean(sr.GetOrdinal("AlluvialValleyFloorDeterminationRequested")); }
                if (sr.IsDBNull(sr.GetOrdinal("AlluvialValleyFloorDeterminationRequestedDescription"))) { obj.AlluvialValleyFloorDeterminationRequestedDescription = null; } else { obj.AlluvialValleyFloorDeterminationRequestedDescription = sr.GetString(sr.GetOrdinal("AlluvialValleyFloorDeterminationRequestedDescription")); }
                if (sr.IsDBNull(sr.GetOrdinal("TypeAndMethodOfMiningPlanDescription"))) { obj.TypeAndMethodOfMiningPlanDescription = null; } else { obj.TypeAndMethodOfMiningPlanDescription = sr.GetString(sr.GetOrdinal("TypeAndMethodOfMiningPlanDescription")); }
                if (sr.IsDBNull(sr.GetOrdinal("AnnualAnticipatedMiningProductionInTons"))) { obj.AnnualAnticipatedMiningProductionInTons = null; } else { obj.AnnualAnticipatedMiningProductionInTons = sr.GetInt32(sr.GetOrdinal("AnnualAnticipatedMiningProductionInTons")); }
                if (sr.IsDBNull(sr.GetOrdinal("TotalAnticipatedMiningProductionInTons"))) { obj.TotalAnticipatedMiningProductionInTons = null; } else { obj.TotalAnticipatedMiningProductionInTons = sr.GetInt32(sr.GetOrdinal("TotalAnticipatedMiningProductionInTons")); }
                if (sr.IsDBNull(sr.GetOrdinal("TotalMiningReservesInTons"))) { obj.TotalMiningReservesInTons = null; } else { obj.TotalMiningReservesInTons = sr.GetInt32(sr.GetOrdinal("TotalMiningReservesInTons")); }
                if (sr.IsDBNull(sr.GetOrdinal("FacilitiesManagementPlanDescription"))) { obj.FacilitiesManagementPlanDescription = null; } else { obj.FacilitiesManagementPlanDescription = sr.GetString(sr.GetOrdinal("FacilitiesManagementPlanDescription")); }
                if (sr.IsDBNull(sr.GetOrdinal("OperateSupportFacilityNotWithinPermitArea"))) { obj.OperateSupportFacilityNotWithinPermitArea = null; } else { obj.OperateSupportFacilityNotWithinPermitArea = sr.GetBoolean(sr.GetOrdinal("OperateSupportFacilityNotWithinPermitArea")); }
                if (sr.IsDBNull(sr.GetOrdinal("ToxicAndUndesirableMaterialsDisposalPlanDescription"))) { obj.ToxicAndUndesirableMaterialsDisposalPlanDescription = null; } else { obj.ToxicAndUndesirableMaterialsDisposalPlanDescription = sr.GetString(sr.GetOrdinal("ToxicAndUndesirableMaterialsDisposalPlanDescription")); }
                if (sr.IsDBNull(sr.GetOrdinal("FireContingencyPlanDescription"))) { obj.FireContingencyPlanDescription = null; } else { obj.FireContingencyPlanDescription = sr.GetString(sr.GetOrdinal("FireContingencyPlanDescription")); }
                if (sr.IsDBNull(sr.GetOrdinal("ComplianceWithAirAndWaterQualityLawsDescription"))) { obj.ComplianceWithAirAndWaterQualityLawsDescription = null; } else { obj.ComplianceWithAirAndWaterQualityLawsDescription = sr.GetString(sr.GetOrdinal("ComplianceWithAirAndWaterQualityLawsDescription")); }
                if (sr.IsDBNull(sr.GetOrdinal("NoxiousWeedsManagementPlanDescription"))) { obj.NoxiousWeedsManagementPlanDescription = null; } else { obj.NoxiousWeedsManagementPlanDescription = sr.GetString(sr.GetOrdinal("NoxiousWeedsManagementPlanDescription")); }
                if (sr.IsDBNull(sr.GetOrdinal("BlastingPlanDescription"))) { obj.BlastingPlanDescription = null; } else { obj.BlastingPlanDescription = sr.GetString(sr.GetOrdinal("BlastingPlanDescription")); }
                if (sr.IsDBNull(sr.GetOrdinal("AirPollutionControlPlanDescription"))) { obj.AirPollutionControlPlanDescription = null; } else { obj.AirPollutionControlPlanDescription = sr.GetString(sr.GetOrdinal("AirPollutionControlPlanDescription")); }
                if (sr.IsDBNull(sr.GetOrdinal("FishAndWildlifePlanDescription"))) { obj.FishAndWildlifePlanDescription = null; } else { obj.FishAndWildlifePlanDescription = sr.GetString(sr.GetOrdinal("FishAndWildlifePlanDescription")); }
                if (sr.IsDBNull(sr.GetOrdinal("MiningConductedWithin500FeetUndergroundMine"))) { obj.MiningConductedWithin500FeetUndergroundMine = null; } else { obj.MiningConductedWithin500FeetUndergroundMine = sr.GetBoolean(sr.GetOrdinal("MiningConductedWithin500FeetUndergroundMine")); }
                if (sr.IsDBNull(sr.GetOrdinal("MiningConductedWithin500FeetUndergroundMineDescription"))) { obj.MiningConductedWithin500FeetUndergroundMineDescription = null; } else { obj.MiningConductedWithin500FeetUndergroundMineDescription = sr.GetString(sr.GetOrdinal("MiningConductedWithin500FeetUndergroundMineDescription")); }
                if (sr.IsDBNull(sr.GetOrdinal("DiversionConstructed"))) { obj.DiversionConstructed = null; } else { obj.DiversionConstructed = sr.GetBoolean(sr.GetOrdinal("DiversionConstructed")); }
                if (sr.IsDBNull(sr.GetOrdinal("DisposalOfExcessSpoilRequired"))) { obj.DisposalOfExcessSpoilRequired = null; } else { obj.DisposalOfExcessSpoilRequired = sr.GetBoolean(sr.GetOrdinal("DisposalOfExcessSpoilRequired")); }
                if (sr.IsDBNull(sr.GetOrdinal("TransportationFacilitiesPlanDescription"))) { obj.TransportationFacilitiesPlanDescription = null; } else { obj.TransportationFacilitiesPlanDescription = sr.GetString(sr.GetOrdinal("TransportationFacilitiesPlanDescription")); }
                if (sr.IsDBNull(sr.GetOrdinal("CoalConservationPlanDescription"))) { obj.CoalConservationPlanDescription = null; } else { obj.CoalConservationPlanDescription = sr.GetString(sr.GetOrdinal("CoalConservationPlanDescription")); }
                if (sr.IsDBNull(sr.GetOrdinal("AugerMiningIncluded"))) { obj.AugerMiningIncluded = null; } else { obj.AugerMiningIncluded = sr.GetBoolean(sr.GetOrdinal("AugerMiningIncluded")); }
                if (sr.IsDBNull(sr.GetOrdinal("AugerMiningPlanDescription"))) { obj.AugerMiningPlanDescription = null; } else { obj.AugerMiningPlanDescription = sr.GetString(sr.GetOrdinal("AugerMiningPlanDescription")); }
                if (sr.IsDBNull(sr.GetOrdinal("BackfillAndGradingPlanDescription"))) { obj.BackfillAndGradingPlanDescription = null; } else { obj.BackfillAndGradingPlanDescription = sr.GetString(sr.GetOrdinal("BackfillAndGradingPlanDescription")); }
                if (sr.IsDBNull(sr.GetOrdinal("DrainageBasinReclamationPlanDescription"))) { obj.DrainageBasinReclamationPlanDescription = null; } else { obj.DrainageBasinReclamationPlanDescription = sr.GetString(sr.GetOrdinal("DrainageBasinReclamationPlanDescription")); }
                if (sr.IsDBNull(sr.GetOrdinal("SoilHandlingPlanDescription"))) { obj.SoilHandlingPlanDescription = null; } else { obj.SoilHandlingPlanDescription = sr.GetString(sr.GetOrdinal("SoilHandlingPlanDescription")); }
                if (sr.IsDBNull(sr.GetOrdinal("PostmineRevegetationTypesDiscussion"))) { obj.PostmineRevegetationTypesDiscussion = null; } else { obj.PostmineRevegetationTypesDiscussion = sr.GetString(sr.GetOrdinal("PostmineRevegetationTypesDiscussion")); }
                if (sr.IsDBNull(sr.GetOrdinal("SealedMineOpeningsPlanDescription"))) { obj.SealedMineOpeningsPlanDescription = null; } else { obj.SealedMineOpeningsPlanDescription = sr.GetString(sr.GetOrdinal("SealedMineOpeningsPlanDescription")); }
                if (sr.IsDBNull(sr.GetOrdinal("CADDrawing"))) { obj.CADDrawing = null; } else { obj.CADDrawing = sr.GetBoolean(sr.GetOrdinal("CADDrawing")); }
                if (sr.IsDBNull(sr.GetOrdinal("Completeness"))) { obj.Completeness = null; } else { obj.Completeness = sr.GetBoolean(sr.GetOrdinal("Completeness")); }
                if (sr.IsDBNull(sr.GetOrdinal("Acceptability"))) { obj.Acceptability = null; } else { obj.Acceptability = sr.GetBoolean(sr.GetOrdinal("Acceptability")); }

                objs.Add(obj);
            }

            return objs.ToArray();
        }
示例#3
0
        /// <summary>
        /// Updates a Permit record and returns the number of records affected
        /// </summary>
        public static int Update(PermitDO DO)
        {
            SqlParameter _PermitKey = new SqlParameter("PermitKey", SqlDbType.Int);
            SqlParameter _PermitID = new SqlParameter("PermitID", SqlDbType.VarChar);
            SqlParameter _ApplicationTypeID = new SqlParameter("ApplicationTypeID", SqlDbType.VarChar);
            SqlParameter _PermitStatusID = new SqlParameter("PermitStatusID", SqlDbType.VarChar);
            SqlParameter _ApplicationNumber = new SqlParameter("ApplicationNumber", SqlDbType.VarChar);
            SqlParameter _ApplicationDescriptionOfInterests = new SqlParameter("ApplicationDescriptionOfInterests", SqlDbType.VarChar);
            SqlParameter _SiteName = new SqlParameter("SiteName", SqlDbType.VarChar);
            SqlParameter _MineTypeID = new SqlParameter("MineTypeID", SqlDbType.VarChar);
            SqlParameter _MSHAID = new SqlParameter("MSHAID", SqlDbType.VarChar);
            SqlParameter _ReminedAcres = new SqlParameter("ReminedAcres", SqlDbType.Int);
            SqlParameter _LegalDescriptionOfAccess = new SqlParameter("LegalDescriptionOfAccess", SqlDbType.VarChar);
            SqlParameter _Latitude = new SqlParameter("Latitude", SqlDbType.VarChar);
            SqlParameter _Longitude = new SqlParameter("Longitude", SqlDbType.VarChar);
            SqlParameter _NewspaperName = new SqlParameter("NewspaperName", SqlDbType.VarChar);
            SqlParameter _NearestTown = new SqlParameter("NearestTown", SqlDbType.VarChar);
            SqlParameter _LegalRightToEnter = new SqlParameter("LegalRightToEnter", SqlDbType.VarChar);
            SqlParameter _SubjectOfLitigation = new SqlParameter("SubjectOfLitigation", SqlDbType.Bit);
            SqlParameter _StatusOfLitigation = new SqlParameter("StatusOfLitigation", SqlDbType.VarChar);
            SqlParameter _LandsUnsuitable = new SqlParameter("LandsUnsuitable", SqlDbType.Bit);
            SqlParameter _LifeOfMineYears = new SqlParameter("LifeOfMineYears", SqlDbType.Int);
            SqlParameter _AnnualAnticipatedProductionInTons = new SqlParameter("AnnualAnticipatedProductionInTons", SqlDbType.Int);
            SqlParameter _TotalAnticipatedProductionInTons = new SqlParameter("TotalAnticipatedProductionInTons", SqlDbType.Int);
            SqlParameter _LifeOfMineComments = new SqlParameter("LifeOfMineComments", SqlDbType.VarChar);
            SqlParameter _BondFormID = new SqlParameter("BondFormID", SqlDbType.VarChar);
            SqlParameter _OtherBondFormDescription = new SqlParameter("OtherBondFormDescription", SqlDbType.VarChar);
            SqlParameter _CulturalResourcesDescription = new SqlParameter("CulturalResourcesDescription", SqlDbType.VarChar);
            SqlParameter _UniqueSpecialCharacteristicsAndGeologicFormations = new SqlParameter("UniqueSpecialCharacteristicsAndGeologicFormations", SqlDbType.VarChar);
            SqlParameter _UniqueSpecialCharacteristicsAdverselyAffectedByMining = new SqlParameter("UniqueSpecialCharacteristicsAdverselyAffectedByMining", SqlDbType.Bit);
            SqlParameter _GeologicInformationUndersirable = new SqlParameter("GeologicInformationUndersirable", SqlDbType.Bit);
            SqlParameter _AverageWindDirection = new SqlParameter("AverageWindDirection", SqlDbType.VarChar);
            SqlParameter _AverageWindVelocity = new SqlParameter("AverageWindVelocity", SqlDbType.Decimal);
            SqlParameter _PrimeFarmlandSoils = new SqlParameter("PrimeFarmlandSoils", SqlDbType.Bit);
            SqlParameter _ResourcesAffectedByProposedOperation = new SqlParameter("ResourcesAffectedByProposedOperation", SqlDbType.Bit);
            SqlParameter _ResourcesAffectedByProposedOperationDescription = new SqlParameter("ResourcesAffectedByProposedOperationDescription", SqlDbType.VarChar);
            SqlParameter _ProposedMiningWithinPublicRoads = new SqlParameter("ProposedMiningWithinPublicRoads", SqlDbType.Bit);
            SqlParameter _ProposedMiningWithinPublicRoadsDescription = new SqlParameter("ProposedMiningWithinPublicRoadsDescription", SqlDbType.VarChar);
            SqlParameter _AdjacentToValleyHoldingStream = new SqlParameter("AdjacentToValleyHoldingStream", SqlDbType.Bit);
            SqlParameter _AdjacentToValleyHoldingStreamDescription = new SqlParameter("AdjacentToValleyHoldingStreamDescription", SqlDbType.VarChar);
            SqlParameter _AlluvialValleyFloorDeterminationRequested = new SqlParameter("AlluvialValleyFloorDeterminationRequested", SqlDbType.Bit);
            SqlParameter _AlluvialValleyFloorDeterminationRequestedDescription = new SqlParameter("AlluvialValleyFloorDeterminationRequestedDescription", SqlDbType.VarChar);
            SqlParameter _TypeAndMethodOfMiningPlanDescription = new SqlParameter("TypeAndMethodOfMiningPlanDescription", SqlDbType.VarChar);
            SqlParameter _AnnualAnticipatedMiningProductionInTons = new SqlParameter("AnnualAnticipatedMiningProductionInTons", SqlDbType.Int);
            SqlParameter _TotalAnticipatedMiningProductionInTons = new SqlParameter("TotalAnticipatedMiningProductionInTons", SqlDbType.Int);
            SqlParameter _TotalMiningReservesInTons = new SqlParameter("TotalMiningReservesInTons", SqlDbType.Int);
            SqlParameter _FacilitiesManagementPlanDescription = new SqlParameter("FacilitiesManagementPlanDescription", SqlDbType.VarChar);
            SqlParameter _OperateSupportFacilityNotWithinPermitArea = new SqlParameter("OperateSupportFacilityNotWithinPermitArea", SqlDbType.Bit);
            SqlParameter _ToxicAndUndesirableMaterialsDisposalPlanDescription = new SqlParameter("ToxicAndUndesirableMaterialsDisposalPlanDescription", SqlDbType.VarChar);
            SqlParameter _FireContingencyPlanDescription = new SqlParameter("FireContingencyPlanDescription", SqlDbType.VarChar);
            SqlParameter _ComplianceWithAirAndWaterQualityLawsDescription = new SqlParameter("ComplianceWithAirAndWaterQualityLawsDescription", SqlDbType.VarChar);
            SqlParameter _NoxiousWeedsManagementPlanDescription = new SqlParameter("NoxiousWeedsManagementPlanDescription", SqlDbType.VarChar);
            SqlParameter _BlastingPlanDescription = new SqlParameter("BlastingPlanDescription", SqlDbType.VarChar);
            SqlParameter _AirPollutionControlPlanDescription = new SqlParameter("AirPollutionControlPlanDescription", SqlDbType.VarChar);
            SqlParameter _FishAndWildlifePlanDescription = new SqlParameter("FishAndWildlifePlanDescription", SqlDbType.VarChar);
            SqlParameter _MiningConductedWithin500FeetUndergroundMine = new SqlParameter("MiningConductedWithin500FeetUndergroundMine", SqlDbType.Bit);
            SqlParameter _MiningConductedWithin500FeetUndergroundMineDescription = new SqlParameter("MiningConductedWithin500FeetUndergroundMineDescription", SqlDbType.VarChar);
            SqlParameter _DiversionConstructed = new SqlParameter("DiversionConstructed", SqlDbType.Bit);
            SqlParameter _DisposalOfExcessSpoilRequired = new SqlParameter("DisposalOfExcessSpoilRequired", SqlDbType.Bit);
            SqlParameter _TransportationFacilitiesPlanDescription = new SqlParameter("TransportationFacilitiesPlanDescription", SqlDbType.VarChar);
            SqlParameter _CoalConservationPlanDescription = new SqlParameter("CoalConservationPlanDescription", SqlDbType.VarChar);
            SqlParameter _AugerMiningIncluded = new SqlParameter("AugerMiningIncluded", SqlDbType.Bit);
            SqlParameter _AugerMiningPlanDescription = new SqlParameter("AugerMiningPlanDescription", SqlDbType.VarChar);
            SqlParameter _BackfillAndGradingPlanDescription = new SqlParameter("BackfillAndGradingPlanDescription", SqlDbType.VarChar);
            SqlParameter _DrainageBasinReclamationPlanDescription = new SqlParameter("DrainageBasinReclamationPlanDescription", SqlDbType.VarChar);
            SqlParameter _SoilHandlingPlanDescription = new SqlParameter("SoilHandlingPlanDescription", SqlDbType.VarChar);
            SqlParameter _PostmineRevegetationTypesDiscussion = new SqlParameter("PostmineRevegetationTypesDiscussion", SqlDbType.VarChar);
            SqlParameter _SealedMineOpeningsPlanDescription = new SqlParameter("SealedMineOpeningsPlanDescription", SqlDbType.VarChar);
            SqlParameter _CADDrawing = new SqlParameter("CADDrawing", SqlDbType.Bit);
            SqlParameter _Completeness = new SqlParameter("Completeness", SqlDbType.Bit);
            SqlParameter _Acceptability = new SqlParameter("Acceptability", SqlDbType.Bit);

            _PermitKey.Value = DO.PermitKey;
            _PermitID.Value = DO.PermitID;
            _ApplicationTypeID.Value = DO.ApplicationTypeID;
            _PermitStatusID.Value = DO.PermitStatusID;
            _ApplicationNumber.Value = DO.ApplicationNumber;
            _ApplicationDescriptionOfInterests.Value = DO.ApplicationDescriptionOfInterests;
            _SiteName.Value = DO.SiteName;
            _MineTypeID.Value = DO.MineTypeID;
            _MSHAID.Value = DO.MSHAID;
            _ReminedAcres.Value = DO.ReminedAcres;
            _LegalDescriptionOfAccess.Value = DO.LegalDescriptionOfAccess;
            _Latitude.Value = DO.Latitude;
            _Longitude.Value = DO.Longitude;
            _NewspaperName.Value = DO.NewspaperName;
            _NearestTown.Value = DO.NearestTown;
            _LegalRightToEnter.Value = DO.LegalRightToEnter;
            _SubjectOfLitigation.Value = DO.SubjectOfLitigation;
            _StatusOfLitigation.Value = DO.StatusOfLitigation;
            _LandsUnsuitable.Value = DO.LandsUnsuitable;
            _LifeOfMineYears.Value = DO.LifeOfMineYears;
            _AnnualAnticipatedProductionInTons.Value = DO.AnnualAnticipatedProductionInTons;
            _TotalAnticipatedProductionInTons.Value = DO.TotalAnticipatedProductionInTons;
            _LifeOfMineComments.Value = DO.LifeOfMineComments;
            _BondFormID.Value = DO.BondFormID;
            _OtherBondFormDescription.Value = DO.OtherBondFormDescription;
            _CulturalResourcesDescription.Value = DO.CulturalResourcesDescription;
            _UniqueSpecialCharacteristicsAndGeologicFormations.Value = DO.UniqueSpecialCharacteristicsAndGeologicFormations;
            _UniqueSpecialCharacteristicsAdverselyAffectedByMining.Value = DO.UniqueSpecialCharacteristicsAdverselyAffectedByMining;
            _GeologicInformationUndersirable.Value = DO.GeologicInformationUndersirable;
            _AverageWindDirection.Value = DO.AverageWindDirection;
            _AverageWindVelocity.Value = DO.AverageWindVelocity;
            _PrimeFarmlandSoils.Value = DO.PrimeFarmlandSoils;
            _ResourcesAffectedByProposedOperation.Value = DO.ResourcesAffectedByProposedOperation;
            _ResourcesAffectedByProposedOperationDescription.Value = DO.ResourcesAffectedByProposedOperationDescription;
            _ProposedMiningWithinPublicRoads.Value = DO.ProposedMiningWithinPublicRoads;
            _ProposedMiningWithinPublicRoadsDescription.Value = DO.ProposedMiningWithinPublicRoadsDescription;
            _AdjacentToValleyHoldingStream.Value = DO.AdjacentToValleyHoldingStream;
            _AdjacentToValleyHoldingStreamDescription.Value = DO.AdjacentToValleyHoldingStreamDescription;
            _AlluvialValleyFloorDeterminationRequested.Value = DO.AlluvialValleyFloorDeterminationRequested;
            _AlluvialValleyFloorDeterminationRequestedDescription.Value = DO.AlluvialValleyFloorDeterminationRequestedDescription;
            _TypeAndMethodOfMiningPlanDescription.Value = DO.TypeAndMethodOfMiningPlanDescription;
            _AnnualAnticipatedMiningProductionInTons.Value = DO.AnnualAnticipatedMiningProductionInTons;
            _TotalAnticipatedMiningProductionInTons.Value = DO.TotalAnticipatedMiningProductionInTons;
            _TotalMiningReservesInTons.Value = DO.TotalMiningReservesInTons;
            _FacilitiesManagementPlanDescription.Value = DO.FacilitiesManagementPlanDescription;
            _OperateSupportFacilityNotWithinPermitArea.Value = DO.OperateSupportFacilityNotWithinPermitArea;
            _ToxicAndUndesirableMaterialsDisposalPlanDescription.Value = DO.ToxicAndUndesirableMaterialsDisposalPlanDescription;
            _FireContingencyPlanDescription.Value = DO.FireContingencyPlanDescription;
            _ComplianceWithAirAndWaterQualityLawsDescription.Value = DO.ComplianceWithAirAndWaterQualityLawsDescription;
            _NoxiousWeedsManagementPlanDescription.Value = DO.NoxiousWeedsManagementPlanDescription;
            _BlastingPlanDescription.Value = DO.BlastingPlanDescription;
            _AirPollutionControlPlanDescription.Value = DO.AirPollutionControlPlanDescription;
            _FishAndWildlifePlanDescription.Value = DO.FishAndWildlifePlanDescription;
            _MiningConductedWithin500FeetUndergroundMine.Value = DO.MiningConductedWithin500FeetUndergroundMine;
            _MiningConductedWithin500FeetUndergroundMineDescription.Value = DO.MiningConductedWithin500FeetUndergroundMineDescription;
            _DiversionConstructed.Value = DO.DiversionConstructed;
            _DisposalOfExcessSpoilRequired.Value = DO.DisposalOfExcessSpoilRequired;
            _TransportationFacilitiesPlanDescription.Value = DO.TransportationFacilitiesPlanDescription;
            _CoalConservationPlanDescription.Value = DO.CoalConservationPlanDescription;
            _AugerMiningIncluded.Value = DO.AugerMiningIncluded;
            _AugerMiningPlanDescription.Value = DO.AugerMiningPlanDescription;
            _BackfillAndGradingPlanDescription.Value = DO.BackfillAndGradingPlanDescription;
            _DrainageBasinReclamationPlanDescription.Value = DO.DrainageBasinReclamationPlanDescription;
            _SoilHandlingPlanDescription.Value = DO.SoilHandlingPlanDescription;
            _PostmineRevegetationTypesDiscussion.Value = DO.PostmineRevegetationTypesDiscussion;
            _SealedMineOpeningsPlanDescription.Value = DO.SealedMineOpeningsPlanDescription;
            _CADDrawing.Value = DO.CADDrawing;
            _Completeness.Value = DO.Completeness;
            _Acceptability.Value = DO.Acceptability;

            SqlParameter[] _params = new SqlParameter[] {
                _PermitKey,
                _PermitID,
                _ApplicationTypeID,
                _PermitStatusID,
                _ApplicationNumber,
                _ApplicationDescriptionOfInterests,
                _SiteName,
                _MineTypeID,
                _MSHAID,
                _ReminedAcres,
                _LegalDescriptionOfAccess,
                _Latitude,
                _Longitude,
                _NewspaperName,
                _NearestTown,
                _LegalRightToEnter,
                _SubjectOfLitigation,
                _StatusOfLitigation,
                _LandsUnsuitable,
                _LifeOfMineYears,
                _AnnualAnticipatedProductionInTons,
                _TotalAnticipatedProductionInTons,
                _LifeOfMineComments,
                _BondFormID,
                _OtherBondFormDescription,
                _CulturalResourcesDescription,
                _UniqueSpecialCharacteristicsAndGeologicFormations,
                _UniqueSpecialCharacteristicsAdverselyAffectedByMining,
                _GeologicInformationUndersirable,
                _AverageWindDirection,
                _AverageWindVelocity,
                _PrimeFarmlandSoils,
                _ResourcesAffectedByProposedOperation,
                _ResourcesAffectedByProposedOperationDescription,
                _ProposedMiningWithinPublicRoads,
                _ProposedMiningWithinPublicRoadsDescription,
                _AdjacentToValleyHoldingStream,
                _AdjacentToValleyHoldingStreamDescription,
                _AlluvialValleyFloorDeterminationRequested,
                _AlluvialValleyFloorDeterminationRequestedDescription,
                _TypeAndMethodOfMiningPlanDescription,
                _AnnualAnticipatedMiningProductionInTons,
                _TotalAnticipatedMiningProductionInTons,
                _TotalMiningReservesInTons,
                _FacilitiesManagementPlanDescription,
                _OperateSupportFacilityNotWithinPermitArea,
                _ToxicAndUndesirableMaterialsDisposalPlanDescription,
                _FireContingencyPlanDescription,
                _ComplianceWithAirAndWaterQualityLawsDescription,
                _NoxiousWeedsManagementPlanDescription,
                _BlastingPlanDescription,
                _AirPollutionControlPlanDescription,
                _FishAndWildlifePlanDescription,
                _MiningConductedWithin500FeetUndergroundMine,
                _MiningConductedWithin500FeetUndergroundMineDescription,
                _DiversionConstructed,
                _DisposalOfExcessSpoilRequired,
                _TransportationFacilitiesPlanDescription,
                _CoalConservationPlanDescription,
                _AugerMiningIncluded,
                _AugerMiningPlanDescription,
                _BackfillAndGradingPlanDescription,
                _DrainageBasinReclamationPlanDescription,
                _SoilHandlingPlanDescription,
                _PostmineRevegetationTypesDiscussion,
                _SealedMineOpeningsPlanDescription,
                _CADDrawing,
                _Completeness,
                _Acceptability
            };

            return DataCommon.ExecuteScalar("[dbo].[Permit_Update]", _params, "dbo");
        }
示例#4
0
        /// <summary>
        /// Deletes a Permit record
        /// </summary>
        public static int Delete(PermitDO DO)
        {
            SqlParameter _PermitKey = new SqlParameter("PermitKey", SqlDbType.Int);

            _PermitKey.Value = DO.PermitKey;

            SqlParameter[] _params = new SqlParameter[] {
                _PermitKey
            };

            return DataCommon.ExecuteScalar("[dbo].[Permit_Delete]", _params, "dbo");
        }