Exemple #1
0
 public void Update()
 {
     _departmentsTable = _bd.departmentsSelectAll();
     _employeesTable   = _bd.employeesSelectAll();
     LoadEmployees();
     LoadDepartments();
 }
Exemple #2
0
        private void Button3_Click(object sender, EventArgs e)
        {
            try
            {
                DataTable emps;
                if (comboBox1.SelectedItem.ToString() == "Все департаменты")
                {
                    emps = _dbM.employeesSelectAll();
                }
                else
                {
                    string search = comboBox1.SelectedItem.ToString().Trim('_', ' ').Split(',')[1];
                    emps = _dbM.employeesSelect(search);
                }
                state = StateOfDataGrid.Employees;

                dataGridView1.DataSource = emps;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemple #3
0
 public Company()
 {
     try
     {
         _bd = new DatabaseManipulations();
         _departmentsTable = _bd.departmentsSelectAll();
         _employeesTable   = _bd.employeesSelectAll();
         LoadEmployees();
         LoadDepartments();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }