Beispiel #1
0
        private void InsertIntoListingsView(string client, int area, string street, string streetNo, int isComplex, string complexName, string complexNo, string bedrooms, string bathrooms, string garages, string plotSize, string houseSize, string value, string listPrice, int negotiable, int isSold, int hasPool, string desc)
        {
            this.Dispatcher.Invoke(() =>
            {
                CB_Client.SelectedIndex = CB_Client.Items.IndexOf(client);

                LocationManager locManager = new LocationManager();
                string areaFull            = locManager.AreaFullName(area);
                string province            = areaFull.Substring(0, areaFull.IndexOf(','));
                CB_Province.SelectedIndex  = CB_Province.Items.IndexOf(province);
                ClearCities();
                ChangeProvinceID();
                LoadCities();

                areaFull              = areaFull.Replace(province + ", ", "");
                string city           = areaFull.Substring(0, areaFull.IndexOf(','));
                CB_City.SelectedIndex = CB_City.Items.IndexOf(city);
                ClearAreas();
                ChangeCityID();
                LoadArea();

                areaFull                  = areaFull.Replace(city + ", ", "");
                string areaName           = areaFull.Substring(0, areaFull.Length);
                CB_Province.SelectedIndex = CB_Province.Items.IndexOf(province);
                CB_Area.SelectedIndex     = CB_Area.Items.IndexOf(areaName);
                currentAreaID             = area;

                TB_Streetname.Text = street;
                TB_Streetno.Text   = streetNo;

                if (isComplex != 0 && isComplex != -1)
                {
                    CB_Complex.IsChecked         = true;
                    SP_ComplexDetails.Visibility = System.Windows.Visibility.Visible;
                    TB_ComplexName.Text          = complexName;
                    TB_ComplexNo.Text            = complexNo;
                }

                TB_Bedrooms.Text    = bedrooms;
                TB_Bathrooms.Text   = bathrooms;
                TB_Garages.Text     = garages;
                TB_PlotSize.Text    = plotSize;
                TB_HouseSize.Text   = houseSize;
                TB_Price.Text       = value;
                TB_ListPrice.Text   = listPrice;
                TB_Description.Text = desc;

                if (negotiable == 1)
                {
                    CB_isNegotiable.IsChecked = true;
                }
                if (isSold == 1)
                {
                    CB_isSold.IsChecked = true;
                }
                if (hasPool == 1)
                {
                    CB_hasPool.IsChecked = true;
                }
            });
        }