public PartialViewResult EditGrantAllocationNote(GrantAllocationNotePrimaryKey grantAllocationNotePrimaryKey) { var grantAllocationNote = grantAllocationNotePrimaryKey.EntityObject; var viewModel = new EditGrantAllocationNoteViewModel(grantAllocationNote); return(ViewEditNote(viewModel, EditGrantAllocationNoteType.ExistingGrantAllocationNote)); }
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()); }
private PartialViewResult ViewEditNote(EditGrantAllocationNoteViewModel viewModel, EditGrantAllocationNoteType editGrantAllocationNoteType) { var viewData = new EditGrantAllocationNoteViewData(editGrantAllocationNoteType); return(RazorPartialView <EditGrantAllocationNote, EditGrantAllocationNoteViewData, EditGrantAllocationNoteViewModel>(viewData, viewModel)); }
public PartialViewResult NewGrantAllocationNote(GrantAllocationPrimaryKey grantAllocationPrimaryKey) { var viewModel = new EditGrantAllocationNoteViewModel(); return(ViewEditNote(viewModel, EditGrantAllocationNoteType.NewNote)); }