PageRenderTime 45ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/website/asp/front/score.aspx.cs

https://github.com/panmingzhi815/SchoolManagementSystem
C# | 55 lines | 54 code | 1 blank | 0 comment | 4 complexity | 359ab08d5cd4b2b35ad9427ef770e19f MD5 | raw file
Possible License(s): LGPL-2.1
  1. using System;
  2. using System.Collections;
  3. using System.Configuration;
  4. using System.Data;
  5. using System.Linq;
  6. using System.Web;
  7. using System.Web.Security;
  8. using System.Web.UI;
  9. using System.Web.UI.HtmlControls;
  10. using System.Web.UI.WebControls;
  11. using System.Web.UI.WebControls.WebParts;
  12. using System.Xml.Linq;
  13. using Domain.Entities;
  14. using DataService.service.dao;
  15. using System.Collections.Generic;
  16. namespace Domain.asp.front
  17. {
  18. public partial class score : System.Web.UI.Page
  19. {
  20. protected void Page_Load(object sender, EventArgs e)
  21. {
  22. Student s = (Student)Session["user"];
  23. if (s != null) {
  24. welcomeInfo.InnerHtml = "欢迎你," + s.Name;
  25. ExamResultService ers = new ExamResultService();
  26. IList<ExamResult> examResultList = ers.getExamResultByStudent(s);
  27. string content = "<center><h2>"+s.Name+" 同学成绩单</h2></center>";
  28. foreach (ExamResult er in examResultList) {
  29. content += "<h4>" + er.ExamPlan.Name + "</h4>";
  30. IDictionary<string,string> couresScoureMap = er.CouresScoreMap;
  31. string[] keys = new string[couresScoureMap.Keys.Count];
  32. content += "<table class='table table-striped table-bordered table-condensed'><thead><tr>";
  33. for (int i = 0; i < keys.Length; i++) {
  34. String key = couresScoureMap.Keys.ElementAt(i);
  35. keys[i] = key;
  36. content += "<th>" + key + "</th>";
  37. }
  38. content += "</tr></thead><tbody><tr>";
  39. for (int i = 0; i < keys.Length; i++)
  40. {
  41. String key = keys[i];
  42. content += "<td>" + couresScoureMap[key] + "</td>";
  43. }
  44. content += "</tr></tbody></table>";
  45. }
  46. TableContent.InnerHtml = content;
  47. }
  48. else
  49. {
  50. Response.Redirect("login.aspx");
  51. }
  52. }
  53. }
  54. }