예제 #1
0
 public FrmMain()
 {
     InitializeComponent();
     drivers       = new ListDrivers();
     canDrivers    = new ListDrivers();
     notCanDrivers = new ListDrivers();
     for (int i = 1; i <= 3; i++)//немного не правильно
     {
         cmbSort.Items.Add(HelperEnum.GetEnumDescription((ModDrive)i));
     }
     cmbSort.SelectedIndex = 0;
     cmbSort.DropDownStyle = ComboBoxStyle.DropDownList;
 }
예제 #2
0
 public AddOrChange()
 {
     InitializeComponent();
     Own = new CarOwner();
     for (int i = 1; i < 5; i++)
     {
         cmbTypeCar.Items.Add(HelperEnum.GetEnumDescription((TypeCar)i));
         cmbTypeLincence.Items.Add(HelperEnum.GetEnumDescription((TypeCar)i));
     }
     cmbTypeCar.SelectedIndex      = 0;
     cmbTypeLincence.SelectedIndex = 0;
     cmbTypeCar.DropDownStyle      = ComboBoxStyle.DropDownList;
     cmbTypeLincence.DropDownStyle = ComboBoxStyle.DropDownList;
 }
예제 #3
0
        public AddOrChange(CarOwner car)
        {
            InitializeComponent();
            Own = car;
            //отобразить на форме
            txbFIO.Text = Own.FullName;
            //cmbTypeLincence.SelectedItem = Own.TypeLicense;
            txbModelCar.Text = Own.ModelCar;              //

            txbNumCar.Text    = Own.CarNumber.ToString(); //
            txbDateLince.Text = Own.CarDate.ToString();
            for (int i = 1; i < 5; i++)
            {
                cmbTypeCar.Items.Add(HelperEnum.GetEnumDescription((TypeCar)i));
                cmbTypeLincence.Items.Add(HelperEnum.GetEnumDescription((TypeCar)i));
            }
            cmbTypeLincence.SelectedIndex = (int)Own.TypeLicense - 1;
            cmbTypeCar.SelectedIndex      = (int)Own.TypeCar - 1;
            cmbTypeCar.DropDownStyle      = ComboBoxStyle.DropDownList;
            cmbTypeLincence.DropDownStyle = ComboBoxStyle.DropDownList;
        }