Esempio n. 1
0
        public FormAboutCurrentRepair(ClassDB db, string surnameEmployee, string date)
        {
            InitializeComponent();
            this.db = db;
            this.surnameEmployee = surnameEmployee;
            this.date            = date;

            dgvInfoCurrentRepairs.ColumnCount = 11;
            dgvInfoCurrentRepairs.Columns[0].HeaderCell.Value  = "ID работы";
            dgvInfoCurrentRepairs.Columns[1].HeaderCell.Value  = "Ремонтная работа";
            dgvInfoCurrentRepairs.Columns[2].HeaderCell.Value  = "Фамилия клиента";
            dgvInfoCurrentRepairs.Columns[3].HeaderCell.Value  = "Марка автомобиля";
            dgvInfoCurrentRepairs.Columns[4].HeaderCell.Value  = "Модель автомобиля";
            dgvInfoCurrentRepairs.Columns[5].HeaderCell.Value  = "Фамилия сотрудника";
            dgvInfoCurrentRepairs.Columns[6].HeaderCell.Value  = "Должность сотрудника";
            dgvInfoCurrentRepairs.Columns[7].HeaderCell.Value  = "Дата";
            dgvInfoCurrentRepairs.Columns[8].HeaderCell.Value  = "Время начала";
            dgvInfoCurrentRepairs.Columns[9].HeaderCell.Value  = "Время окончания";
            dgvInfoCurrentRepairs.Columns[10].HeaderCell.Value = "Статус";
            db.ShowInfoCurrentRepair(surnameEmployee, date, dgvInfoCurrentRepairs);

            if (dgvInfoCurrentRepairs.Rows.Count == 0)
            {
                toolStripBtDeleteRepair.Enabled = false;
            }
        }
        public FormWorkHours(ClassDB db)
        {
            InitializeComponent();

            this.db = db;

            RefreshTable();
        }
        private void btEnter_Click(object sender, EventArgs e)
        {
            if (tbIP.Text == "" || tbLogin.Text == "" || tbLoginDB.Text == "" || tbPass.Text == "" || tbPassDB.Text == "" || tbPort.Text == "")
            {
                MessageBox.Show("Неверно указаны данные для подключения к БД", "Ошибка");
                error = true;
            }
            else
            {
                db = new ClassDB(tbIP.Text, tbPort.Text, tbLoginDB.Text, tbPassDB.Text);
                try
                {
                    MySqlConnection testConnect = db.conn;
                    testConnect.Open();
                    testConnect.Close();
                    error = false;
                }
                catch
                {
                    MessageBox.Show("Неверно указаны данные для подключения к БД", "Ошибка");
                    error = true;
                }

                if (!error)
                {
                    Hide();
                    switch (tbLogin.Text)
                    {
                    case "admin":
                        if (tbPass.Text == "admin")
                        {
                            statusLogin = ADMIN;
                            FormMain fmAdmin = new FormMain(db, statusLogin);
                            fmAdmin.ShowDialog();
                        }
                        else
                        {
                            MessageBox.Show("Введены неверные данные", "Ошибка");
                        }
                        break;

                    case "user":
                        statusLogin = USER;
                        FormMain fmUser = new FormMain(db, statusLogin);

                        fmUser.ShowDialog();
                        break;

                    default:
                        MessageBox.Show("Введены неверные данные");
                        break;
                    }
                }
            }
        }
Esempio n. 4
0
 public FormPicWorkHours(ClassDB db)
 {
     InitializeComponent();
     this.db = db;
     dgvWorkHours.ColumnCount = 4;
     dgvWorkHours.Columns[0].HeaderCell.Value = "ID Смены";
     dgvWorkHours.Columns[1].HeaderCell.Value = "Дата";
     dgvWorkHours.Columns[2].HeaderCell.Value = "Фамилия сотрудника";
     dgvWorkHours.Columns[3].HeaderCell.Value = "Должность";
     db.SearchWorkHoursForPic(dgvWorkHours);
 }
