public removeAHome(PeopleCollection people, HomeCollection homes) { InitializeComponent(); peopleRM = people; homesRM = homes; Loaded += RemoveAHome_Loaded; Closing += RemoveAHome_Closing; }
public void RemoveHomeList() { using (var db = new HomeTrackerModel1()) { homesRM = new HomeCollection(db.Homes.ToList()); this.RemoveListBox.DisplayMemberPath = "Address"; this.RemoveListBox.SelectedValuePath = "HomeID"; this.RemoveListBox.ItemsSource = homesRM; } }
public UpdateHomes(PeopleCollection people, HomeCollection homes, HomeSalesCollection homeSales, RealEstateCompanyCollection realEstateCompanies) { InitializeComponent(); peopleUd = people; HomeUd = homes; homeSalesCollection = homeSales; IsVisibleChanged += UpdateHomes_IsVisibleChanged; Closing += UpdateHomes_Closing; }
private void CheckAgent_Checked(object sender, RoutedEventArgs e) { using (var db = new HomeTrackerModel1()) { homeCollection = new HomeCollection(db.Homes.ToList()); this.HomeListBox.DisplayMemberPath = "Address"; this.HomeListBox.SelectedValuePath = "HomeID"; this.HomeListBox.ItemsSource = homeCollection; } }
private void CheckBuyer_Checked(object sender, RoutedEventArgs e) { var listedJoinQuerey = from home in homeCollection join homeSale in homeSalesCollection on home.HomeID equals homeSale.HomeID where homeSale.SoldDate == null select home; listedHomes = new HomeCollection(listedJoinQuerey.ToList()); this.HomeListBox.DisplayMemberPath = "Address"; this.HomeListBox.SelectedValuePath = "HomeID"; this.HomeListBox.ItemsSource = listedHomes; }
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; }
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; } }
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); } }
public ObservableCollection(HomeCollection homeCollection) { this.homeCollection = homeCollection; }
public AddHome(PeopleCollection people, HomeCollection homes) { InitializeComponent(); peopleData = people; homeData = homes; }