Exemple #1
0
        private void btn_Delete_Click(object sender, EventArgs e)
        {
            BLGrade update = new BLGrade();

            if (update.UpdateMark(StudentIDUpdate, ClassIDUpdate, null) == true)
            {
                BLGrade grades = new BLGrade();
                if (cbb_Classes_GradeForm.Text != string.Empty)
                {
                    var list = grades.DetailGradeInfo_cbb_Classes(cbb_Classes_GradeForm.Text, this.ProfessorID.ToString());
                    dgv_Grade.DataSource = list.ToList();
                }
                else
                {
                    var list = grades.DetailGradeInfo_cbb_Subjects(cbb_Subjects_GradeForm.Text, this.ProfessorID.ToString());
                    dgv_Grade.DataSource = list.ToList();
                }
                foreach (DataGridViewRow row in dgv_Grade.Rows)
                {
                    if (row.Cells[5].Value == null)
                    {
                        row.Cells[5].Value = string.Empty;
                    }
                }
                MessageBox.Show(" Deleted !");
            }
            else
            {
                MessageBox.Show(" Something wrong !");
            }
        }
Exemple #2
0
        private void cbb_Classes_GradeForm_SelectedIndexChanged(object sender, EventArgs e)
        {
            BLGrade grades = new BLGrade();
            var     list   = grades.DetailGradeInfo_cbb_Classes(cbb_Classes_GradeForm.Text, this.ProfessorID.ToString());

            dgv_Grade.DataSource = list.ToList();
            foreach (DataGridViewRow row in dgv_Grade.Rows)
            {
                if (row.Cells[5].Value == null)
                {
                    row.Cells[5].Value = string.Empty;
                }
            }
        }
Exemple #3
0
        private void btn_OK_Click(object sender, EventArgs e)
        {
            var readfile = new BLGrade();

            switch (readfile.Readfile(txb_Path.Text))
            {
            case 2:
            {
                MessageBox.Show("Load all the grades in this file successfully !");
                BLGrade grades = new BLGrade();
                if (cbb_Classes_GradeForm.Text != string.Empty)
                {
                    var list = grades.DetailGradeInfo_cbb_Classes(cbb_Classes_GradeForm.Text, this.ProfessorID.ToString());
                    dgv_Grade.DataSource = list.ToList();
                }
                else
                {
                    var list = grades.DetailGradeInfo_cbb_Subjects(cbb_Subjects_GradeForm.Text, this.ProfessorID.ToString());
                    dgv_Grade.DataSource = list.ToList();
                }
                foreach (DataGridViewRow row in dgv_Grade.Rows)
                {
                    if (row.Cells[5].Value == null)
                    {
                        row.Cells[5].Value = string.Empty;
                    }
                }
                break;
            }

            case 1:
            {
                MessageBox.Show("This file have something wrong (the Student ID or Class ID) \n Can't read that, please try again !");
                break;
            }

            case 0:
            {
                MessageBox.Show(" Can't find out this file, please check the file path again ! Is it exists ? ");
                break;
            }
            }

            txb_Path.Clear();
        }