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)); }
public DayManager() { dayGateway = new DayGateway(); }
public List <Day> GetAllDays() { DayGateway dayGate = new DayGateway(); return(dayGate.GetAllDays()); }