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