public PartialViewResult EditGrantNote(GrantNotePrimaryKey grantNotePrimaryKey) { var grantNote = grantNotePrimaryKey.EntityObject; var viewModel = new EditGrantNoteViewModel(grantNote); return(ViewEditNote(viewModel, EditGrantNoteType.ExistingNote)); }
public ActionResult DeleteGrantNote(GrantNotePrimaryKey grantNotePrimaryKey, ConfirmDialogFormViewModel viewModel) { var grantNote = grantNotePrimaryKey.EntityObject; if (!ModelState.IsValid) { return ViewDeleteGrantNote(grantNote, viewModel); } var message = $"{FieldDefinition.GrantNote.GetFieldDefinitionLabel()} created on '{grantNote.CreatedDate}' by '{grantNote.CreatedByPerson.FullNameFirstLast}' successfully deleted."; grantNote.DeleteFull(HttpRequestStorage.DatabaseEntities); SetMessageForDisplay(message); return new ModalDialogFormJsonResult(); }
public ActionResult EditGrantNote(GrantNotePrimaryKey grantNotePrimaryKey, EditGrantNoteViewModel viewModel) { if (!ModelState.IsValid) { return ViewEditNote(viewModel, EditGrantNoteType.ExistingNote); } var grantNote = grantNotePrimaryKey.EntityObject; viewModel.UpdateModel(grantNote, CurrentPerson, EditGrantNoteType.ExistingNote); HttpRequestStorage.DatabaseEntities.GrantNotes.AddOrUpdate(grantNote); SetMessageForDisplay($"{FieldDefinition.GrantNote.GetFieldDefinitionLabel()} has been updated."); return new ModalDialogFormJsonResult(); }
public PartialViewResult DeleteGrantNote(GrantNotePrimaryKey grantNotePrimaryKey) { var viewModel = new ConfirmDialogFormViewModel(grantNotePrimaryKey.PrimaryKeyValue); return(ViewDeleteGrantNote(grantNotePrimaryKey.EntityObject, viewModel)); }