public ActionResult studentsPromotion(FormCollection fc) { string [] ids = fc["classid"].Split(','); string[] roll = fc["rollno"].Split(','); string[] sessionid = fc["cbosession"].Split(','); string[] clas = fc["cboclass"].Split(','); string[] cat = fc["cat"].Split(','); string[] pid = fc["pid"].Split(','); int clases = Convert.ToInt32(clas[0]); int cates = Convert.ToInt32(cat[0]); int pids = Convert.ToInt32(pid[0]); IEnumerable <Tuple <string, string, string> > result = ids .Zip(roll, (e1, e2) => new { e1, e2 }) .Zip(sessionid, (z1, e3) => Tuple.Create(z1.e1, z1.e2, e3)); foreach (var tuple in result) { StudentCurrentStatus stdcurent = new StudentCurrentStatus(); //classesStudentMapping classesStudentMapping = new classesStudentMapping(); var product = StudentCurrentStatuseservice.getbyid(Convert.ToInt32(tuple.Item1)); //classesStudentMapping.StudentID =rols; //classesStudentMapping.id = Convert.ToInt32(tuple.ids); stdcurent.id = Convert.ToInt32(tuple.Item1); stdcurent.StudentID = Convert.ToInt32(tuple.Item2); stdcurent.SessionID = Convert.ToInt32(tuple.Item3); stdcurent.CategoryID = cates; stdcurent.TermID = Convert.ToInt32(fc["tids"]); stdcurent.classesID = clases; stdcurent.SectionID = Convert.ToInt32(fc["sid"]);; stdcurent.ProgramdegreeID = pids; stdcurent.BranchID = Convert.ToString(1); StudentCurrentStatuseservice.updateStudentCurrentStatus(stdcurent); Masterstudentcurrentstatus masterstudentcurrentstatus = new Masterstudentcurrentstatus(); masterstudentcurrentstatus.classesID = clases; masterstudentcurrentstatus.CategoryID = cates; masterstudentcurrentstatus.ProgramdegreeID = pids; masterstudentcurrentstatus.SectionID = Convert.ToInt32(fc["sid"]); masterstudentcurrentstatus.SessionID = Convert.ToInt32(tuple.Item3); masterstudentcurrentstatus.TermID = Convert.ToInt32(fc["tids"]); masterstudentcurrentstatus.StudentID = Convert.ToInt32(tuple.Item2); masterstudentcurrentstatus.date = DateTime.Now; SMSContext sMSContext = new SMSContext(); sMSContext.masterstudentcurrentstatuses.Add(masterstudentcurrentstatus); ViewBag.name = "studentsPromotion?cboclass=" + stdcurent.classesID + "&" + "cbosession=" + stdcurent.SessionID + "&" + "cbocategory=" + stdcurent.CategoryID + "&" + "cboterm=" + stdcurent.TermID + "&" + "cbosection=" + stdcurent.SectionID + "&" + "cboprogram=" + stdcurent.ProgramdegreeID; sMSContext.SaveChanges(); } return(Redirect(ViewBag.name)); }
public ActionResult findstudentstatus(FormCollection fc) { StudentCurrentStatus st = new StudentCurrentStatus(); st.classesID = Convert.ToInt32((fc["cbosection"])); st.CategoryID = Convert.ToInt32((fc["cbocategory"])); st.SessionID = Convert.ToInt32((fc["cbosession"])); st.TermID = Convert.ToInt32((fc["cboterm"])); st.SectionID = Convert.ToInt32((fc["cbosection"])); return(View("StudentFeesStatus", new { classid = st.Classes.ID, catid = st.Category.id, Sid = st.Category.id, tid = st.TermID, sec = st.SectionID })); }
public ActionResult AssignClass(FormCollection fc, string studentroll, int id) { string check = (fc["checkbox"]); if (check == "on") { StudentCurrentStatus studentCurrentStatus = new StudentCurrentStatus(); studentCurrentStatus.StudentID = id; studentCurrentStatus.BranchID = fc["cboBracnh"]; studentCurrentStatus.classesID = Convert.ToInt32((fc["cboclass"])); studentCurrentStatus.CategoryID = Convert.ToInt32((fc["cbocategory"])); studentCurrentStatus.SessionID = Convert.ToInt32((fc["cbosession"])); studentCurrentStatus.TermID = Convert.ToInt32((fc["cboterm"])); studentCurrentStatus.SectionID = Convert.ToInt32((fc["cbosection"])); studentCurrentStatus.ProgramdegreeID = Convert.ToInt32(fc["cboprogram"]); StudentCurrentStatuseservice studentCurrentStatuseservice = new StudentCurrentStatuseservice(); studentCurrentStatuseservice.saveStudentCurrentStatus(studentCurrentStatus); return(RedirectToAction("DiscountDetails", new { stid = studentCurrentStatus.StudentID, branchid = studentCurrentStatus.BranchID, classid = studentCurrentStatus.classesID, sessionid = studentCurrentStatus.SessionID, cateid = studentCurrentStatus.CategoryID, sectionid = studentCurrentStatus.SessionID, Termid = studentCurrentStatus.TermID, feevtype = 1 })); } else { StudentCurrentStatus studentCurrentStatus = new StudentCurrentStatus(); studentCurrentStatus.StudentID = id; studentCurrentStatus.BranchID = fc["cboBracnh"]; studentCurrentStatus.classesID = Convert.ToInt32((fc["cboclass"])); studentCurrentStatus.CategoryID = Convert.ToInt32((fc["cbocategory"])); studentCurrentStatus.SessionID = Convert.ToInt32((fc["cbosession"])); studentCurrentStatus.TermID = Convert.ToInt32((fc["cboterm"])); studentCurrentStatus.SectionID = Convert.ToInt32((fc["cbosection"])); studentCurrentStatus.ProgramdegreeID = Convert.ToInt32(fc["cboprogram"]); StudentCurrentStatuseservice studentCurrentStatuseservice = new StudentCurrentStatuseservice(); studentCurrentStatuseservice.saveStudentCurrentStatus(studentCurrentStatus); return(RedirectToAction("Studentsclasslist")); } }
public ActionResult Editclasses(FormCollection fc, int id) { StudentCurrentStatus StudentCurrentStatus = new StudentCurrentStatus(); StudentCurrentStatus.id = id; StudentCurrentStatus.StudentID = Convert.ToInt32(fc["StudentID"]); StudentCurrentStatus.SectionID = Convert.ToInt32((fc["cbosession"])); StudentCurrentStatus.classesID = Convert.ToInt32((fc["cboclass"])); StudentCurrentStatus.SessionID = Convert.ToInt32((fc["cbosection"])); StudentCurrentStatus.TermID = Convert.ToInt32((fc["cboterm"])); StudentCurrentStatus.BranchID = fc["cbobranch"]; StudentCurrentStatus.CategoryID = Convert.ToInt32((fc["cbocateogry"])); StudentCurrentStatus.ProgramdegreeID = Convert.ToInt32(fc["Programdegree"]); StudentCurrentStatuseservice StudentCurrentStatuseservice = new StudentCurrentStatuseservice(); StudentCurrentStatuseservice.updateStudentCurrentStatus(StudentCurrentStatus); return(RedirectToAction("Studentsclasslist")); }