private void initBaseData()
        {
            userNameLabel.Text = dataFormDTO.userData.username;

            carViewController = new CarViewController();

            modelDTO = new ModelDTO();

            crud = new ModelCrud(dataFormDTO.db);

            comboBoxData = new ComboBoxDataInit(dataFormDTO.db);

            comboBoxData.addCompanies(cbCompany);
            comboBoxData.addCarTypes(cbType);
            comboBoxData.addColours(cbColour);
            comboBoxData.addCarModels(cbModel);

            comboBoxData.addCarEngines(cbEngine);

            comboBoxData.addCarEngineTypes(cbEngineType);
            comboBoxData.addCarTransmissoins(cbTransmission);

            cbAutoTrans.Items.AddRange(new string[] { "нет", "да" });
            cbAutoTrans.SelectedIndex = 0;
        }
Example #2
0
        private void initData()
        {
            carViewController = new CarViewController();
            carFilter         = new CarFilter();

            basket = new ShopBasket();

            carFormOperDTO = new CarOperationDTO();

            crud = new CarCrud(dataFormDTO.db);

            ComboBoxDataInit comboBoxData = new ComboBoxDataInit(dataFormDTO.db);

            comboBoxData.addCompanies(cbCarCompany);
            comboBoxData.addColours(cbCarColours);
            comboBoxData.addCarTypes(cbCarTypes);

            List <ViewCar> cars = dataFormDTO.db.ViewCars.Where(o => o.ordered.Equals("n")).ToList();

            dataGridView1.DataSource = cars;
        }