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()); }