Ejemplo n.º 1
0
 public UpdateHomes(PeopleCollection people, HomeCollection homes, HomeSalesCollection homeSales,
     RealEstateCompanyCollection realEstateCompanies)
 {
     InitializeComponent();
     peopleUd = people;
     HomeUd = homes;
     homeSalesCollection = homeSales;
     IsVisibleChanged += UpdateHomes_IsVisibleChanged;
     Closing += UpdateHomes_Closing;
 }
Ejemplo n.º 2
0
        private void Button_Click_3(object sender, RoutedEventArgs e)//refresh db
        {
            using (HomeTrackerModel1 db = new HomeTrackerModel1())
            {
                //retrieve data:
                homeCollection                = new HomeCollection(db.Homes.ToList());
                homeSalesCollection           = new HomeSalesCollection(db.HomeSales.ToList());
                peopleCollection              = new PeopleCollection(db.People.ToList());
                realEstateCompaniesCollection = new RealEstateCompanyCollection(db.RealEstateCompanies.ToList());
            }

            HomeDataGrid.DataContext = homeCollection;
        }
Ejemplo n.º 3
0
        private void LoadHomesList()

        {
            using (var db = new HomeTrackerModel1())
            {
                homeCollection = new HomeCollection(db.Homes.ToList());
                this.HomeListBox.DisplayMemberPath = "Address";
                this.HomeListBox.SelectedValuePath = "HomeID";
                this.HomeListBox.ItemsSource = homeCollection;

                realEstateCompaniesCollection = new RealEstateCompanyCollection(db.RealEstateCompanies.ToList());
                this.CompanyListBox.DisplayMemberPath = "CompanyName";
                this.CompanyListBox.SelectedValuePath = "CompanyID";
                this.CompanyListBox.ItemsSource = realEstateCompaniesCollection;
            }
        }
Ejemplo n.º 4
0
 public MainWindow()
 {
     homeCollection                = new HomeCollection();
     homeSalesCollection           = new HomeSalesCollection();
     peopleCollection              = new PeopleCollection();
     realEstateCompaniesCollection = new RealEstateCompanyCollection();
     InitializeComponent();
     DataContext = this;
     using (HomeTrackerModel1 db = new HomeTrackerModel1())
     {
         //retrieve data:
         homeCollection                = new HomeCollection(db.Homes.ToList());
         homeSalesCollection           = new HomeSalesCollection(db.HomeSales.ToList());
         peopleCollection              = new PeopleCollection(db.People.ToList());
         realEstateCompaniesCollection = new RealEstateCompanyCollection(db.RealEstateCompanies.ToList());
         addHomeWindow     = new AddHome(peopleCollection, homeCollection);
         updateHomesWindow = new UpdateHomes(peopleCollection, homeCollection, homeSalesCollection, realEstateCompaniesCollection);
         removeAHomeWindow = new removeAHome(peopleCollection, homeCollection);
     }
 }