Ejemplo n.º 1
0
        public void InitializeCollections()
        {
            customersComboBox.DisplayMember = "dni";
            customersComboBox.ValueMember   = "dni";
            customersComboBox.DataSource    = businesscontrol.findAllCustomers();
            customersComboBox.SelectedIndex = -1;

            pickUpOfficeComboBox.DisplayMember = "address";
            pickUpOfficeComboBox.ValueMember   = "Id";
            pickUpOfficeComboBox.DataSource    = businesscontrol.findAllBranchOffices();
            pickUpOfficeComboBox.SelectedIndex = -1;

            returnOfficeComboBox.DisplayMember = "address";
            returnOfficeComboBox.ValueMember   = "Id";
            returnOfficeComboBox.DataSource    = businesscontrol.findAllBranchOffices();
            returnOfficeComboBox.SelectedIndex = -1;

            categoryComboBox.DisplayMember = "name";
            categoryComboBox.ValueMember   = "Id";
            categoryComboBox.DataSource    = businesscontrol.findAllCategories();
            categoryComboBox.SelectedIndex = -1;


            driversListCheckBox.Items.Clear();
            ICollection <Person> persons = businesscontrol.findAllPersons();

            if (persons != null)
            {
                foreach (Person p in persons)
                {
                    driversListCheckBox.Items.Add(p.dni);
                }
            }
        }