public OrganizationListPage()
        {
            InitializeComponent();
            OrganizationService service = new OrganizationService();
            List<tbl_organization> listOrganization = service.getOrganizationList();
            this.Organizations = new ObservableCollection<Organization>();
            foreach (tbl_organization organization in listOrganization)
            {

                ConnectionStringManager.updateConnectionStrings(organization.ID.ToString());

                DrCarDriveService drCarService = new DrCarDriveService();
                List<Car> listCar = drCarService.getDrCarList();

                this.Organizations.Add(new Organization() { Id = organization.ID, Name = organization.ORGANIZATION_NAME, Cars = listCar });

            }

            foreach (Organization org in this.Organizations)
                foreach (Car car in org.Cars)
                    car.SetValue(ItemHelper.ParentProperty, org);
        }
Exemple #2
0
        private void populateOrganizationList()
        {
            try
            {
                OrganizationService service = new OrganizationService();
                List<tbl_organization> listOrganization = service.getOrganizationList();
                this.Organizations = new ObservableCollection<Organization>();
                foreach (tbl_organization organization in listOrganization)
                {

                    ConnectionStringManager.updateConnectionStrings(organization.ID.ToString());

                    DrCarDriveService drCarService = new DrCarDriveService();
                    List<Car> listCar = drCarService.getDrCarList();

                    this.Organizations.Add(new Organization() { Id = organization.ID, Name = organization.ORGANIZATION_NAME, Cars = listCar });

                }

                foreach (Organization org in this.Organizations)
                {
                    foreach (Car car in org.Cars)
                    {
                        car.SetValue(ItemHelper.ParentProperty, org);
                    }
                }

                Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
                var settings = config.AppSettings.Settings;
                txtSavePath.Text = settings["FileSavePath"].Value;
            }
            catch (Exception ex)
            {
                System.Windows.MessageBox.Show(ex.Message);
            }
        }