Exemple #1
0
 public ActionResult DeletePothole(Pothole potholeDelete)
 {
     if (!Request.IsAuthenticated || User.IsInRole("citizen") || User.IsInRole("crew_member"))
     {
         return(RedirectToAction("Index"));
     }
     potholeDAL.DeletePothole(potholeDelete);
     return(RedirectToAction("AdminPotholeEdit"));
 }
        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));
            }
        }
Exemple #3
0
        public ActionResult Delete(int id)
        {
            potholeDAL.DeletePothole(id);

            return(RedirectToAction("Review", "Function"));
        }
Exemple #4
0
        public ActionResult Delete(int id)
        {
            potholeDAL.DeletePothole(id);

            return(RedirectToAction("Review", "Function", new { option = Session["option"].ToString() }));
        }