Exemplo n.º 1
0
        //TabPage Канцелярия
        private void MagazineStationeryFill() //Заполнение таблицы Техника
        {
            DBTables dbTables = new DBTables();
            Action   action   = () =>
            {
                try
                {
                    dbTables.DTMagazineStationery.Clear();
                    dbTables.DTMagazineStationeryFill();
                    dbTables.dependency.OnChange += ChangeStationery;

                    dgvStationery.DataSource            = dbTables.DTMagazineStationery;
                    dgvStationery.AutoSizeColumnsMode   = DataGridViewAutoSizeColumnsMode.Fill;
                    dgvStationery.Columns[0].HeaderText = "№ п/п";
                    dgvStationery.Columns[1].HeaderText = "Производитель";
                    dgvStationery.Columns[2].HeaderText = "Название";
                    dgvStationery.Columns[3].HeaderText = "Тип";
                    dgvStationery.Columns[4].HeaderText = "Количество";
                    dgvStationery.Columns[5].HeaderText = "Дата принятия";
                    dgvStationery.Columns[5].Visible    = false;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            };

            Invoke(action);
        }
Exemplo n.º 2
0
        private void OrdersFill() //Заполнение таблицы Заказы
        {
            DBTables dbTables = new DBTables();
            Action   action   = () =>
            {
                try
                {
                    dbTables.DTOrders.Clear();
                    dbTables.DTOrderFill();
                    dbTables.dependency.OnChange += ChangeOrder;

                    dgvOrders.DataSource            = dbTables.DTOrders;
                    dgvOrders.AutoSizeColumnsMode   = DataGridViewAutoSizeColumnsMode.Fill;
                    dgvOrders.Columns[0].Width      = 30;
                    dgvOrders.Columns[0].HeaderText = "№ п/п";
                    dgvOrders.Columns[1].HeaderText = "Описание";
                    dgvOrders.Columns[1].Width      = 250;
                    dgvOrders.Columns[2].HeaderText = "Дата заказа";
                    dgvOrders.Columns[3].HeaderText = "Статус заказа";
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            };

            Invoke(action);
        }
Exemplo n.º 3
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);
        }