private void cbStudentLogin_Leave(object sender, EventArgs e)
        {
            switch (studentCoint == 0 || cbStudentLogin.Text == "")
            {
            case (true):
                btStudentInsert.Text = "Добавить студента";
                tbStudentName.Clear();
                tbStudentSurname.Clear();
                tbStudentMiddleName.Clear();
                mtbTicketNumber.Clear();
                break;

            default:
                btStudentInsert.Text = "Поменять учебную группу";
                DataBaseTables data = new DataBaseTables();
                data.qrStudent += " and [Login_Student] = '" + cbStudentLogin.Text + "'";
                data.dtStudentFill();
                foreach (DataRow r in data.dtStudent.Rows)
                {
                    tbStudentSurname.Text    = r[1].ToString();
                    tbStudentName.Text       = r[2].ToString();
                    tbStudentMiddleName.Text = r[3].ToString();
                    mtbTicketNumber.Text     = r[4].ToString();
                }
                break;
            }
        }
Example #2
0
        private void BtCommint_Click(object sender, EventArgs e)
        {
            switch (tbNewPassword.Text != tbConfPass.Text)
            {
            case (true):
                tbConfPass.Clear();
                tbNewPassword.Clear();
                break;

            case (false):
                DataBaseProcedure procedure = new DataBaseProcedure();
                DataBaseTables    tables    = new DataBaseTables();
                tables.qrAccess_rights += " and [Access_rights_name] = " +
                                          "'Студент'";
                tables.dtAccess_rightsFill();
                Int32 Access_Rights_id =
                    Convert.ToInt32(tables.dtAccess_rights.
                                    Rows[0][0].ToString());
                procedure.spProfile_New_User(tbNewLogin.Text,
                                             tbConfPass.Text, Access_Rights_id, 1,
                                             tbImagePath.Text);
                procedure.spStudent_Insert(tbNewLogin.Text,
                                           ((StudentsForm)parentCreate).tbStudentSurname.Text,
                                           ((StudentsForm)parentCreate).tbStudentName.Text,
                                           ((StudentsForm)parentCreate).tbStudentMiddleName.Text,
                                           ((StudentsForm)parentCreate).mtbTicketNumber.Text,
                                           Convert.ToInt32(((StudentsForm)parentCreate).
                                                           cbGroup.SelectedValue.ToString()));
                BtCancel_Click(sender, e);
                break;
            }
        }
        private void StudentFill()
        {
            Action action = () =>
            {
                try
                {
                    lbAvarageValue.Text     = "00.00";
                    lbQualityValue.Text     = "00.00";
                    lblPerfomanceValue.Text = "00.00";
                    DataBaseTables data = new DataBaseTables();
                    data.qrStudent += " and [Group_ID] = "
                                      + cbGroup.SelectedValue.ToString();
                    data.dtStudentFill();
                    data.dependency.OnChange         += onChangeStudent;
                    dgvStudents.DataSource            = data.dtStudent;
                    dgvStudents.Columns[0].Visible    = false;
                    dgvStudents.Columns[1].HeaderText = "Фамилия";
                    dgvStudents.Columns[2].HeaderText = "Имя";
                    dgvStudents.Columns[3].HeaderText = "Отчество";
                    dgvStudents.Columns[4].HeaderText = "Номер студенческого";
                    dgvStudents.Columns[5].Visible    = false;
                    dgvStudents.Columns[6].Visible    = false;
                    dgvStudents.Columns[7].Visible    = false;
                    dgvStudents.Columns[8].Visible    = false;
                    gbStudents.Visible = true;
                    qualityFill();
                }
                catch
                {
                }
            };

            Invoke(action);
        }
        private void dgvDepartmentFill()
        {
            Action action = () =>
            {
                try
                {
                    DataBaseTables data = new DataBaseTables();
                    filterDepartment = data.qrDepartment;
                    data.dtDepartmentFill();
                    data.dependency.OnChange           += onchangeDepartment;
                    dgvDepartment.DataSource            = data.dtDepartment;
                    dgvDepartment.Columns[0].Visible    = false;
                    dgvDepartment.Columns[1].HeaderText = "Номер специальности";
                    dgvDepartment.Columns[2].HeaderText = "Название специальности";
                    dgvDepartment.Columns[3].Visible    = false;
                    dgvDepartment.Columns[4].HeaderText = "Группа стандартов";
                    dgvDepartment.Columns[5].Visible    = false;
                }
                catch
                {
                }
            };

            Invoke(action);
        }
        private void cbFilterStandart_CheckedChanged(object sender, EventArgs e)
        {
            switch (cbFilterStandart.CheckState)
            {
            case (CheckState.Checked):
                DataBaseTables data = new DataBaseTables();
                data.qrDepartment = filterDepartment + " and [Department_Number] like '%" + tbDepartmentSearch.Text + "%' or [Department_Name] like '%" + tbDepartmentSearch.Text + "%'";
                data.dtDepartmentFill();
                dgvDepartment.DataSource            = data.dtDepartment;
                dgvDepartment.Columns[0].Visible    = false;
                dgvDepartment.Columns[1].HeaderText = "Номер специальности";
                dgvDepartment.Columns[2].HeaderText = "Название специальности";
                dgvDepartment.Columns[3].Visible    = false;
                dgvDepartment.Columns[4].HeaderText = "Группа стандартов";
                dgvDepartment.Columns[5].Visible    = false;
                break;

            case (CheckState.Unchecked):
                dgvDepartmentFill();
                for (int i = 0; i < dgvDepartment.RowCount; i++)
                {
                    for (int j = 0; j < dgvDepartment.ColumnCount; j++)
                    {
                        if (dgvDepartment.Rows[i].Cells[j].Value != null)
                        {
                            if (dgvDepartment.Rows[i].Cells[j].Value.ToString().Contains(tbDepartmentSearch.Text))
                            {
                                dgvDepartment.Rows[i].Selected = true;
                            }
                        }
                    }
                }
                break;
            }
        }
        private void btExcelGroupList_Click(object sender, EventArgs e)
        {
            switch (Registry_Class.DirPath == "Empry" || Registry_Class.OrganizationName == "Empty" ||
                    Registry_Class.DocBM == 0.0 || Registry_Class.DocTM == 0.0 ||
                    Registry_Class.DocRM == 0.0 || Registry_Class.DocLM == 0.0)
            {
            case (true):
                ApplicationConfigurationForm configurationForm = new ApplicationConfigurationForm();
                configurationForm.ShowDialog();
                break;

            case (false):
                btExcelGroupList.Enabled = false;
                DataBaseTables tables = new DataBaseTables();
                tables.qrDiscipline = "select [dbo].[Discipline].[Prefix]+' '+[dbo].[Discipline].[The_name_of_the_discipline] from [dbo].[Group] join [dbo].[Burden] on [dbo].[Burden].[Group_ID] = [dbo].[Group].[ID_Group] join [dbo].[Discipline] on [dbo].[Discipline].[ID_Discipline] = [dbo].[Burden].[Discipline_ID] where [dbo].[Group].[Group_name] = '" + cbGroup.Text + "'";
                tables.qrStudent    = "select [Surname_Student]+' '+SUBSTRING([Name_Student],1,1)+'. '+SUBSTRING([Middle_name_Student],1,1)+'.' from [dbo].[Student] where [dbo].[Student].[Group_ID] = " + cbGroup.SelectedValue.ToString();
                tables.dtDisciplineFill();
                tables.dtStudentFill();
                ExcelDocument document = new ExcelDocument();
                document.Group_name   = cbGroup.Text;
                document.dtDiscipline = tables.dtDiscipline;
                document.dtStudents   = tables.dtStudent;
                document.GroupDisciplineCreate();
                btExcelGroupList.Enabled = true;
                break;
            }
        }
 private void DepartmentFill()
 {
     DataBaseTables dataDepartment = new DataBaseTables();
     dataDepartment.dtDepartmentFill();
     comboBoxDepartment.DataSource = dataDepartment.dtDepartment;
     comboBoxDepartment.ValueMember = "ID_Department";
     comboBoxDepartment.DisplayMember = "Departments_List";
 }
 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 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 accessRightsFill()
        {
            Action action = () =>
            {
                DataBaseTables tables = new DataBaseTables();
                tables.dtAccess_rightsFill();
                tables.dependency.OnChange  += onchangeAccessRights;
                cbAccessRights.DataSource    = tables.dtAccess_rights;
                cbAccessRights.ValueMember   = "ID_Access_rights";
                cbAccessRights.DisplayMember = "Access_rights_name";
            };

            Invoke(action);
        }
        private void cbDepartmentFill()
        {
            Action action = () =>
            {
                DataBaseTables tables = new DataBaseTables();
                tables.dtDepartmentFill();
                tables.dependency.OnChange += onchangeDepartment;
                cbDepartment.DataSource     = tables.dtDepartment;
                cbDepartment.ValueMember    = "ID_Department";
                cbDepartment.DisplayMember  = "Departments_List";
            };

            Invoke(action);
        }
        private void cbStandartDepartment()
        {
            Action action = () =>
            {
                DataBaseTables data = new DataBaseTables();
                data.dtStandardFill();
                data.dependency.OnChange          += onchangeStandartDependency;
                cbstandartDepartment.DataSource    = data.dtStandard;
                cbstandartDepartment.ValueMember   = "ID_Standard";
                cbstandartDepartment.DisplayMember = "Standard_name";
            };

            Invoke(action);
        }
        private void ltbPostsFill()
        {
            Action action = () =>
            {
                DataBaseTables data = new DataBaseTables();
                data.dtPostFill();
                data.dependency.OnChange += onchangePost;
                ltbPosts.DataSource       = data.dtPost;
                ltbPosts.ValueMember      = "ID_Post";
                ltbPosts.DisplayMember    = "Post_title";
            };

            Invoke(action);
        }
        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 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);
        }
