Exemple #1
0
        public PartialViewResult EditGrantAllocationNote(GrantAllocationNotePrimaryKey grantAllocationNotePrimaryKey)
        {
            var grantAllocationNote = grantAllocationNotePrimaryKey.EntityObject;
            var viewModel           = new EditGrantAllocationNoteViewModel(grantAllocationNote);

            return(ViewEditNote(viewModel, EditGrantAllocationNoteType.ExistingGrantAllocationNote));
        }
Exemple #2
0
        public ActionResult EditGrantAllocationNote(GrantAllocationNotePrimaryKey grantAllocationNotePrimaryKey, EditGrantAllocationNoteViewModel viewModel)
        {
            if (!ModelState.IsValid)
            {
                return(ViewEditNote(viewModel, EditGrantAllocationNoteType.ExistingGrantAllocationNote));
            }

            var grantAllocationNote = grantAllocationNotePrimaryKey.EntityObject;

            viewModel.UpdateModel(grantAllocationNote, CurrentPerson, EditGrantAllocationNoteType.ExistingGrantAllocationNote);
            HttpRequestStorage.DatabaseEntities.GrantAllocationNotes.AddOrUpdate(grantAllocationNote);
            SetMessageForDisplay($"{FieldDefinition.GrantAllocationNote.GetFieldDefinitionLabel()} has been updated.");
            return(new ModalDialogFormJsonResult());
        }
Exemple #3
0
        private PartialViewResult ViewEditNote(EditGrantAllocationNoteViewModel viewModel, EditGrantAllocationNoteType editGrantAllocationNoteType)
        {
            var viewData = new EditGrantAllocationNoteViewData(editGrantAllocationNoteType);

            return(RazorPartialView <EditGrantAllocationNote, EditGrantAllocationNoteViewData, EditGrantAllocationNoteViewModel>(viewData, viewModel));
        }
Exemple #4
0
        public PartialViewResult NewGrantAllocationNote(GrantAllocationPrimaryKey grantAllocationPrimaryKey)
        {
            var viewModel = new EditGrantAllocationNoteViewModel();

            return(ViewEditNote(viewModel, EditGrantAllocationNoteType.NewNote));
        }