Esempio n. 1
0
        private void RouteFill()
        {
            DBTables dBTables = new DBTables();
            Action   action   = () =>
            {
                try
                {
                    dBTables.DTRoute.Clear();
                    dBTables.DTRouteFill();
                    dBTables.dependency.OnChange += ChangeRoute;

                    dgvRoute.DataSource             = dBTables.DTRoute;
                    dgvRoute.Columns[0].Visible     = false;
                    dgvRoute.Columns[1].HeaderText  = "Номер маршрута";
                    dgvRoute.Columns[2].HeaderText  = "Станция назначения";
                    dgvRoute.Columns[3].HeaderText  = "Время прибытия";
                    dgvRoute.Columns[4].HeaderText  = "Время отправления";
                    dgvRoute.Columns[5].Visible     = false;
                    dgvRoute.Columns[6].HeaderText  = "Поезд";
                    dgvRoute.Columns[7].Visible     = false;
                    dgvRoute.Columns[8].Visible     = false;
                    dgvRoute.Columns[9].Width       = 200;
                    dgvRoute.Columns[9].HeaderText  = "Машинист";
                    dgvRoute.Columns[10].HeaderText = "Цена";
                    dgvRoute.ClearSelection();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            };

            Invoke(action);
        }
Esempio n. 2
0
        private void UsersFill()
        {
            DBTables dbTables = new DBTables();
            Action   action   = () =>
            {
                try
                {
                    dbTables.DTUsers.Clear();
                    dbTables.DTUsersFill();
                    dbTables.dependency.OnChange += ChangeUser;

                    dgvUsers.DataSource            = dbTables.DTUsers;
                    dgvUsers.Columns[0].HeaderText = "Фамилия пользователя";
                    dgvUsers.Columns[1].HeaderText = "Имя пользователя";
                    dgvUsers.Columns[2].HeaderText = "Отчество пользователя";
                    dgvUsers.Columns[3].HeaderText = "Логин";
                    dgvUsers.Columns[4].HeaderText = "Пароль";
                    dgvUsers.Columns[5].HeaderText = "Роль";
                    dgvUsers.ClearSelection();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            };

            Invoke(action);
        }
Esempio n. 3
0
        private void TrainsFill()
        {
            DBTables dbTables = new DBTables();
            Action   action   = () =>
            {
                try
                {
                    dbTables.DTTrain.Clear();
                    dbTables.DTTrainFill();
                    dbTables.dependency.OnChange += ChangeTrain;

                    dgvTrains.DataSource            = dbTables.DTTrain;
                    dgvTrains.Columns[0].Visible    = false;
                    dgvTrains.Columns[1].HeaderText = "Номер поезда";
                    dgvTrains.Columns[2].HeaderText = "Количество вагонов в составе";
                    dgvTrains.Columns[3].Visible    = false;
                    dgvTrains.Columns[4].HeaderText = "Машинист";
                    dgvTrains.Columns[4].Width      = 230;
                    dgvTrains.ClearSelection();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            };

            Invoke(action);
        }
Esempio n. 4
0
        private void TicketFill()
        {
            DBTables dbTables = new DBTables();
            Action   action   = () =>
            {
                try
                {
                    dbTables.DTTicket.Clear();
                    dbTables.DTTicketFill();
                    dbTables.dependency.OnChange += ChangeTicket;

                    dgvTickets.DataSource             = dbTables.DTTicket;
                    dgvTickets.Columns[0].Visible     = false;
                    dgvTickets.Columns[1].HeaderText  = "Номер билета";
                    dgvTickets.Columns[2].HeaderText  = "Время оформления";
                    dgvTickets.Columns[3].HeaderText  = "Вермя отправления";
                    dgvTickets.Columns[4].HeaderText  = "Дата отправления";
                    dgvTickets.Columns[5].HeaderText  = "Стоимость";
                    dgvTickets.Columns[6].HeaderText  = "Место";
                    dgvTickets.Columns[7].Visible     = false;
                    dgvTickets.Columns[8].HeaderText  = "Статус места";
                    dgvTickets.Columns[9].Visible     = false;
                    dgvTickets.Columns[10].HeaderText = "Пассажир";
                    dgvTickets.Columns[11].Visible    = false;
                    dgvTickets.Columns[12].HeaderText = "Маршрут";
                    dgvTickets.Columns[13].Visible    = false;
                    dgvTickets.Columns[14].HeaderText = "Кассир";
                    dgvTickets.ClearSelection();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            };

            Invoke(action);
        }
Esempio n. 5
0
        private void RoleFill()
        {
            DBTables dbTables = new DBTables();
            Action   action   = () =>
            {
                try
                {
                    dbTables.DTRoles.Clear();
                    dbTables.DTRolesForComboBoxFill();
                    dbTables.dependency.OnChange += ChangeRole;

                    cbRole.DataSource    = dbTables.DTRoles;
                    cbRole.ValueMember   = "ID_role";
                    cbRole.DisplayMember = "role_name";
                    cbRole.SelectedValue = -1;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            };

            Invoke(action);
        }
Esempio n. 6
0
        private void PlaceStatusFill()
        {
            DBTables dbTables = new DBTables();
            Action   action   = () =>
            {
                try
                {
                    dbTables.DTPlaceStatus.Clear();
                    dbTables.DTPlaceStatusForCB();
                    dbTables.dependency.OnChange += ChangePlaceStatus;

                    cbPlaceStatus.DataSource    = dbTables.DTPlaceStatus;
                    cbPlaceStatus.ValueMember   = "ID_place_status";
                    cbPlaceStatus.DisplayMember = "name_status";
                    cbPlaceStatus.SelectedValue = -1;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            };

            Invoke(action);
        }
Esempio n. 7
0
        private void EmployeeFill()
        {
            DBTables dbTables = new DBTables();
            Action   action   = () =>
            {
                try
                {
                    dbTables.DTEmployee.Clear();
                    dbTables.DTTrainDriverFill();
                    dbTables.dependency.OnChange += ChangeEmployee;

                    cbTrainDriver.DataSource    = dbTables.DTEmployee;
                    cbTrainDriver.ValueMember   = "ID_employee";
                    cbTrainDriver.DisplayMember = "Name_Driver";
                    cbTrainDriver.SelectedValue = -1;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            };

            Invoke(action);
        }
Esempio n. 8
0
        private void TrainFill()
        {
            DBTables dBTables = new DBTables();
            Action   action   = () =>
            {
                try
                {
                    dBTables.DTTrain.Clear();
                    dBTables.DTTrainForComboBoxFill();
                    dBTables.dependency.OnChange += ChangeTrain;

                    cbTrain.DataSource    = dBTables.DTTrain;
                    cbTrain.ValueMember   = "ID_train";
                    cbTrain.DisplayMember = "num_train";
                    cbTrain.SelectedValue = -1;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            };

            Invoke(action);
        }
Esempio n. 9
0
        private void DoljFill()
        {
            DBTables dbTables = new DBTables();
            Action   action   = () =>
            {
                try
                {
                    dbTables.DTDolj.Clear();
                    dbTables.DTDoljForComboBoxFill();
                    dbTables.dependency.OnChange += ChangeDolj;

                    cbDolj.DataSource    = dbTables.DTDolj;
                    cbDolj.ValueMember   = "ID_dolj";
                    cbDolj.DisplayMember = "dolj_name";
                    cbDolj.SelectedValue = -1;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            };

            Invoke(action);
        }
Esempio n. 10
0
        private void EmployeesFill()
        {
            DBTables dbTables = new DBTables();
            Action   action   = () =>
            {
                try
                {
                    dbTables.DTEmployee.Clear();
                    dbTables.DTEmployeeFill();
                    dbTables.dependency.OnChange += ChangeEmployees;

                    dgvEmployees.DataSource             = dbTables.DTEmployee;
                    dgvEmployees.Columns[0].Visible     = false;
                    dgvEmployees.Columns[1].HeaderText  = "Фамилия сотрудника";
                    dgvEmployees.Columns[2].HeaderText  = "Имя  сотрудника";
                    dgvEmployees.Columns[3].HeaderText  = "Отчество сотрудника";
                    dgvEmployees.Columns[4].HeaderText  = "Дата рождения";
                    dgvEmployees.Columns[5].HeaderText  = "Номер аттестата";
                    dgvEmployees.Columns[6].HeaderText  = "Название учебного заведения";
                    dgvEmployees.Columns[6].Width       = 300;
                    dgvEmployees.Columns[7].HeaderText  = "Дата окончания уч. заведения";
                    dgvEmployees.Columns[8].HeaderText  = "Логин";
                    dgvEmployees.Columns[9].Visible     = false;
                    dgvEmployees.Columns[9].HeaderText  = "Пароль";
                    dgvEmployees.Columns[10].Visible    = false;
                    dgvEmployees.Columns[11].HeaderText = "Должность";
                    dgvEmployees.ClearSelection();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            };

            Invoke(action);
        }