public List <SelectListItem> GetRoomForDropdown() { List <SelectListItem> selectListItems = new List <SelectListItem>(); selectListItems.Add(new SelectListItem() { Text = "--Select--", Value = "" }); List <Room> GetAllRoom = allocateClassRoomGateway.GetAllRooms(); foreach (Room aroom in GetAllRoom) { SelectListItem selectList = new SelectListItem(); selectList.Text = aroom.RoomName; selectList.Value = aroom.RoomID.ToString(); selectListItems.Add(selectList); } return(selectListItems); }
public List <Room> GetAllRooms() { return(allocateClassRoomGateway.GetAllRooms()); }