public AddRealty() { InitializeComponent(); realtorsDataSet = ((PracticApp.RealtorsDataSet)(this.FindResource("realtorsDataSet"))); // Загрузить данные в таблицу Realty. Можно изменить этот код как требуется. realtorsDataSetRealtyTableAdapter = new PracticApp.RealtorsDataSetTableAdapters.RealtyTableAdapter(); realtorsDataSetRealtyTableAdapter.Fill(realtorsDataSet.Realty); realtyViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("realtyViewSource"))); realtyViewSource.View.MoveCurrentToFirst(); // Загрузить данные в таблицу RealtyAddresses. Можно изменить этот код как требуется. realtorsDataSetRealtyAddressesTableAdapter = new PracticApp.RealtorsDataSetTableAdapters.RealtyAddressesTableAdapter(); realtorsDataSetRealtyAddressesTableAdapter.Fill(realtorsDataSet.RealtyAddresses); realtyRealtyAddressesViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("realtyRealtyAddressesViewSource"))); realtyRealtyAddressesViewSource.View.MoveCurrentToFirst(); }
public DatabaseRouter(string type) { this.type = type; switch (type) { case "Clients": this.ClientsTableAdapter = new RealtorsDataSetTableAdapters.ClientsTableAdapter(); break; case "Realty": this.RealtyTableAdapter = new RealtorsDataSetTableAdapters.RealtyTableAdapter(); this.RealtyAddressesTableAdapter = new RealtorsDataSetTableAdapters.RealtyAddressesTableAdapter(); this.ApartmentTableAdapter = new RealtorsDataSetTableAdapters.ApartmentTableAdapter(); this.HouseTableAdapter = new RealtorsDataSetTableAdapters.HouseTableAdapter(); this.LandTableAdapter = new RealtorsDataSetTableAdapters.LandTableAdapter(); this.RealtyTypesTableAdapter = new RealtorsDataSetTableAdapters.RealtyTypesTableAdapter(); break; case "Offer": this.OfferTableAdapter = new RealtorsDataSetTableAdapters.OfferTableAdapter(); break; case "Demand": this.ApartmentFilterTableAdapter = new RealtorsDataSetTableAdapters.ApartmentFilterTableAdapter(); this.HouseFilterTableAdapter = new RealtorsDataSetTableAdapters.HouseFilterTableAdapter(); this.LandFilterTableAdapter = new RealtorsDataSetTableAdapters.LandFilterTableAdapter(); this.DemandTableAdapter = new RealtorsDataSetTableAdapters.DemandTableAdapter(); break; case "Deal": this.RealtyTableAdapter = new RealtorsDataSetTableAdapters.RealtyTableAdapter(); this.RealtyAddressesTableAdapter = new RealtorsDataSetTableAdapters.RealtyAddressesTableAdapter(); this.ApartmentTableAdapter = new RealtorsDataSetTableAdapters.ApartmentTableAdapter(); this.HouseTableAdapter = new RealtorsDataSetTableAdapters.HouseTableAdapter(); this.LandTableAdapter = new RealtorsDataSetTableAdapters.LandTableAdapter(); this.RealtyTypesTableAdapter = new RealtorsDataSetTableAdapters.RealtyTypesTableAdapter(); this.DealTableAdapter = new RealtorsDataSetTableAdapters.DealTableAdapter(); this.DemandTableAdapter = new RealtorsDataSetTableAdapters.DemandTableAdapter(); this.OfferTableAdapter = new RealtorsDataSetTableAdapters.OfferTableAdapter(); break; } }
private void Window_Loaded(object sender, RoutedEventArgs e) { PracticApp.RealtorsDataSet realtorsDataSet = ((PracticApp.RealtorsDataSet)(this.FindResource("realtorsDataSet"))); // Загрузить данные в таблицу Clients. Можно изменить этот код как требуется. PracticApp.RealtorsDataSetTableAdapters.ClientsTableAdapter realtorsDataSetClientsTableAdapter = new PracticApp.RealtorsDataSetTableAdapters.ClientsTableAdapter(); realtorsDataSetClientsTableAdapter.Fill(realtorsDataSet.Clients); System.Windows.Data.CollectionViewSource clientsViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("clientsViewSource"))); clientsViewSource.View.MoveCurrentToFirst(); // Загрузить данные в таблицу Offer. Можно изменить этот код как требуется. PracticApp.RealtorsDataSetTableAdapters.OfferTableAdapter realtorsDataSetOfferTableAdapter = new PracticApp.RealtorsDataSetTableAdapters.OfferTableAdapter(); realtorsDataSetOfferTableAdapter.Fill(realtorsDataSet.Offer); System.Windows.Data.CollectionViewSource offerViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("offerViewSource"))); offerViewSource.View.MoveCurrentToFirst(); // Загрузить данные в таблицу Realtors. Можно изменить этот код как требуется. PracticApp.RealtorsDataSetTableAdapters.RealtorsTableAdapter realtorsDataSetRealtorsTableAdapter = new PracticApp.RealtorsDataSetTableAdapters.RealtorsTableAdapter(); realtorsDataSetRealtorsTableAdapter.Fill(realtorsDataSet.Realtors); System.Windows.Data.CollectionViewSource realtorsViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("realtorsViewSource"))); realtorsViewSource.View.MoveCurrentToFirst(); // Загрузить данные в таблицу Realty. Можно изменить этот код как требуется. PracticApp.RealtorsDataSetTableAdapters.RealtyTableAdapter realtorsDataSetRealtyTableAdapter = new PracticApp.RealtorsDataSetTableAdapters.RealtyTableAdapter(); realtorsDataSetRealtyTableAdapter.Fill(realtorsDataSet.Realty); System.Windows.Data.CollectionViewSource realtyViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("realtyViewSource"))); realtyViewSource.View.MoveCurrentToFirst(); }