示例#1
0
        private void button3_Click(object sender, EventArgs e)
        {
            string id  = txtMaSV.Text.Trim();
            string id1 = txtMaMH.Text.Trim();

            if (MessageBox.Show(string.Format("Xóa điểm môn {0} của sinh viên có mã '{1}'?", id1, id), "", MessageBoxButtons.OKCancel) == DialogResult.OK)
            {
                tblKET_QUA g = new tblKET_QUA();
                g.MaMon       = txtMaMH.Text;
                g.MaSV        = txtMaSV.Text;
                g.DiemTB      = Convert.ToDouble(txtDiemTB.Text);
                g.DiemThiLan1 = Convert.ToDouble(txtDiemThi1.Text);
                g.DiemThiLan2 = Convert.ToDouble(txtdiemthi2.Text);
                g.DiemTongKet = Convert.ToDouble(txtDiemTK.Text);
                g.HanhKiem    = cboHanhKiem.Text;
                g.HocKi       = Convert.ToInt32(txtHocKi.Text.ToString());
                DIEMF f = new DIEMF();
                f.Delete(g);
                context            = new HSGVDbContext();
                dgrDiem.DataSource = context.tblKET_QUA.ToList();
                txtMaSV.Clear();
                txtMaMH.Clear();
                txtHocKi.Clear();
                txtDiemTK.Clear();
                txtDiemThi1.Clear();
                txtdiemthi2.Clear();
                txtDiemTB.Clear();
                cboHanhKiem.Text = "";
            }
        }
示例#2
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (txtMaSV.Text.Trim() == "" || txtMaMH.Text.Trim() == "")
     {
         MessageBox.Show("Chưa nhập đủ thông tin", "Thông báo");
     }
     else
     {
         if (context.tblKET_QUA.Where(x => x.MaMon == txtMaMH.Text.Trim() && x.MaSV == txtMaSV.Text.Trim()).SingleOrDefault() != null)
         {
             MessageBox.Show("Mã sinh viên và mã môn học đã tồn tại", "Thông báo");
         }
         else
         {
             if (txtDiemTB.Text.Trim() == "")
             {
                 txtDiemTB.Text = "-1";
             }
             if (txtDiemThi1.Text.Trim() == "")
             {
                 txtDiemThi1.Text = "-1";
             }
             if (txtdiemthi2.Text.Trim() == "")
             {
                 txtdiemthi2.Text = "-1";
             }
             if (txtDiemTK.Text.Trim() == "")
             {
                 txtDiemTK.Text = "-1";
             }
             if (txtHocKi.Text.Trim() == "")
             {
                 txtHocKi.Text = "-1";
             }
             tblKET_QUA g = new tblKET_QUA();
             g.MaMon       = txtMaMH.Text;
             g.MaSV        = txtMaSV.Text;
             g.DiemTB      = Convert.ToDouble(txtDiemTB.Text);
             g.DiemThiLan1 = Convert.ToDouble(txtDiemThi1.Text);
             g.DiemThiLan2 = Convert.ToDouble(txtdiemthi2.Text);
             g.DiemTongKet = Convert.ToDouble(txtDiemTK.Text);
             g.HanhKiem    = cboHanhKiem.Text;
             g.HocKi       = Convert.ToInt32(txtHocKi.Text.ToString());
             DIEMF f = new DIEMF();
             f.Insert(g);
             context            = new HSGVDbContext();
             dgrDiem.DataSource = context.tblKET_QUA.ToList();
             txtMaSV.Clear();
             txtMaMH.Clear();
             txtHocKi.Clear();
             txtDiemTK.Clear();
             txtDiemThi1.Clear();
             txtDiemTB.Clear();
             cboHanhKiem.Text = "";
         }
     }
 }
示例#3
0
 private void btnDangNhap_Click(object sender, EventArgs e)
 {
     context = new HSGVDbContext();
     if (context.tblLOGINs.Where(x => x.TenDN == txtTenDN.Text && x.MatKhau == txtMatKhau.Text).SingleOrDefault() == null)
     {
         MessageBox.Show("Tài khoản không đúng", "Thông báo");
     }
     else
     {
         DialogResult = MessageBox.Show("Đăng nhập thành công", "", MessageBoxButtons.OKCancel);
         this.Hide();
         frmMain f = new frmMain();
         f.Show();
     }
 }
