public ActionResult Tickets(int folio) { if (Session["usuario"] == null) { Session.Clear(); return(RedirectToAction("Index", "Home")); } ClienteClient cliente = new ClienteClient(); AdministradorClient admin = new AdministradorClient(); var tipos = admin.listarTipoCatalogo(new TipoCatalogoRequest { Id = 0 }); var carrito = cliente.verPedido(new CarritoRequest { Folio = folio }); var response = cliente.listarTickets(new ClienteServicio.NotaTicketRequest { IdNota = folio }); listaTicketsmodel listaTicketsmodel = new listaTicketsmodel { Folio = folio, IdTipo = carrito.IdTipo, MontoMXN = carrito.MontoMXN, MontoUSD = carrito.MontoUSD, Items = response.Items.Select(i => new Ticketmodel { Fecha = i.Fecha, Id = i.Id, IdNota = i.IdNota, MontoMXN = i.MontoMXN, MontoUSD = i.MontoUSD, Ticket = i.Ticket }).ToList(), SaldoMXN = carrito.SaldoMXN, SaldoUSD = carrito.SaldoUSD, Tipo = string.Empty // tipos.Items.FirstOrDefault(i => i.Id == carrito.IdTipo).Nombre }; return(View(listaTicketsmodel)); }
public ActionResult Tickets(int folio) { if (Session["usuario"] == null) { Session.Clear(); return(RedirectToAction("Index", "Home")); } var servicio = new AdministradorClient(); var listatickets = new listaTicketsmodel(); var response = servicio.listarTicketNota(new NotaTicketRequest { IdNota = folio }); listatickets.Items.AddRange(response.Items.Select(i => new Ticketmodel { Id = i.Id, Fecha = i.Fecha, IdNota = i.IdNota, Ticket = i.Ticket, MontoMXN = i.MontoMXN, MontoUSD = i.MontoUSD })); return(View(listatickets)); }