Пример #1
0
 public ActionResult EditDetail(long xInvoiceId, long xDetailID, Models.InvoicesDetailViewModel xDetail)
 {
     try
     {
         facturas.GetById(xInvoiceId).DeleteDetail(xDetailID);
         facturas.GetById(xInvoiceId).AddDetail(xDetail.toModel());
         ActualizarFacturasEnSesion(facturas);
         return(Redirect("~/Invoice/Edit/" + xInvoiceId));
     }
     catch
     {
         return(View(ConverToDetailModelView(xDetail.toModel())));
     }
 }
Пример #2
0
 public ActionResult CreateDetail(int xInvoiceId, Models.InvoicesDetailViewModel xInvoice)
 {
     xInvoice.InvoiceId += facturas.GetById(xInvoiceId).GetDetail().Count() + 1;
     facturas.GetById(xInvoiceId).GetDetail().Add(xInvoice.toModel());
     ActualizarFacturasEnSesion(facturas);
     return(Redirect("~/Invoice/Edit/" + xInvoiceId));
 }