Ejemplo n.º 1
0
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            var cRepo = new CandidatesRepository(Properties.Settings.Default.Constr);

            filterContext.Controller.ViewBag.PendingCount   = cRepo.GetCount(Status.Pending);
            filterContext.Controller.ViewBag.ConfirmedCount = cRepo.GetCount(Status.Confirmed);
            filterContext.Controller.ViewBag.RefusedCount   = cRepo.GetCount(Status.Refused);
            base.OnActionExecuting(filterContext);
        }
Ejemplo n.º 2
0
        public ActionResult UpdateStatus(int id, CandidateStatus status)
        {
            var repo = new CandidatesRepository(Properties.Settings.Default.ConStr);

            repo.ChangeStatus(id, status);
            return(Json(new { pending = repo.GetCount(CandidateStatus.Pending),
                              accepted = repo.GetCount(CandidateStatus.Accepted),
                              rejected = repo.GetCount(CandidateStatus.Rejected) }));
        }
Ejemplo n.º 3
0
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            var repo = new CandidatesRepository(Properties.Settings.Default.ConStr);

            filterContext.Controller.ViewBag.Pending  = repo.GetCount(CandidateStatus.Pending);
            filterContext.Controller.ViewBag.Accepted = repo.GetCount(CandidateStatus.Accepted);
            filterContext.Controller.ViewBag.Rejected = repo.GetCount(CandidateStatus.Rejected);
            base.OnActionExecuting(filterContext);
        }
Ejemplo n.º 4
0
        public ActionResult GetCounts()
        {
            var cRepo  = new CandidatesRepository(Properties.Settings.Default.Constr);
            var counts = new Counts
            {
                Pending   = cRepo.GetCount(Status.Pending),
                Confirmed = cRepo.GetCount(Status.Confirmed),
                Refused   = cRepo.GetCount(Status.Refused)
            };

            return(Json(counts, JsonRequestBehavior.AllowGet));
        }