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 = ""; } }
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 = ""; } } }
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(); } }
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(); } }
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(); } }
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 = ""; } }
private void frmLop_Load(object sender, EventArgs e) { context = new HSGVDbContext(); dgrLop.DataSource = context.tblLOPs.ToList(); loadkhoa(); }
private void frmKhoa_Load(object sender, EventArgs e) { context = new HSGVDbContext(); dgrKhoa.DataSource = context.tblKHOAs.ToList(); }
public MONHOCF() { context = new HSGVDbContext(); }
public KHOAF() { context = new HSGVDbContext(); }
private void frmMonhoc_Load(object sender, EventArgs e) { context = new HSGVDbContext(); dgrMON.DataSource = context.tblMONs.ToList(); loadkhoa(); }
public GIANGVIENF() { context = new HSGVDbContext(); }
public SINHVIENF() { context = new HSGVDbContext(); }
private void frmQLSV_Load(object sender, EventArgs e) { dgrDSSV.DataSource = context.tblSINH_VIEN.ToList(); context = new HSGVDbContext(); loadMaLop(); }
public frmQLSV() { InitializeComponent(); context = new HSGVDbContext(); }
private void frmGiangVien_Load(object sender, EventArgs e) { context = new HSGVDbContext(); dgrDSGV.DataSource = context.tblGIANG_VIEN.ToList(); txtMaGV.Enabled = false; }
private void frmQLDiem_Load(object sender, EventArgs e) { context = new HSGVDbContext(); dgrDiem.DataSource = context.tblKET_QUA.ToList(); }
public DIEMF() { context = new HSGVDbContext(); }
public LOPF() { context = new HSGVDbContext(); }