public void AddStudentMark(StudentMarkViewModel model) { int? m = model.mark; string res = ""; if (m >= 50) { res = model.result = "Pass"; } else if (m < 50) { res = model.result = "Fail"; } else if (m == 0) { res = ""; } var tb = new StudentMarks { Student_Number = model.Student_Number, Student_Name = model.Student_Name, Subject_Code = model.Subject_Code, GroupeName = model.GroupeName, ClassGroupe_id = model.ClassGroupe_id, mark = model.mark, result = res }; uow.Repository <StudentMarks>().Insert(tb); uow.Save(); }
public ActionResult Create([Bind(Include = "Student_Number,Student_Name,ClassGroupe_id,GroupeName,Subject_Code,mark,result")] StudentMarkViewModel studentMarkViewModel) { if (ModelState.IsValid) { logic.AddStudentMark(studentMarkViewModel); return(RedirectToAction("Filter")); } ViewBag.GroupeName = new SelectList(db.ClassGroupes, "GroupeName", "GroupeName", studentMarkViewModel.GroupeName); ViewBag.ClassGroupe_id = new SelectList(db.ClassGroupes, "ClassGroupe_id", "GroupeName", studentMarkViewModel.ClassGroupe_id); ViewBag.Subject_Code = new SelectList(db.Subjects, "Subject_Code", "DescriptiveTitle", studentMarkViewModel.Subject_Code); return(View(studentMarkViewModel)); }
public void UpdateStudentMark(StudentMarkViewModel model) { throw new NotImplementedException(); }