Beispiel #1
0
        private void themSV()
        {
            if (dtBUS.getDiemTheoMSSV_MaHP(this.txtMaSV.Text, this.cbbMaHP.Text).Count != 0)
            {
                MessageBox.Show("Sinh Viên đã có trong HỌC PHẦN.", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            else
            {
                var sv = svBUS.getSVTheoMaSV(this.txtMaSV.Text);

                if (sv.Count == 0)
                {
                    MessageBox.Show("Sinh Viên không tồn tại.", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    if (dtBUS.themDiemThi(this.txtMaSV.Text, this.cbbMaHP.Text))
                    {
                        MessageBox.Show("Đã Thêm Xong.");
                        this.dgcSinhVien.DataSource = svBUS.getSVTheoMaHP(this.cbbMaHP.SelectedValue.ToString());
                    }
                    else
                    {
                        MessageBox.Show("Khong them duoc. Loi !!!", "THONG BAO", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
            DataBinding();
            this.txtMaSV.SelectAll();
        }