Example #1
0
        public ActionResult Report()
        {
            if (!base.IsAuthenticated)
            {
                return(RedirectToAction("Index", "Home"));
            }
            List <PotholeModel> model = potholeDAL.GetAllPotholes();

            return(View(model));
        }
Example #2
0
        public ActionResult Review(string option)
        {
            if (((User)Session["user"]) == null || ((User)Session["user"]).UserType.ToLower() != "e")
            {
                return(RedirectToAction("Index", "Home"));
            }

            List <PotholeModel> model = potholeDAL.GetAllPotholes();

            if (option == "uninspected")
            {
                model = potholeDAL.GetPotholesUninspected();
            }
            else if (option == "inspected")
            {
                model = potholeDAL.GetInspectedOnly();
            }
            else if (option == "inRepair")
            {
                model = potholeDAL.GetRepairsInProgress();
            }
            else if (option == "complete")
            {
                model = potholeDAL.GetRepairedPotholes();
            }

            return(View("Review", model));
        }
        public ActionResult DeletePothole(string id, int?page)
        {
            int pageSize  = 15;
            int pageIndex = 1;

            potholeDAL.DeletePothole(id);
            pageIndex = page.HasValue ? Convert.ToInt32(page) : 1;
            IPagedList <Pothole> pagedPotholes = null;
            List <Pothole>       potholeList   = potholeDAL.GetAllPotholes();

            pagedPotholes = potholeList.ToPagedList(pageIndex, pageSize);

            if (IsEmployee())
            {
                return(View("ViewPotholesForEmp", pagedPotholes));
            }
            else
            {
                return(View("ViewPotholes", pagedPotholes));
            }
        }
        public ActionResult Index()
        {
            List <PotholeModel> model = potholeDAL.GetAllPotholes();

            return(View("Index", model));
        }