public ActionResult ObtenerNroCola(int servicioId, int ventanillaId) { var cola = ColaBL.Contar(x => x.ServicioId == servicioId && x.IndAtendido == false && x.Fecha.Year == DateTime.Now.Year && x.Fecha.Month == DateTime.Now.Month && x.Fecha.Day == DateTime.Now.Day ); var atendidos = ColaVentanillaBL.Contar(x => x.VentanillaId == ventanillaId && x.IndAtendido && x.Fecha.Year == DateTime.Now.Year && x.Fecha.Month == DateTime.Now.Month && x.Fecha.Day == DateTime.Now.Day ); var ausentes = ColaVentanillaBL.Contar(x => x.VentanillaId == ventanillaId && x.IndAtendido == false && x.Fecha.Year == DateTime.Now.Year && x.Fecha.Month == DateTime.Now.Month && x.Fecha.Day == DateTime.Now.Day ); return(Json(new { cola, atendidos, ausentes }, JsonRequestBehavior.AllowGet)); }
private void GenerarTikect(int servicioId, string servicio) { Servicio = servicio; var numero = ColaBL.Contar(x => x.Fecha.Year == DateTime.Now.Year && x.Fecha.Month == DateTime.Now.Month && x.Fecha.Day == DateTime.Now.Day && x.ServicioId == servicioId);// obtener del servidor Codigo = servicio.Substring(0, 2) + (numero + 1).ToString(); // mejorar para que guarde la fecha de servidor ColaBL.Crear(new Cola() { ServicioId = servicioId, Fecha = DateTime.Now, Codigo = Codigo }); printDocument2 = new PrintDocument(); PrinterSettings ps = new PrinterSettings(); printDocument2.PrinterSettings = ps; printDocument2.PrintPage += Imprimir; var tam = new PaperSize(); tam.RawKind = 35; //tam.Height = 56; //tam.Width = 56; ps.DefaultPageSettings.PaperSize = new PaperSize("210 x 297 mm", 150, 130); //ps.DefaultPageSettings.PaperSize = tam; //ps.DefaultPageSettings.Landscape = true; //ps.DefaultPageSettings.Margins = new Margins(0, 0, 0, 0); // printDocument2.DefaultPageSettings.PaperSize = new System.Drawing.Printing.PaperSize("ticket", 240, 350); printDocument2.Print(); }
public ActionResult Atender(int colaId, int ventanillaId, int servicioId, int bloqueId, bool atendido) { ColaVentanillaBL.Crear(new ColaVentanilla { Fecha = DateTime.Now, ColaId = colaId, VentanillaId = ventanillaId, IndAtendido = atendido }); var v = VentanillaBL.Obtener(ventanillaId); var c = ColaBL.Obtener(colaId); TvBL.Crear(new Tv { BloqueId = bloqueId, Denominacion = c.Codigo + " -- " + v.Denominacion, Fecha = DateTime.Now }); ColaBL.ActualizarParcial(new Cola { Id = colaId, IndAtendido = true }, x => x.IndAtendido); //return Json(true, JsonRequestBehavior.AllowGet); return(ObtenerNroCola(servicioId, ventanillaId)); }
public ActionResult LlamarCola(int servicioId) { var s = ColaBL.LlamarCola(servicioId); return(Json(new { s.Codigo, s.ServicioId, s.Id }, JsonRequestBehavior.AllowGet)); }