Esempio n. 5
0
        public FormAboutCar(ClassDB db, string curRow)
        {
            InitializeComponent();

            this.db = db;

            dgvAboutCar.ColumnCount = 3;
            dgvAboutCar.Columns[0].HeaderCell.Value = "ID клиента";
            dgvAboutCar.Columns[1].HeaderCell.Value = "Модель";
            dgvAboutCar.Columns[2].HeaderCell.Value = "Марка";
            db.ShowInfoCar(dgvAboutCar, curRow);
        }
        public FormActions(ClassDB db)
        {
            InitializeComponent();

            this.db = db;

            dgvActions.ColumnCount = 3;
            dgvActions.Columns[0].HeaderCell.Value = "ID";
            dgvActions.Columns[1].HeaderCell.Value = "Название";
            dgvActions.Columns[2].HeaderCell.Value = "Текст";

            db.LoadTables("actions", dgvActions);
        }
Esempio n. 7
0
 public FormPicClient(ClassDB db)
 {
     InitializeComponent();
     this.db = db;
     dataGridView1.ColumnCount = 6;
     dataGridView1.Columns[0].HeaderCell.Value = "ID Клиента";
     dataGridView1.Columns[1].HeaderCell.Value = "Фамилия";
     dataGridView1.Columns[2].HeaderCell.Value = "Имя";
     dataGridView1.Columns[3].HeaderCell.Value = "Отчество";
     dataGridView1.Columns[4].HeaderCell.Value = "Мобильный телефон";
     dataGridView1.Columns[5].HeaderCell.Value = "Номер СТС машины";
     db.LoadTables("clients", dataGridView1);
 }
Esempio n. 8
0
        public FormCars(ClassDB db)
        {
            InitializeComponent();

            this.db = db;

            dgvCars.ColumnCount = 5;
            dgvCars.Columns[0].HeaderCell.Value = "СТС";
            dgvCars.Columns[1].HeaderCell.Value = "Марка";
            dgvCars.Columns[2].HeaderCell.Value = "Модель";
            dgvCars.Columns[3].HeaderCell.Value = "Год выпуска";
            dgvCars.Columns[4].HeaderCell.Value = "Дата последнего ТО";
            db.LoadTables("cars", dgvCars);
        }
Esempio n. 9
0
        public FormRepairs(ClassDB db)
        {
            InitializeComponent();

            this.db = db;

            dataGridView1.ColumnCount = 5;
            dataGridView1.Columns[0].HeaderCell.Value = "ID работы";
            dataGridView1.Columns[1].HeaderCell.Value = "Наименование";
            dataGridView1.Columns[2].HeaderCell.Value = "Категория";
            dataGridView1.Columns[3].HeaderCell.Value = "Цена";
            dataGridView1.Columns[4].HeaderCell.Value = "Должность";
            dataGridView1.AutoSizeColumnsMode         = DataGridViewAutoSizeColumnsMode.AllCells;
            db.LoadTables("repairs", dataGridView1);
        }
Esempio n. 10
0
        public FormAddClient(ClassDB db, string idClient, string surname, string name,
                             string patronimyc, string phone, string numSTS)
        {
            InitializeComponent();
            edit    = true;
            this.db = db;
            db.SearchSTSCars(cbNumSTS);

            this.idClient     = idClient;
            tbSurname.Text    = surname;
            tbName.Text       = name;
            tbPatronimyc.Text = patronimyc;
            tbPhone.Text      = phone;
            cbNumSTS.Text     = numSTS;
        }
Esempio n. 11
0
        public FormPicExtensionClients(ClassDB db)
        {
            this.db = db;

            InitializeComponent();
            dgvExtentionWorks.ColumnCount = 7;
            dgvExtentionWorks.Columns[0].HeaderCell.Value = "ID клиента";
            dgvExtentionWorks.Columns[1].HeaderCell.Value = "Фамилия";
            dgvExtentionWorks.Columns[2].HeaderCell.Value = "Имя";
            dgvExtentionWorks.Columns[3].HeaderCell.Value = "Номер телефона";
            dgvExtentionWorks.Columns[4].HeaderCell.Value = "Марка";
            dgvExtentionWorks.Columns[5].HeaderCell.Value = "Модель";
            dgvExtentionWorks.Columns[6].HeaderCell.Value = "Количество дней";

            db.SearchExtentionWorksForPic(dgvExtentionWorks);
        }
        public FormRequests(ClassDB db, TabControl tabControl)
        {
            InitializeComponent();

            this.db = db;

            this.tabControl = tabControl;

            dgvRequests.ColumnCount = 5;
            dgvRequests.Columns[0].HeaderCell.Value = "ID заявки";
            dgvRequests.Columns[1].HeaderCell.Value = "Категория";
            dgvRequests.Columns[2].HeaderCell.Value = "ID клиента";
            dgvRequests.Columns[3].HeaderCell.Value = "Описание";
            dgvRequests.Columns[4].HeaderCell.Value = "Статус обработки";
            db.LoadTables("requests", dgvRequests);
        }
