public ActionResult DanhGia(SinhVien SV) { int a = int.Parse(Session["NamHoc"].ToString()); int b = int.Parse(Session["HocKy"].ToString()); var d = new DiemRenLuyenLopDao(); int c = (int)SV.MaSV / 1000000000; if (c > 0 && c < 10) { d.create(SV.MaSV, a, b); } var diem = new DiemRenLuyenDao(); if (d.GetByRL(SV.MaSV, a, b) == null) { d.create(SV.MaSV, a, b); } if (diem.GetByRL(SV.MaSV, a, b) == null) { diem.create(SV.MaSV, a, b); } ViewBag.DiemSV = diem.GetByRL(SV.MaSV, a, b); ViewBag.DiemSV_Lop = d.GetByRL(SV.MaSV, a, b); ViewBag.DiemTong = diem.DiemTong(SV.MaSV, a, b); ViewBag.DiemTong_Lop = d.DiemTong(SV.MaSV, a, b); return(View(SV)); }
public ActionResult DanhGia(double MaSV, int?Diem_1_1, int?Diem_1_2, int?Diem_1_3, int?Diem_1_4, int?Diem_2_1, int?Diem_2_2, int?Diem_2_3, int?Diem_3_1, int?Diem_3_2, int?Diem_4_1, int?Diem_4_2, int?Diem_4_3, int?Diem_5_1, int?Diem_5_2, int?Diem_5_3, int?Diem_6_1) { int a = int.Parse(Session["NamHoc"].ToString()); int b = int.Parse(Session["HocKy"].ToString()); var diem2 = new DiemRenLuyenLopDao(); diem2.Update(MaSV, a, b, Diem_1_1, Diem_1_2, Diem_1_3, Diem_1_4, Diem_2_1, Diem_2_2, Diem_2_3, Diem_3_1, Diem_3_2, Diem_4_1, Diem_4_2, Diem_4_3, Diem_5_1, Diem_5_2, Diem_5_3, Diem_6_1); var d = new DiemRenLuyenLopDao(); var SV = new SinhVienDao().GetSV(MaSV); var diem = new DiemRenLuyenDao(); ViewBag.DiemSV = diem.GetByRL(MaSV, a, b); ViewBag.DiemSV_Lop = d.GetByRL(MaSV, a, b); ViewBag.DiemTong = diem.DiemTong(MaSV, a, b); ViewBag.DiemTong_Lop = d.DiemTong(MaSV, a, b); ModelState.AddModelError("", "Lưu Thành công."); var diemRL = new DiemRenLuyenLopDao(); Session.Add("XS", diemRL.XS(20192020, 1)); Session.Add("Tot", diemRL.Tot(20192020, 1)); Session.Add("Kha", diemRL.Kha(20192020, 1)); Session.Add("TB", diemRL.TB(20192020, 1)); Session.Add("Yeu", diemRL.Yeu(20192020, 1)); Session.Add("Kem", diemRL.Kem(20192020, 1)); return(View(SV)); }