public ViewResult Allocate(ClassroomAllocation classroomAllocation)
        {
            ClassroomAllocationViewModel viewModel = new ClassroomAllocationViewModel
            {
                Departments = DepartmentGateway.GetAllDepartments(),
                Days        = DayGateway.GetAllDays(),
                Rooms       = RoomGateway.GetAllRooms()
            };

            if (!ModelState.IsValid)
            {
                viewModel.ClassroomAllocation = classroomAllocation;
                ViewBag.Message = "Unsuccessful";
                return(View(viewModel));
            }


            int rowAffected = RoomGateway.AllocateRoom(classroomAllocation);

            if (rowAffected > 0)
            {
                ViewBag.Message = "Successful";
            }
            else
            {
                ViewBag.Message = "Not Saved";
            }

            return(View(viewModel));
        }
        // GET: Room/Allocate
        public ViewResult Allocate()
        {
            ClassroomAllocationViewModel viewModel = new ClassroomAllocationViewModel
            {
                Departments = DepartmentGateway.GetAllDepartments(),
                Days        = DayGateway.GetAllDays(),
                Rooms       = RoomGateway.GetAllRooms()
            };

            return(View(viewModel));
        }
Beispiel #3
0
        public async Task GetRooms()
        {
            var settings = TestHelper.GetSettings();


            var client = new FibaroClient(settings);

            var gw       = new RoomGateway(client);
            var entities = await gw.GetRooms();

            Assert.NotEmpty(entities);
        }
Beispiel #4
0
 public RoomManager()
 {
     roomGateway = new RoomGateway();
 }
Beispiel #5
0
        public List <Room> GetAllRooms()
        {
            RoomGateway roomGate = new RoomGateway();

            return(roomGate.GetAllRooms());
        }
        public ViewResult Schedules()
        {
            IEnumerable <ScheduleInfoViewModel> infos = RoomGateway.GetSchedule(1);

            return(View(infos));
        }