private void ltbEmployeeBurdenFill()
        {
            Action action = () =>
            {
                tablesEmployee.dtEmployeeFill();
                tablesEmployee.dependency.OnChange += onchangeEmployeeBurden;
                ltbEmployeeBurden.DataSource        = tablesEmployee.dtEmployee;
                ltbEmployeeBurden.ValueMember       = "Login_Employee";
                ltbEmployeeBurden.DisplayMember     = "Emploeyee_Info";
            };

            Invoke(action);
        }
        private void ltbEmployeeFill()
        {
            Action action = () =>
            {
                DataBaseTables data = new DataBaseTables();
                data.dtEmployeeFill();
                data.dependency.OnChange += onchangeEmlFill;
                ltbEmployee.DataSource    = data.dtEmployee;
                ltbEmployee.ValueMember   = "Login_Employee";
                ltbEmployee.DisplayMember = "Emploeyee_Info";
            };

            Invoke(action);
        }
        private void employeeFill()
        {
            Action action = () =>
            {
                DataBaseTables tables = new DataBaseTables();
                tables.dtEmployeeFill();
                tables.dependency.OnChange       += onchangeEmployee;
                dgvEmployee.DataSource            = tables.dtEmployee;
                dgvEmployee.Columns[0].Visible    = false;
                dgvEmployee.Columns[1].HeaderText = "Фамилия";
                dgvEmployee.Columns[2].HeaderText = "Имя";
                dgvEmployee.Columns[3].HeaderText = "Отчество";
                dgvEmployee.Columns[4].Visible    = false;
            };

            Invoke(action);
        }
 private void cbLogin_TextUpdate(object sender, EventArgs e)
 {
     try
     {
         DataBaseTables table = new DataBaseTables();
         table.qrEmployee += " and [Login_Employee] like '%" + cbLogin.Text + "%'";
         table.dtEmployeeFill();
         cbLogin.Items.Clear();
         foreach (DataRow r in table.dtEmployee.Rows)
         {
             cbLogin.Items.Add(r[0]);
         }
         cbLogin.DroppedDown    = true;
         cbLogin.SelectionStart = cbLogin.Text.Length;
         EmployeeCount          = table.dtEmployee.Rows.Count;
     }
     catch
     {
     }
 }
        private void cbLogin_Leave(object sender, EventArgs e)
        {
            switch (EmployeeCount == 0 || cbLogin.Text == "")
            {
            case (true):
                tbPassword.Clear();
                tbConfPass.Clear();
                tbSurName.Clear();
                tbName.Clear();
                tbMiddleName.Clear();
                break;

            case (false):
                DataBaseTables tables = new DataBaseTables();
                tables.qrEmployee += " and [Login_Employee] like '%" + cbLogin.Text + "%'";
                tables.qrProfile  += " and [Login_Profile] like '%" + cbLogin.Text + "%'";
                tables.dtProfileFill();
                tables.dtEmployeeFill();
                foreach (DataRow r in tables.dtEmployee.Rows)
                {
                    tbSurName.Text    = r[1].ToString();
                    tbName.Text       = r[2].ToString();
                    tbMiddleName.Text = r[3].ToString();
                }
                foreach (DataRow r in tables.dtProfile.Rows)
                {
                    try
                    {
                        OldPassword = r[1].ToString();
                        cbAccessRights.SelectedValue = r[3].ToString();
                        OldRole          = Convert.ToInt32(r[3].ToString());
                        tbImagePath.Text = r[4].ToString();
                        pbProfile.Load(r[4].ToString());
                    }
                    catch
                    {
                    }
                }
                break;
            }
        }