public static void FillIslandCollection() { IslandCollection islandCollection = IslandCollection.GetInstance(); using (SqlConnection connection = new SqlConnection(CONNECTION_STRING)) { connection.Open(); SqlCommand cmd = connection.CreateCommand(); FillHomelessCollection(islandCollection, cmd); FillHouseCollection(islandCollection, cmd); FillBusinessmanCollection(islandCollection, cmd); } }
public static void UpdateArea(int houseId, double area) { IslandCollection islandCollection = IslandCollection.GetInstance(); using (SqlConnection connection = new SqlConnection(CONNECTION_STRING)) { connection.Open(); SqlCommand cmd = connection.CreateCommand(); cmd.CommandText = string.Format(QueryCollection.UPDATE_HOUSE_AREA, area, houseId); cmd.ExecuteNonQuery(); islandCollection.GetHouseList().Clear(); FillHouseCollection(islandCollection, cmd); } }
private void OnHouseBoxLoaded(object sender, RoutedEventArgs e) { ObservableCollection <House> houseList = IslandCollection.GetInstance().GetHouseList(); List <ComboBoxItem> comboBoxItems = new List <ComboBoxItem>(); foreach (House house in houseList) { comboBoxItems.Add(new ComboBoxItem { Content = house.Adress }); } _houseBox.ItemsSource = comboBoxItems; _houseBox.SelectedItem = comboBoxItems[0]; }
public HomelessPage() { this.InitializeComponent(); _homelesses = IslandCollection.GetInstance().GetHomelessList(); _resources = ResourceLoader.GetForCurrentView(); }
public BusinessmanPage() { this.InitializeComponent(); _resources = ResourceLoader.GetForCurrentView(); _businessmanList = IslandCollection.GetInstance().GetBusinessmanList(); }