public int CompareTo(RoomServer other) { if (RoomCount == other.RoomCount) { return(Id.CompareTo(other.Id)); } return(RoomCount.CompareTo(other.RoomCount)); }
// GET: Rooms public async Task <IActionResult> Index(string searchString) { List <Room> myRooms = await _room.GetRooms(searchString); var rooms = new RoomCount() { Rooms = myRooms, Count = myRooms.Count() }; return(View(rooms)); }
public RoomCount CreateRoomCount(Hotel hotel, Parameters parameters) { var roomCount = new RoomCount { HotelID = hotel.HotelID, HotelName = hotel.HotelName, HotelAddress = hotel.HotelAddress, HotelCity = hotel.City.CityName, HotelRegion = hotel.City.Region.RegionName, HotelCountry = hotel.City.Region.Country.CountryName, StandardRate = (hotel.RoomTypes.ElementAt(0)).StandardRate, FreeRoomCount = CountRooms((hotel.RoomTypes.ElementAt(0)).RoomTypeID, parameters) }; return(roomCount); }