Esempio n. 1
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));
 }
Esempio n. 2
0
 private Models.InvoicesDetailViewModel ConverToDetailModelView(InvoiceDetail xInvoiceDetail)
 {
     Models.InvoicesDetailViewModel sInvD = new Models.InvoicesDetailViewModel();
     sInvD.Description = xInvoiceDetail.Description;
     sInvD.Amount      = xInvoiceDetail.Amount;
     sInvD.DetailID    = xInvoiceDetail.Id;
     sInvD.InvoiceId   = xInvoiceDetail.InvoiceId;
     sInvD.Taxes       = xInvoiceDetail.Taxes;
     sInvD.UnitPrice   = xInvoiceDetail.UnitPrice;
     return(sInvD);
 }
Esempio n. 3
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())));
     }
 }