Exemple #1
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            categories = categoriesPresenter.getCategories();
            clients    = clientPresenter.getClients();
            cars       = carsPresenter.getCars();
            foreach (Category cat in categories)
            {
                //listBoxCategories.Items.Add(cat.getName());
            }

            carsNotOccupied = carsPresenter.getCarsOccupied(false);
            carsOccupied    = carsPresenter.getCarsOccupied(true);

            activeContracts = contractPresenter.getActiveContracts();
        }
Exemple #2
0
        /*public void showCategoriesToDelete()
         * {
         *  foreach (Category cat in MainForm.categories)
         *  {
         *      listBoxDeleteCategories.Items.Add(cat.getName());
         *  }
         * }*/

        private void AdminForm_Load(object sender, EventArgs e)
        {
            // TODO: данная строка кода позволяет загрузить данные в таблицу "carRentalDBDataSet.Cars". При необходимости она может быть перемещена или удалена.
            toolStripLabelAdminName.Text = $"Welcome, {AuthPresenter.activeUser.name} {AuthPresenter.activeUser.surname}";
            MainForm.categories          = categoryPresenter.getCategories();
            //showCategoriesToDelete();
            foreach (Category cat in MainForm.categories)
            {
                listBoxDeleteCategories.Items.Add(cat.getName());
                comboBoxAddCarcategory.Items.Add(cat.getName());
            }
            comboBoxAddCarcategory.SelectedIndex = 0;

            MainForm.cars = carsPresenter.getCars();
            foreach (Car car in MainForm.cars)
            {
                comboBoxDeleteCar.Items.Add($"{car.ID} {car.brand} {car.model} {car.yearOfProduction}");
            }
            comboBoxDeleteCar.SelectedIndex = 0;

            comboBoxAddCarFuelType.DataSource   = Enum.GetNames(typeof(FuelType));
            comboBoxAddCarFuelType.SelectedItem = FuelType.Petrol;
        }