Example #16
0
        private void cbPostFill()
        {
            Action action = () =>
            {
                DataBaseTables baseTables = new DataBaseTables();
                baseTables.dtPostFill();
                baseTables.dtPost.Rows.Add(null, "Нет вышестоящей должности", null);
                baseTables.dependency.OnChange += onChangePostParent;
                cbPostParent.DataSource         = baseTables.dtPost;
                cbPostParent.ValueMember        = "ID_Post";
                cbPostParent.DisplayMember      = "Post_title";
                Thread thread = new Thread(ltbPost_Fill);
                thread.Start();
            };

            Invoke(action);
        }
        private void departmentFill()
        {
            Action action = () =>
            {
                try
                {
                    DataBaseTables data = new DataBaseTables();
                    data.dtDepartmentFill();
                    data.dependency.OnChange  += onChangeDepartment;
                    cbDepartment.DataSource    = data.dtDepartment;
                    cbDepartment.ValueMember   = "ID_Department";
                    cbDepartment.DisplayMember = "Departments_List";
                }
                catch
                {
                }
            };

            Invoke(action);
        }
 private void cbStudentLogin_TextUpdate(object sender, EventArgs e)
 {
     try
     {
         DataBaseTables tables = new DataBaseTables();
         tables.qrStudent += " and [Group_ID] = " + cbGroup.SelectedValue.ToString() + " and [Login_Student] like '%" + cbStudentLogin.Text + "%'";
         tables.dtStudentFill();
         cbStudentLogin.Items.Clear();
         foreach (DataRow r in tables.dtStudent.Rows)
         {
             cbStudentLogin.Items.Add(r[0]);
         }
         cbStudentLogin.DroppedDown    = true;
         cbStudentLogin.SelectionStart = cbStudentLogin.Text.Length;
         studentCoint = tables.dtStudent.Rows.Count;
     }
     catch
     {
     }
 }
 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;
            }
        }
        private void stbStandart()
        {
            Action action = () =>
            {
                try
                {
                    DataBaseTables data = new DataBaseTables();
                    data.dtStandardFill();
                    data.dependency.OnChange  += onchangeStandart;
                    lstbStandart.DataSource    = data.dtStandard;
                    lstbStandart.ValueMember   = "ID_Standard";
                    lstbStandart.DisplayMember = "Standard_name";
                    Thread threadDepartment = new Thread(dgvDepartmentFill);
                    threadDepartment.Start();
                }
                catch
                {
                }
            };

            Invoke(action);
        }
