Esempio n. 1
0
        private void FormCreateOrder_Load(object sender, EventArgs e)
        {
            try
            {
                var list = _logicC.Read(null);
                if (list != null)
                {
                    comboBoxCar.DataSource    = list;
                    comboBoxCar.DisplayMember = "Model";
                    comboBoxCar.ValueMember   = "Id";
                    comboBoxCar.SelectedItem  = null;
                }
                var listClients = _logicP.Read(null);
                foreach (var client in listClients)
                {
                    comboBoxClient.DataSource    = listClients;
                    comboBoxClient.DisplayMember = "FirstName";
                    comboBoxClient.ValueMember   = "Id";
                    comboBoxClient.SelectedItem  = null;
                }
                var listE = _logicE.Read(null);
                if (listE != null)
                {
                    comboBoxEmployee.DataSource    = listE;
                    comboBoxEmployee.DisplayMember = "FirstName";
                    comboBoxEmployee.ValueMember   = "Id";
                    comboBoxEmployee.SelectedItem  = null;
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }