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()); }
public ActionResult DeleteGrantAllocationNote(GrantAllocationNotePrimaryKey grantAllocationNotePrimaryKey, ConfirmDialogFormViewModel viewModel) { var grantAllocationNote = grantAllocationNotePrimaryKey.EntityObject; if (!ModelState.IsValid) { return(ViewDeleteGrantAllocationNote(grantAllocationNote, viewModel)); } var message = $"{FieldDefinition.GrantAllocationNote.GetFieldDefinitionLabel()} created on '{grantAllocationNote.CreatedDate}' by '{grantAllocationNote.CreatedByPerson.FullNameFirstLast}' successfully deleted."; grantAllocationNote.DeleteFull(HttpRequestStorage.DatabaseEntities); SetMessageForDisplay(message); return(new ModalDialogFormJsonResult()); }
public PartialViewResult DeleteGrantAllocationNote(GrantAllocationNotePrimaryKey grantAllocationNotePrimaryKey) { var viewModel = new ConfirmDialogFormViewModel(grantAllocationNotePrimaryKey.PrimaryKeyValue); return(ViewDeleteGrantAllocationNote(grantAllocationNotePrimaryKey.EntityObject, viewModel)); }