예제 #1
0
 // GET: Admin
 public ActionResult Index()
 {
     if (ManageCookie.isAdmin() == false)
     {
         return(RedirectToAction("Index", "Home"));
     }
     ViewBag.Title = "Admin Page";
     return(View());
 }
예제 #2
0
        public ActionResult Statistics()
        {
            ViewBag.Title = "Statistics";
            if (ManageCookie.isAdmin() == false)
            {
                return(RedirectToAction("Index", "Home"));
            }

            return(View());
        }
예제 #3
0
        public ActionResult updateEvent(FormCollection eventUpdate)
        {
            if (ManageCookie.isAdmin() == false)
            {
                return(RedirectToAction("Index", "Home"));
            }

            AdminModel.updateEventInput(eventUpdate);
            return(RedirectToAction("Events", "Admin"));
        }
예제 #4
0
        public ActionResult Places(FormCollection form)
        {
            if (ManageCookie.isAdmin() == false)
            {
                return(RedirectToAction("Index", "Home"));
            }
            ViewBag.Title = "Places Managments";

            ViewBag.PlacesList = AdminModel.filterPlaces(form);

            return(View());
        }
예제 #5
0
        public ActionResult Events()
        {
            if (ManageCookie.isAdmin() == false)
            {
                return(RedirectToAction("Index", "Home"));
            }
            ViewBag.Title = "Events Managments";

            ViewBag.EventsList = AdminModel.getEventsList();

            return(View());
        }
예제 #6
0
        public ActionResult EditPlace(FormCollection userUpdate)
        {
            if (ManageCookie.isAdmin() == false)
            {
                return(RedirectToAction("Index", "Home"));
            }
            ViewBag.Title = "Place Edit";

            bool isUpdate = AdminModel.updatePlaceInput(userUpdate);

            return(RedirectToAction("Places"));
        }
예제 #7
0
        public ActionResult EditUser(FormCollection userUpdate)
        {
            if (ManageCookie.isAdmin() == false)
            {
                return(RedirectToAction("Index", "Home"));
            }
            ViewBag.Title = "User Edit";

            bool updateStatus = AdminModel.updateUserInput(userUpdate);

            return(RedirectToAction("Users"));
        }
예제 #8
0
        public ActionResult Users()
        {
            if (ManageCookie.isAdmin() == false)
            {
                return(RedirectToAction("Index", "Home"));
            }
            ViewBag.Title = "Users Managments";

            //ViewBag.UserList = AdminModel.filterUsers(model);
            ViewBag.UserList = AdminModel.getUsersList();

            return(View());
        }
예제 #9
0
        public ActionResult EditEvent(int eventID)
        {
            if (ManageCookie.isAdmin() == false)
            {
                return(RedirectToAction("Index", "Home"));
            }
            ViewBag.Title = "Event Edit";

            //check event exist
            if (!SportEventModel.isEventExists(eventID))
            {
                return(RedirectToAction("Events"));
            }

            ViewBag.eventInfo      = AdminModel.getEventInfo(eventID);
            ViewBag.eventAttenides = AdminModel.getEventAttendies(eventID);
            return(View());
        }
예제 #10
0
        public ActionResult EditUser(int id)
        {
            if (ManageCookie.isAdmin() == false)
            {
                return(RedirectToAction("Index", "Home"));
            }
            ViewBag.Title = "User Edit";

            //check event exist
            if (!AccountModel.isUserExists(id))
            {
                return(RedirectToAction("Users"));
            }

            ViewBag.userInfo = AdminModel.getUserInfo(id);

            return(View());
        }
예제 #11
0
        public ActionResult EditPlace(int id)
        {
            if (ManageCookie.isAdmin() == false)
            {
                return(RedirectToAction("Index", "Home"));
            }
            ViewBag.Title = "Place Edit";

            //check event exist
            if (!PlacesModel.isPlaceExists(id))
            {
                return(RedirectToAction("Places"));
            }

            ViewBag.placeInfo = AdminModel.getPlaceInfo(id);

            return(View());
        }