private PartialViewResult ViewDeleteGrantAllocationNote(GrantAllocationNote grantAllocationNote, ConfirmDialogFormViewModel viewModel) { var confirmMessage = $"Are you sure you want to delete this {FieldDefinition.GrantAllocationNote.GetFieldDefinitionLabel()} created on '{grantAllocationNote.CreatedDate}' by '{grantAllocationNote.CreatedByPerson.FullNameFirstLast}'?"; var viewData = new ConfirmDialogFormViewData(confirmMessage, true); return(RazorPartialView <ConfirmDialogForm, ConfirmDialogFormViewData, ConfirmDialogFormViewModel>(viewData, viewModel)); }
public ActionResult NewGrantAllocationNote(GrantAllocationPrimaryKey grantAllocationPrimaryKey, EditGrantAllocationNoteViewModel viewModel) { if (!ModelState.IsValid) { return(ViewEditNote(viewModel, EditGrantAllocationNoteType.NewNote)); } var grantAllocation = grantAllocationPrimaryKey.EntityObject; var grantAllocationNote = GrantAllocationNote.CreateNewBlank(grantAllocation, CurrentPerson); viewModel.UpdateModel(grantAllocationNote, CurrentPerson, EditGrantAllocationNoteType.NewNote); HttpRequestStorage.DatabaseEntities.GrantAllocationNotes.Add(grantAllocationNote); SetMessageForDisplay($"New {FieldDefinition.GrantAllocationNote.GetFieldDefinitionLabel()} has been created."); return(new ModalDialogFormJsonResult()); }