Example #22
0
        private void DepartmentLoad()
        {
            Action action = () =>
            {
                try
                {
                    DataBaseTables tables = new DataBaseTables();
                    tables.dtDepartmentFill();
                    tables.dependency.OnChange += Departmentonchange;
                    cbDepartment.DataSource     = tables.dtDepartment;
                    cbDepartment.ValueMember    = "ID_Department";
                    cbDepartment.DisplayMember  = "Departments_List";
                }
                catch
                {
                }
            };

            Invoke(action);
            Thread threadGroup = new Thread(GroupLoad);

            threadGroup.Start();
        }
        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);
        }
        private void btWordStudentList_Click(object sender, EventArgs e)
        {
            switch (Registry_Class.DirPath == "Empry" || Registry_Class.OrganizationName == "Empty" ||
                    Registry_Class.DocBM == 0.0 || Registry_Class.DocTM == 0.0 ||
                    Registry_Class.DocRM == 0.0 || Registry_Class.DocLM == 0.0)
            {
            case (true):
                ApplicationConfigurationForm configurationForm = new ApplicationConfigurationForm();
                configurationForm.ShowDialog();
                break;

            case (false):
                btWordStudentList.Enabled = false;
                DataBaseTables data = new DataBaseTables();
                data.qrStudent = "select ROW_NUMBER() over (order by [Surname_Student]  ASC) as \"№ПП\",[Surname_Student] +' '+ [Name_Student]+' '+[Middle_name_Student] as \"Фамилия Имя Отчество Студентов\" from [dbo].[Student] where [Group_ID] = " + cbGroup.SelectedValue.ToString();
                data.dtStudentFill();
                WordDocument document = new WordDocument();
                document.table      = data.dtStudent;
                document.Group_name = cbGroup.Text;
                document.student_list();
                btWordStudentList.Enabled = true;
                break;
            }
        }