예제 #1
0
        public PartialViewResult BulkRowTreatmentBMPs(BulkRowTreatmentBMPViewModel viewModel)
        {
            var treatmentBMPs = new List <TreatmentBMP>();

            if (viewModel.EntityIDList != null)
            {
                treatmentBMPs = HttpRequestStorage.DatabaseEntities.TreatmentBMPs.Where(x => viewModel.EntityIDList.Contains(x.TreatmentBMPID)).OrderBy(x => x.TreatmentBMPName).ToList();
            }
            ModelState.Clear(); // we intentionally want to clear any error messages here since this post route is returning a view
            var viewData = new BulkRowTreatmentBMPViewData(treatmentBMPs, SitkaRoute <BulkRowController> .BuildUrlFromExpression(x => x.MarkTreatmentBMPAsVerifiedModal(null)), "Treatment BMP", "The BMP inventory for the selected BMPs will be marked as Verified until the inventory is updated or a Jurisdiction Manager later flags the data as provisional.");

            return(RazorPartialView <BulkRowTreatmentBMP, BulkRowTreatmentBMPViewData, BulkRowTreatmentBMPViewModel>(viewData, viewModel));
        }
예제 #2
0
        public ActionResult MarkTreatmentBMPAsVerifiedModal(BulkRowTreatmentBMPViewModel viewModel)
        {
            if (!ModelState.IsValid)
            {
                return(new ModalDialogFormJsonResult());
            }

            var treatmentBMPs = HttpRequestStorage.DatabaseEntities.TreatmentBMPs.Where(x => viewModel.EntityIDList.Contains(x.TreatmentBMPID)).ToList();

            treatmentBMPs.ForEach(x => x.MarkAsVerified(CurrentPerson));
            var numberOfVerifiedTreatmentBMPs = treatmentBMPs.Count;

            SetMessageForDisplay($"{numberOfVerifiedTreatmentBMPs} BMPs were successfully verified.");
            return(new ModalDialogFormJsonResult());
        }
예제 #3
0
        public ActionResult MarkBMPDelineationAsVerifiedModal(BulkRowTreatmentBMPViewModel viewModel)
        {
            if (!ModelState.IsValid)
            {
                return(new ModalDialogFormJsonResult());
            }

            var bmpDelineations = HttpRequestStorage.DatabaseEntities.Delineations.Where(x => viewModel.EntityIDList.Contains(x.DelineationID)).ToList();

            bmpDelineations.ForEach(x => x.MarkAsVerified(CurrentPerson));

            NereidUtilities.MarkDelineationDirty(bmpDelineations, HttpRequestStorage.DatabaseEntities);

            var numberOfVerifiedBMPDelineations = bmpDelineations.Count;

            SetMessageForDisplay($"{numberOfVerifiedBMPDelineations} BMP Delineations were successfully verified.");

            return(new ModalDialogFormJsonResult());
        }