public PartialViewResult EditGrantAllocationNoteInternal(GrantAllocationNoteInternalPrimaryKey grantAllocationNoteInternalPrimaryKey) { var grantAllocationNoteInternal = grantAllocationNoteInternalPrimaryKey.EntityObject; var viewModel = new EditGrantAllocationNoteInternalViewModel(grantAllocationNoteInternal); return(ViewEditGrantAllocationNoteInternal(viewModel, EditGrantAllocationNoteInternalType.ExistingGrantAllocationNoteInternal)); }
public ActionResult EditGrantAllocationNoteInternal(GrantAllocationNoteInternalPrimaryKey grantAllocationNoteInternalPrimaryKey, EditGrantAllocationNoteInternalViewModel viewModel) { if (!ModelState.IsValid) { return(ViewEditGrantAllocationNoteInternal(viewModel, EditGrantAllocationNoteInternalType.ExistingGrantAllocationNoteInternal)); } var grantAllocationNoteInternal = grantAllocationNoteInternalPrimaryKey.EntityObject; viewModel.UpdateModel(grantAllocationNoteInternal, CurrentPerson, EditGrantAllocationNoteType.ExistingGrantAllocationNote); HttpRequestStorage.DatabaseEntities.GrantAllocationNoteInternals.AddOrUpdate(grantAllocationNoteInternal); SetMessageForDisplay($"{FieldDefinition.GrantAllocationNoteInternal.GetFieldDefinitionLabel()} has been updated."); return(new ModalDialogFormJsonResult()); }
public ActionResult DeleteGrantAllocationNoteInternal(GrantAllocationNoteInternalPrimaryKey grantAllocationNoteInternalPrimaryKey, ConfirmDialogFormViewModel viewModel) { var grantAllocationNoteInternal = grantAllocationNoteInternalPrimaryKey.EntityObject; if (!ModelState.IsValid) { return(ViewDeleteGrantAllocationNoteInternal(grantAllocationNoteInternal, viewModel)); } var message = $"{FieldDefinition.GrantAllocationNoteInternal.GetFieldDefinitionLabel()} created on '{grantAllocationNoteInternal.CreatedDate}' by '{grantAllocationNoteInternal.CreatedByPerson.FullNameFirstLast}' successfully deleted."; grantAllocationNoteInternal.DeleteFull(HttpRequestStorage.DatabaseEntities); SetMessageForDisplay(message); return(new ModalDialogFormJsonResult()); }
public PartialViewResult DeleteGrantAllocationNoteInternal(GrantAllocationNoteInternalPrimaryKey grantAllocationNoteInternalPrimaryKey) { var viewModel = new ConfirmDialogFormViewModel(grantAllocationNoteInternalPrimaryKey.PrimaryKeyValue); return(ViewDeleteGrantAllocationNoteInternal(grantAllocationNoteInternalPrimaryKey.EntityObject, viewModel)); }