Esempio n. 13
0
        public FormEmployees(ClassDB db)
        {
            InitializeComponent();

            this.db = db;

            dgvEmployees.ColumnCount = 7;
            dgvEmployees.Columns[0].HeaderCell.Value = "ID сотрудника";
            dgvEmployees.Columns[1].HeaderCell.Value = "Фамилия";
            dgvEmployees.Columns[2].HeaderCell.Value = "Имя";
            dgvEmployees.Columns[3].HeaderCell.Value = "Отчество";
            dgvEmployees.Columns[4].HeaderCell.Value = "Мобильный телефон";
            dgvEmployees.Columns[5].HeaderCell.Value = "Должность";
            dgvEmployees.Columns[6].HeaderCell.Value = "Соредняя оценка";
            db.LoadTables("employees", dgvEmployees);
        }
        public UserControlClientsToday(ClassDB db, TabPage tabPage)
        {
            InitializeComponent();

            this.db = db;

            this.tabPage = tabPage;

            timeStartRepair = DateTime.Now.ToString("HH:mm:ss");

            toolStripBtFinishRepair.Enabled = false;
            toolStripBtDeleteRepair.Enabled = false;

            for (int i = DateTime.Now.Year; i >= 1970; i--)
            {
                cbYearCreated.Items.Add(i);
            }
        }
        public FormMain(ClassDB db, int statusLogin)
        {
            InitializeComponent();

            toolStripBtDeleteClient.Enabled = false;
            toolStripBtSave.Enabled         = false;
            this.db = db;

            if (statusLogin == USER)
            {
                Text = "Система управления станцией технического обслуживания (Вы вошли как Штатный сотрудник)";
                списокСотрудниковToolStripMenuItem.Enabled = false;
                списокАкцийToolStripMenuItem.Enabled       = false;
                расписаниеToolStripMenuItem.Enabled        = false;
            }

            if (statusLogin == ADMIN)
            {
                Text = "Система управления станцией технического обслуживания (Вы вошли как Администратор)";
            }
        }
        //Для отложенных клиентов
        public UserControlClientsToday(ClassDB db, TabPage tabPage, List <int> idExtentionRepairs, int quantityDaysForExtensionWorks)
        {
            InitializeComponent();

            this.db      = db;
            this.tabPage = tabPage;

            timeStartRepair = DateTime.Now.ToString("HH:mm:ss");

            toolStripBtFinishRepair.Enabled = false;
            toolStripBtDeleteRepair.Enabled = false;

            for (int i = 0; i < idExtentionRepairs.Count; i++)
            {
                db.InfoExtensionRepairs(idExtentionRepairs[i], idCurrentRepairs, clbRepairs,
                                        lbEmployeesRepairs, lbRepairsCosts);
            }


            int totalCost = 0;

            for (int i = 0; i < lbRepairsCosts.Items.Count; i++)
            {
                totalCost += Convert.ToInt32(lbRepairsCosts.Items[i].ToString());
            }

            lbRepairsTotalCost.Text = "Итоговая\nстоимость:\n" + totalCost + " рублей";

            for (int i = DateTime.Now.Year; i >= 1970; i--)
            {
                cbYearCreated.Items.Add(i);
            }

            toolStripProgressBarStatusRepairs.Maximum = clbRepairs.Items.Count;
            toolStripProgressBarStatusRepairs.Value   = clbRepairs.CheckedItems.Count;
            toolStripStatusLabelInfoClient.Text       = "Всего дней работы: " + quantityDaysForExtensionWorks;
        }
Esempio n. 17
0
 public FormAddClient(ClassDB db)
 {
     InitializeComponent();
     this.db = db;
     db.SearchSTSCars(cbNumSTS);
 }