public void Update(InvoiceNoteDto invoiceNote)
        {
            var userId = currentPrincipal.GetUserId();
            var entity = invoiceNoteRepository.GetById(invoiceNote.Id);

            if (userId != entity?.UserId)
            {
                throw new ForbiddenException();
            }

            invoiceNoteRepository.Update(invoiceNote.ToInvoiceNote(entity));
            invoiceNoteRepository.Save();
        }
Пример #2
0
 public int UpdateInvoiceNoteRecord(DLModel.InvoiceNote modelInvoiceNote)
 {
     return(_invoiceNoteRepostory.Update((DLModel.InvoiceNote) new DLModel.InvoiceNote().InjectFrom(modelInvoiceNote)));
 }