示例#4
0
        private void btnXoa_Click(object sender, EventArgs e)
        {
            string id = txtMaSV.Text.Trim();

            if (MessageBox.Show(string.Format("Xóa sinh viên có mã '{0}'?", id), "", MessageBoxButtons.OKCancel) == DialogResult.OK)
            {
                tblSINH_VIEN g = new tblSINH_VIEN();
                g.MaSv = txtMaSV.Text;

                SINHVIENF f = new SINHVIENF();
                f.Delete(g);
                context            = new HSGVDbContext();
                dgrDSSV.DataSource = context.tblSINH_VIEN.ToList();
            }
        }
示例#5
0
        private void btnSua_Click(object sender, EventArgs e)
        {
            string id = txtMaSV.Text.Trim();

            if (MessageBox.Show(string.Format("Sửa sinh viên có mã '{0}'?", id), "", MessageBoxButtons.OKCancel) == DialogResult.OK)
            {
                tblSINH_VIEN g = new tblSINH_VIEN();
                g.MaSv     = txtMaSV.Text;
                g.HoTen    = txtHoTen.Text;
                g.NgaySinh = dateNgaysinh.Text;
                g.DiaChi   = txtDiaChi.Text;
                g.GioiTinh = cboGioiTinh.Text;
                g.MaLop    = cboMalop.Text;
                SINHVIENF f = new SINHVIENF();
                f.Update(g);
                context            = new HSGVDbContext();
                dgrDSSV.DataSource = context.tblSINH_VIEN.ToList();
            }
        }
示例#6
0
        private void button3_Click(object sender, EventArgs e)
        {
            string id = txtMaLop.Text.Trim();

            if (MessageBox.Show(string.Format("Xóa lớp có mã '{0}'?", id), "", MessageBoxButtons.OKCancel) == DialogResult.OK)
            {
                tblLOP g = new tblLOP();
                g.MaLop  = txtMaLop.Text;
                g.MaKhoa = cboKhoa.Text;
                g.TenLop = txtTenlop.Text;

                var result = new LOPF().Delete(g);
                context           = new HSGVDbContext();
                dgrLop.DataSource = context.tblLOPs.ToList();
                txtMaLop.Clear();
                txtTenlop.Clear();
                cboKhoa.Text = "";
            }
        }
示例#7
0
 private void frmLop_Load(object sender, EventArgs e)
 {
     context           = new HSGVDbContext();
     dgrLop.DataSource = context.tblLOPs.ToList();
     loadkhoa();
 }
示例#8
0
 private void frmKhoa_Load(object sender, EventArgs e)
 {
     context            = new HSGVDbContext();
     dgrKhoa.DataSource = context.tblKHOAs.ToList();
 }
示例#9
0
 public MONHOCF()
 {
     context = new HSGVDbContext();
 }
示例#10
0
 public KHOAF()
 {
     context = new HSGVDbContext();
 }
示例#11
0
 private void frmMonhoc_Load(object sender, EventArgs e)
 {
     context           = new HSGVDbContext();
     dgrMON.DataSource = context.tblMONs.ToList();
     loadkhoa();
 }
示例#12
0
 public GIANGVIENF()
 {
     context = new HSGVDbContext();
 }
示例#13
0
 public SINHVIENF()
 {
     context = new HSGVDbContext();
 }
示例#14
0
 private void frmQLSV_Load(object sender, EventArgs e)
 {
     dgrDSSV.DataSource = context.tblSINH_VIEN.ToList();
     context            = new HSGVDbContext();
     loadMaLop();
 }
示例#15
0
 public frmQLSV()
 {
     InitializeComponent();
     context = new HSGVDbContext();
 }
示例#16
0
 private void frmGiangVien_Load(object sender, EventArgs e)
 {
     context            = new HSGVDbContext();
     dgrDSGV.DataSource = context.tblGIANG_VIEN.ToList();
     txtMaGV.Enabled    = false;
 }
示例#17
0
 private void frmQLDiem_Load(object sender, EventArgs e)
 {
     context            = new HSGVDbContext();
     dgrDiem.DataSource = context.tblKET_QUA.ToList();
 }
示例#18
0
 public DIEMF()
 {
     context = new HSGVDbContext();
 }
示例#19
0
 public LOPF()
 {
     context = new HSGVDbContext();
 }