Esempio n. 1
0
        public ActionResult Dashboard()
        {
            //so i m gonna add a fashboard having some stats
            //nb of claims
            //nb of high priority claims
            //nb of treated claims

            List <Reclamation> reclams = null;
            var task = Task.Run(async() => await serviceReclamation.FindAll());

            reclams          = task.Result;
            ViewBag.nbclaims = reclams.Count();
            ViewBag.nbhigh   = reclams.Where(x => x.priority == Priority.high).Count();
            ViewBag.treated  = reclams.Where(w => w.state == true).Count();


            return(View());
        }
Esempio n. 2
0
        // GET: Subscript
        public ActionResult Index(string search)
        {
            List <Reclamation> reclams = null;

            if (string.IsNullOrEmpty(search))
            {
                //all reclams
                var task = Task.Run(async() => await serviceReclamation.FindAll());

                reclams = task.Result;
            }
            else
            {
                var task = Task.Run(async() => await serviceReclamation.filter(search));
                reclams = task.Result;
            }



            return(View(reclams));
        }