Example #1
0
        public ActionResult DeleteFundingEvent(FundingEventPrimaryKey fundingEventPrimaryKey)
        {
            var fundingEvent = fundingEventPrimaryKey.EntityObject;
            var viewModel    = new ConfirmDialogFormViewModel(fundingEventPrimaryKey.PrimaryKeyValue);

            return(ViewDelete(viewModel, fundingEvent));
        }
Example #2
0
        public PartialViewResult EditFundingEvent(FundingEventPrimaryKey fundingEventPrimaryKey)
        {
            var fundingEvent = fundingEventPrimaryKey.EntityObject;

            var viewModel = new EditViewModel(fundingEvent);

            return(ViewEditFundingEventFundingSources(fundingEvent, viewModel));
        }
Example #3
0
        public ActionResult EditFundingEvent(FundingEventPrimaryKey fundingEventPrimaryKey, EditViewModel viewModel)
        {
            var fundingEvent = fundingEventPrimaryKey.EntityObject;

            if (!ModelState.IsValid)
            {
                return(ViewEditFundingEventFundingSources(fundingEvent, viewModel));
            }

            SetMessageForDisplay($"{FieldDefinitionType.FundingEvent.GetFieldDefinitionLabel()} successfully updated.");

            return(UpdateFundingEventFundingSources(viewModel, fundingEvent));
        }
Example #4
0
        public ActionResult DeleteFundingEvent(FundingEventPrimaryKey fundingEventPrimaryKey,
                                               ConfirmDialogFormViewModel viewModel)
        {
            var fundingEvent = fundingEventPrimaryKey.EntityObject;

            if (!ModelState.IsValid)
            {
                return(ViewDelete(viewModel, fundingEvent));
            }

            fundingEvent.DeleteFull(HttpRequestStorage.DatabaseEntities);
            HttpRequestStorage.DatabaseEntities.SaveChanges();

            SetMessageForDisplay($"{FieldDefinitionType.FundingEvent.GetFieldDefinitionLabel()} successfully deleted");
            return(new ModalDialogFormJsonResult());
        }