示例#1
0
 public String DeletePoi(List <int> PoisToDelete, int vanaf, int desc, int filter)
 {
     if (!User.IsInRole("SuperAdministrator") && !User.IsInRole("Administrator"))
     {
         return("fail");
     }
     foreach (int poi in PoisToDelete)
     {
         Poi a = bs.GetPoiByIdAdmin(poi);
         if (a == null)
         {
             return("fail");
         }
         bs.DeletePoiSoft(a);
     }
     return("ok");
 }
示例#2
0
        public ActionResult DeletePoi(int?Id)
        {
            if (!Id.HasValue)
            {
                return(RedirectToAction("Index"));
            }
            Poi poi = bs.GetPoiById((int)Id);

            if (poi == null)
            {
                return(RedirectToAction("Index"));
            }
            if (poi.EigenaarId != bs.GetUser(User.Identity.Name).Id)
            {
                return(RedirectToAction("Index"));
            }

            bs.DeletePoiSoft(poi);

            return(RedirectToAction("Index"));
        }