public InvoiceEditViewModel Update(InvoiceEditViewModel P) { Invoice PP = InvoiceRepo.Update(P.ToModel()); unitOfWork.Commit(); return(PP.ToEditableViewModel()); }
public InvoiceEditViewModel Add(InvoiceEditViewModel P) { Invoice PP = InvoiceRepo.Add(P.ToModel()); foreach (var item in P.InvoiceItems) { item.InvoiceID = PP.ID; InvoiceItemRepo.Add(item.ToModel()); } unitOfWork.Commit(); return(PP.ToEditableViewModel()); }