private void btnLuu_Click(object sender, EventArgs e)
 {
     foreach (DiemLopHocPhanViewModels d in lstEdit)
     {
         eDiem diem = new eDiem();
         diem.ID_LopHocPhan = tbIDLopHP.Text.Trim();
         diem.ID_SinhVien   = d.ID_SinhVien;
         if (d.TK1 != "")
         {
             diem.TK1 = double.Parse(d.TK1.Trim());
         }
         if (d.TK2 != "")
         {
             diem.TK2 = double.Parse(d.TK2.Trim());
         }
         if (d.TK3 != "")
         {
             diem.TK3 = double.Parse(d.TK3.Trim());
         }
         if (d.GK != "")
         {
             diem.GK = double.Parse(d.GK.Trim());
         }
         if (d.CK != "")
         {
             diem.CK = double.Parse(d.CK.Trim());
         }
         new DiemBLL().EditDiemLopHP(diem);
     }
     MessageBox.Show("Đã Lưu");
     btnLuu.Visible = false;
     btnHuy.Visible = false;
     lstEdit        = new List <DiemLopHocPhanViewModels>();
 }
Пример #2
0
 private void btnLuu_Click(object sender, EventArgs e)
 {
     foreach (DiemSinhVienViewModels d in lstEdit)
     {
         eDiem diem = new eDiem();
         diem.ID_LopHocPhan = d.ID_LopHocPhan;
         diem.ID_SinhVien   = eSV.ID_SinhVien;
         if (d.TK1 != "")
         {
             diem.TK1 = double.Parse(d.TK1.Trim());
         }
         if (d.TK2 != "")
         {
             diem.TK2 = double.Parse(d.TK2.Trim());
         }
         if (d.TK3 != "")
         {
             diem.TK3 = double.Parse(d.TK3.Trim());
         }
         if (d.GK != "")
         {
             diem.GK = double.Parse(d.GK.Trim());
         }
         if (d.CK != "")
         {
             diem.CK = double.Parse(d.CK.Trim());
         }
         new DiemBLL().EditDiemSV(diem);
     }
     MessageBox.Show("Đã Lưu", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
     btnLuu.Visible = false;
     btnHuy.Visible = false;
     lstEdit        = new List <DiemSinhVienViewModels>();
 }
        public bool EditDiemSV(eDiem d)
        {
            Diem s = db.Diems.Where(x => x.ID_LopHocPhan == d.ID_LopHocPhan && x.ID_SinhVien == d.ID_SinhVien).FirstOrDefault();

            if (s != null)
            {
                s.TK1 = d.TK1;
                s.TK2 = d.TK2;
                s.TK3 = d.TK3;
                s.CK  = d.CK;
                s.GK  = d.GK;
                db.SaveChanges();
                return(true);
            }
            return(false);
        }
Пример #4
0
 public bool EditDiemLopHP(eDiem d)
 {
     return(diemDal.EditDiemLopHP(d));
 }
Пример #5
0
 public bool EditDiemSV(eDiem d)
 {
     return(diemDal.EditDiemSV(d));
 }