Exemplo n.º 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));
            }
        }
Exemplo n.º 3
0
        public ActionResult Delete(int id)
        {
            potholeDAL.DeletePothole(id);

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

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