public ActionResult studentList(mst_discipline_grades mst) { mst_discipline_gradesMain mstMain = new mst_discipline_gradesMain(); IEnumerable <mst_discipline_grades> grades; mst_disciplineMain subjectMain = new mst_disciplineMain(); mst_discipline subject = new mst_discipline(); List <mst_discipline_grades> list = new List <mst_discipline_grades>(); grades = mstMain.FindDisciplineGrades(mst.class_id, mst.section_id, mst.discipline_id, mst.term_id); subject = subjectMain.FindDiscipline(mst.discipline_id); if (grades.Count() > 0) { foreach (var i in grades) { list.Add(new mst_discipline_grades { grade = i.grade, class_id = i.class_id, term_id = mst.term_id, section_id = i.section_id, roll_no = i.roll_no, sr_num = i.sr_num, std_name = i.std_name, discipline_id = mst.discipline_id, discipline_name = subject.discipline_name, user_id = Int32.Parse(Request.Cookies["loginUserId"].Value.ToString()) }); } } else { var student_list = mstMain.student_list_for_Discipline_Grades(mst.class_id, mst.section_id); foreach (var i in student_list) { list.Add(new mst_discipline_grades { class_id = i.class_id, term_id = mst.term_id, section_id = i.section_id, roll_no = i.roll_no, sr_num = i.sr_num, std_name = i.std_name, discipline_id = mst.discipline_id, discipline_name = subject.discipline_name, user_id = Int32.Parse(Request.Cookies["loginUserId"].Value.ToString()) }); } } return(View(list)); }
public ActionResult DeleteDiscipline(int id) { mst_disciplineMain stdMain = new mst_disciplineMain(); return(View(stdMain.FindDiscipline(id))); }