public ActionResult AddResult(int cboclass, int cbosession, int cboterm, int cbosection, int cbosubject)

        {
            var id = ResultSheetService.getResultSheet().Where(x => x.classesID == cboclass && x.SessionsID == cbosession &&
                                                               x.TermsID == cboterm && x.SectionID == cbosection && x.Subjectid == cbosubject).Select(x => x.ID);


            if (id.Count() > 0)
            {
                return(RedirectToAction("Edit", new { cboclass, cbosection, cbosession, cbosubject, cboterm }));
            }
            else
            {
                StudentCurrentStatuseservice currentStatuseservice = new StudentCurrentStatuseservice();
                ViewBag.session     = sessionservice.getsession().ToList();
                ViewBag.classeslist = classservice.getclasses().ToList();
                ViewBag.section     = sectionservice.getsection().ToList();
                ViewBag.termname    = termservice.getTerm().ToList();
                ViewBag.subject     = cbosubject;

                var model = from c in currentStatuseservice.getStudentCurrentStatus().ToList().Where(x => x.classesID == cboclass &&
                                                                                                     x.SessionID == cbosession && x.TermID == cboterm &&
                                                                                                     x.SectionID == cbosection
                                                                                                     )
                            join s in studentservice.getstudent() on c.StudentID equals s.ID
                            join sec in sectionservice.getsection() on c.SectionID equals sec.id
                            join Session in sessionservice.getsession() on c.SessionID equals Session.ID
                            join classes in classservice.getclasses() on c.classesID equals classes.ID
                            join term in termservice.getTerm() on c.TermID equals term.id



                            select new StudentDisplayVM
                {
                    section = sec,
                    session = Session,
                    Student = s,
                    StudentCurrentStatus = c,
                    Classes = classes,
                    term    = term
                };



                return(View(model));
            }
        }
Beispiel #2
0
        //public ActionResult Assignbranch(string id)
        //{
        //    Branchservice branchservice = new Branchservice();
        //    Studentservice studentservice = new Studentservice();
        //
        //var emp   = studentservice.getstudent().Where(x => x.RollNo == id).SingleOrDefault();

        // ViewBag.getclass = Classservice.getclasses().ToList();
        //    ViewBag.branchlist = branchservice.getbranch().ToList();
        //    return View(emp);

        //}
        //[HttpPost]
        //public ActionResult Assignbranch(FormCollection fc,string id)


        //{
        //    StudentBranchMapping studentBranchMapping = new StudentBranchMapping();
        //    var classesid= (fc["cboclass"]);
        //    studentBranchMapping.BranchID=Convert.ToInt32((fc["cboBracnh"]));
        //    studentBranchMapping.StudentID = id;
        //    StudentBranchMappingBranchMappingservice studentBranchMappingBranchMappingservice = new StudentBranchMappingBranchMappingservice();
        //    studentBranchMappingBranchMappingservice.saveStudentBranchMapping(studentBranchMapping);
        //    return RedirectToAction("AssignClass",new {classid=classesid , id = studentBranchMapping.StudentID });



        //}
        public ActionResult AssignClass(string studentroll, int id)
        {
            var emp = studentservice.getstudent().Where(x => x.ID == id).SingleOrDefault();

            ViewBag.session    = sessionservice.getsession().ToList();
            ViewBag.section    = sectionservice.getsection().ToList();
            ViewBag.termname   = termservice.getTerm().ToList();
            ViewBag.getclass   = Classservice.getclasses().ToList();
            ViewBag.branchlist = branchservice.getbranch().ToList();
            ViewBag.catlist    = categoryservice.getCategory().ToList();
            ViewBag.program    = programdegreesservice.getProgramdegree().ToList();

            return(View(emp));
        }