コード例 #1
0
 public ActionResult DeleteHall(Hall hall)
 {
     if (_hallManager.RemoveHall(hall))
     {
         //Successful
         TempData["notification"] = hall.Name.RemoveMessage("Hall");
         return(RedirectToAction("Index"));
     }
     else
     {
         //Error
         TempData["notification"] = hall.Name.ErrorRemoveMessage("Hall");
         return(RedirectToAction("Index"));
     }
 }
コード例 #2
0
        public HallErrorCodes RemoveHall(int hallID)
        {
            var hall = hallManager.GetHall(hallID);

            if (hall == null)
            {
                return(HallErrorCodes.NoSuchHall);
            }
            else
            {
                if (hall.Shelves.Count > 0)
                {
                    return(HallErrorCodes.ThereAreShelvesInThisHall);
                }
                else
                {
                    hallManager.RemoveHall(hall);
                    return(HallErrorCodes.ok);
                }
            }
        }