コード例 #1
0
        private PartialViewResult ViewDeleteTravelLineItem(GrantAllocationAwardTravelLineItem grantAllocationAwardTravelLineItem, ConfirmDialogFormViewModel viewModel)
        {
            var confirmMessage = $"Are you sure you want to delete this {FieldDefinition.GrantAllocationAwardTravelLineItem.GetFieldDefinitionLabel()}?";
            var viewData       = new ConfirmDialogFormViewData(confirmMessage, true);

            return(RazorPartialView <ConfirmDialogForm, ConfirmDialogFormViewData, ConfirmDialogFormViewModel>(viewData, viewModel));
        }
コード例 #2
0
        public ActionResult NewTravelLineItemFromGrantAllocationAward(GrantAllocationAwardPrimaryKey grantAllocationAwardPrimaryKey, EditGrantAllocationAwardTravelLineItemViewModel viewModel)
        {
            if (!ModelState.IsValid)
            {
                return(GrantAllocationAwardTravelLineItemViewEdit(viewModel));
            }

            var grantAllocationAward = HttpRequestStorage.DatabaseEntities.GrantAllocationAwards.Single(ga => ga.GrantAllocationAwardID == viewModel.GrantAllocationAwardID);
            var travelLineItem       = GrantAllocationAwardTravelLineItem.CreateNewBlank(grantAllocationAward, GrantAllocationAwardTravelLineItemType.Transportation);

            viewModel.UpdateModel(travelLineItem);
            return(new ModalDialogFormJsonResult());
        }