private void GetAllHotels() { HotelsData hotelsData = new HotelsData(); hotelsList = hotelsData.GetAllHotels(); foreach (var item in hotelsList) { comboBoxHotelName.Items.Add(item); } }
private void Save_Click(object sender, RoutedEventArgs e) { HotelsData hotelsData = new HotelsData(); int.TryParse(textBoxTankCount.Text, out int count); int.TryParse(textBoxTankSize.Text, out int size); Hotels.Models.Hotel hotel = new Models.Hotel() { Name = textBoxName.Text, TanksCount = count, TankSize = size, Mobile = textBoxMobile.Text, Address = textBoxAdress.Text }; hotelsData.AddHotel(hotel); MessageBox.Show("تم الحفظ"); }