예제 #1
0
        public ActionResult AddRooms()
        {
            InfrastructureHelper helper = new InfrastructureHelper();

            ViewBag.hostelBlocks = new SelectList(helper.GetHostelBlocks(), "blockNumber", "blockNumber");
            ViewBag.roomTypes    = new SelectList(helper.GetRoomTypes(), "id", "val");

            return(View());
        }
예제 #2
0
        public ActionResult AddRooms(Room userInput)
        {
            InfrastructureHelper helper = new InfrastructureHelper();

            ViewBag.hostelBlocks = new SelectList(helper.GetHostelBlocks(), "blockNumber", "blockNumber");
            ViewBag.roomTypes    = new SelectList(helper.GetRoomTypes(), "id", "val");

            if (!ModelState.IsValid)
            {
                return(View(userInput));
            }

            helper.AddRoom(userInput);

            return(View());
        }