public ActionResult GetEscVal(dates rango) { Audito audito = new Audito(); EscVal escVal = new EscVal(); using (ApplicationDbContext db = new ApplicationDbContext()) { var lst = db.Auditorias.Where(c => c.FecAud >= rango.FecIni && c.FecAud <= rango.FecFin).ToList(); audito.AptErr = lst.Where(c => c.AptErr == true).Count(); audito.FalRes = lst.Where(c => c.FaFiMe == true).Count(); audito.ExaInc = lst.Where(c => c.ExaCom == true).Count(); audito.ConInc = lst.Where(c => c.Contro == true).Count(); audito.ErrDia = lst.Where(c => c.Diagno == true).Count(); audito.DatInc = lst.Where(c => c.DatInc == true).Count(); audito.ErrLle = lst.Where(c => c.ErrLle == true).Count(); audito.FaFiMe = lst.Where(c => c.FaFiMe == true).Count(); audito.FaFiPa = lst.Where(c => c.FaFiPa == true).Count(); escVal.MGr = audito.AptErr + audito.FalRes; escVal.Gra = audito.ExaInc + audito.ConInc + audito.ErrDia; escVal.Mod = audito.DatInc; escVal.Lev = audito.ErrLle + audito.FaFiMe + audito.FaFiPa; } return(Json(escVal, JsonRequestBehavior.AllowGet)); }
public ActionResult GetAuditorias(dates rango) { Audito audito = new Audito(); using (ApplicationDbContext db = new ApplicationDbContext()) { var lst = db.Auditorias.Where(c => c.FecAud >= rango.FecIni && c.FecAud <= rango.FecFin).ToList(); audito.AptErr = lst.Where(c => c.AptErr == true).Count(); audito.FalRes = lst.Where(c => c.FaFiMe == true).Count(); audito.ExaInc = lst.Where(c => c.ExaCom == true).Count(); audito.ConInc = lst.Where(c => c.Contro == true).Count(); audito.ErrDia = lst.Where(c => c.Diagno == true).Count(); audito.DatInc = lst.Where(c => c.DatInc == true).Count(); audito.ErrLle = lst.Where(c => c.ErrLle == true).Count(); audito.FaFiMe = lst.Where(c => c.FaFiMe == true).Count(); audito.FaFiPa = lst.Where(c => c.FaFiPa == true).Count(); } return(Json(audito, JsonRequestBehavior.AllowGet)); }