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)); }
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)); }