private void FillRoomTypes() { foreach (GulliverLibrary.HotelContract hotelcontract in deal.HotelContracts) { ComboBoxItem comboBoxItem = new ComboBoxItem(); MySqlDataHandler.Expand expand = queryHandler.GetBuildingByCodes(hotelcontract.accomcode.Trim()); comboBoxItem.Text = (expand != null && expand.Building != null) ? expand.Building.Trim() : hotelcontract.codename.Trim(); comboBoxItem.Value = hotelcontract.recno; cmbRoomtype.Items.Add(comboBoxItem); } }
private void FillRooms() { if (deal.HotelContracts != null && deal.HotelContracts.Count > 0) { FillRoomTypes(); foreach (GulliverLibrary.HotelContract hotelContract in deal.HotelContracts.Where(h => (h.description != null && h.description != string.Empty) || (h.facilities != null && h.facilities != string.Empty))) { MySqlDataHandler.Expand expand = queryHandler.GetBuildingByCodes(hotelContract.accomcode.Trim()); gulliverIIDS.Room.AddRoomRow("Delete", hotelContract.recno, (expand != null && expand.Building != null)?(expand.Building.Trim() + " - " + hotelContract.accomcode.Trim()) :hotelContract.accomcode.Trim(), (hotelContract.description != null) ? hotelContract.description.Trim() : string.Empty, ((hotelContract.facilities != null) ? hotelContract.facilities.Trim() : string.Empty)); } } }