コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
        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];
        }
コード例 #4
0
 public HomelessPage()
 {
     this.InitializeComponent();
     _homelesses = IslandCollection.GetInstance().GetHomelessList();
     _resources  = ResourceLoader.GetForCurrentView();
 }
コード例 #5
0
 public BusinessmanPage()
 {
     this.InitializeComponent();
     _resources       = ResourceLoader.GetForCurrentView();
     _businessmanList = IslandCollection.GetInstance().GetBusinessmanList();
 }