public StuScores OrderByScores(StudentInformation.StudentScores items) { StuScores stuscores = new StuScores(); switch (items.KCMC) { case "语文": stuscores.stuscore = items; stuscores.KCIndex = 1; break; case "数学": stuscores.stuscore = items; stuscores.KCIndex = 2; break; case "英语": stuscores.stuscore = items; stuscores.KCIndex = 3; break; case "物理": stuscores.stuscore = items; stuscores.KCIndex = 4; break; case "化学": stuscores.stuscore = items; stuscores.KCIndex = 5; break; case "生物": stuscores.stuscore = items; stuscores.KCIndex = 6; break; case "历史": stuscores.stuscore = items; stuscores.KCIndex = 7; break; case "政治": stuscores.stuscore = items; stuscores.KCIndex = 8; break; case "地理": stuscores.stuscore = items; stuscores.KCIndex = 9; break; default: stuscores.stuscore = items; stuscores.KCIndex = 10; break; } return(stuscores); }
public List <ChildrenScores> GetStuScoreses() { UCHomeBasePage ucHomeBasePage = new UCHomeBasePage(); if (Session["stuscore"] == null) { StudentInfoService stuService = new StudentInfoService(); List <ChildrenScores> childrenscores = new List <ChildrenScores>(); if (usertype.ToLower() == "s") { IList <StudentInformation.StudentScores> stuScoreList = GetStudentScore(loginId, xxid, null, null, "", "").OrderBy(s => s.SchYear).ThenBy(s => s.SchTerm).ThenBy(s => s.ExamTypeCode).ToList(); List <StuScores> stuscoress = new List <StuScores>(); foreach (StudentInformation.StudentScores items in stuScoreList) { StuScores stuscores = OrderByScores(items); stuscoress.Add(stuscores); } childrenscores.Add(new ChildrenScores { xsid = loginId, XM = username, stuscores = stuscoress }); } else if (usertype.ToLower() == "p") { StudentEntities stu = new StudentEntities(); List <Stu_FamilyStuRel> family = stu.Stu_FamilyStuRel.Where(f => f.JZID == loginId).ToList(); foreach (Stu_FamilyStuRel item in family) { Guid xsid = item.XSID; UserInfo userInfo = ucHomeBasePage.GetUserInfoByRequestId(xsid); Guid schid = userInfo.xxid; IList <StudentInformation.StudentScores> stuScoreList = GetStudentScore(xsid, schid, null, null, "", "").OrderBy(s => s.SchYear).ThenBy(s => s.SchTerm).ThenBy(s => s.ExamTypeCode).ToList(); List <StuScores> stuscoress = new List <StuScores>(); foreach (StudentInformation.StudentScores items in stuScoreList) { StuScores stuscores = OrderByScores(items); stuscoress.Add(stuscores); } childrenscores.Add(new ChildrenScores { xsid = xsid, XM = userInfo.username, stuscores = stuscoress }); } } Session["stuscore"] = childrenscores; return(childrenscores); } return(Session["stuscore"] as List <ChildrenScores>); }