public void SaveTicketToPtint(PullTicketsImpresionViewModel ticketToPrit) { var ticket = entities.TransaccionPullTicketsImpresions.Where(e => e.Id == ticketToPrit.Id).FirstOrDefault(); if (ticket != null) { //ticket.NumeroInicial = entities.TicketsEventos.FirstOrDefault(e => e.Id == ticketToPrit.IdPullTickets).Tickets.Where(r => r.IdEstado == EstadoTicket.DISPONIBLE).Min(r => (int)r.Numero); ; ticket.ImagenTicket = ticketToPrit.ImgTicket;//.Replace("data:image/svg+xml;base64,", ""); ticket.Fecha = DateTime.Now; //ticket.IdEstado = EstadoTicket.DISPONIBLE; } entities.SaveChanges(); }
internal PullTicketsImpresionViewModel CreatePullTicketsToPrint(PullTicketsImpresionViewModel p, int idTicketsEtapa, string token) { //Guardar eñ id de los tickets Etaa var data = new TransaccionPullTicketsImpresion() { //IdTicketsEvento = p.IdPullTickets, //ImagenTicket = p.ImgTicket, Fecha = DateTime.Now, //Cantidad = p.Cantidad, Token = token,//"7530A39A-169A-4B83-B476-9AF84A7CECA2",//MAC address, //IdTicketsEtapa = idTicketsEtapa, //PrinterName = p.PrinterName }; entities.Add(data); entities.SaveChanges(); p.Id = data.Id; return(p); }
public void SaveTicketToPtint(PullTicketsImpresionViewModel ticketToPrit, int idTicketsEtapa, string token, int inicio, int final) { var data = new TransaccionPullTicketsImpresion() { //IdTicketsEvento = ticketToPrit.IdPullTickets, ImagenTicket = ticketToPrit.ImgTicket, Fecha = DateTime.Now, //Cantidad = ticketToPrit.Cantidad, Token = token, //IdTicketsEtapa = idTicketsEtapa, //PrinterName = ticketToPrit.PrinterName, //NumeroInicial = inicio, //NumeroFinal = final, //IdEstado = EstadoTicket.DISPONIBLE }; entities.Add(data); entities.SaveChanges(); ticketToPrit.Id = data.Id; }