private void GroupFill()
 {
     try
     {
         DataBaseTables dataGroup = new DataBaseTables();
         dataGroup.qrGroup += " and [Department_ID] = " + comboBoxDepartment.SelectedValue.ToString();
         dataGroup.dtGroupFill();
         comboBoxGroup.DataSource = dataGroup.dtGroup;
         comboBoxGroup.ValueMember = "ID_Group";
         comboBoxGroup.DisplayMember = "Group__name";
     }
     catch { }
 }
        private void cbGroupFill()
        {
            Action action = () =>
            {
                DataBaseTables tables = new DataBaseTables();
                tables.qrGroup += " and [Department_ID] = " + cbDepartment.SelectedValue.ToString();
                tables.dtGroupFill();
                tables.dependency.OnChange += onchangeGroup;
                cbGroup.DataSource          = tables.dtGroup;
                cbGroup.ValueMember         = "ID_Group";
                cbGroup.DisplayMember       = "Group_name";
            };

            Invoke(action);
        }
        private void groupFill()
        {
            Action action = () =>
            {
                try
                {
                    lbGroupValue.Text   = "0";
                    lbStudentValue.Text = "0";
                    DataBaseTables data = new DataBaseTables();
                    data.qrGroup += " and [Department_ID] = "
                                    + cbDepartment.SelectedValue.ToString();
                    data.dtGroupFill();
                    data.dependency.OnChange += onChangeGroup;
                    cbGroup.DataSource        = data.dtGroup;
                    cbGroup.ValueMember       = "ID_Group";
                    cbGroup.DisplayMember     = "Group_name";
                    cbGroup.Enabled           = true;
                    statisticFill();
                    switch (lbGroupValue.Text)
                    {
                    case ("0"):
                        btStartEnd.Enabled = false;
                        break;

                    default:
                        btStartEnd.Enabled = true;
                        break;
                    }
                }
                catch
                {
                }
            };

            Invoke(action);
        }