//==================================== public void CreateDetailInvoice(SaveDetailInvoiceDto saveDetailInvoiceDto) { var product = _mapper.Map <SaveDetailInvoiceDto, DetailInvoice>(saveDetailInvoiceDto); _unitOfWorkDetail.DetailInvoices.Add(product); _unitOfWorkDetail.Complete(); UpdateCostInvoice(saveDetailInvoiceDto.InvoiceId); }
public void UpdateDetailInvoice(SaveDetailInvoiceDto saveDetailInvoiceDto) { var product = _unitOfWorkDetail.DetailInvoices.GetBy(saveDetailInvoiceDto.id); if (product == null) { return; } var tem = product.InvoiceId; _mapper.Map <SaveDetailInvoiceDto, DetailInvoice>(saveDetailInvoiceDto, product); _unitOfWorkDetail.Complete(); UpdateCostInvoice(saveDetailInvoiceDto.InvoiceId); UpdateCostInvoice(tem); }
public IActionResult OnGet(int invoiceId) { var t = Request.Cookies["logon"]; if (t == null) { return(RedirectToPage("../Accounts/Login")); } if (t == "false") { return(RedirectToPage("../Accounts/Login")); } if (invoiceId != 0) { DetailInvoice = new SaveDetailInvoiceDto(); DetailInvoice.InvoiceId = invoiceId; } ViewData["invoiceId"] = invoiceId; Invoices = new SelectList(_service.GetListInvoices()); Products = new SelectList(_serviceProduct.ProductSelectList()); return(Page()); }