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

Language C# Lines 56
MD5 Hash 359ab08d5cd4b2b35ad9427ef770e19f
Repository https://github.com/panmingzhi815/SchoolManagementSystem.git View Raw File
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Domain.Entities;
using DataService.service.dao;
using System.Collections.Generic;

namespace Domain.asp.front
{
    public partial class score : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Student s = (Student)Session["user"];
            if (s != null) {
                welcomeInfo.InnerHtml = "欢迎你," + s.Name;
                ExamResultService ers = new ExamResultService();
                IList<ExamResult> examResultList = ers.getExamResultByStudent(s);
                string content = "<center><h2>"+s.Name+" 同学成绩单</h2></center>";
                foreach (ExamResult er in examResultList) {
                    content += "<h4>" + er.ExamPlan.Name + "</h4>";
                    IDictionary<string,string> couresScoureMap = er.CouresScoreMap;
                    string[] keys = new string[couresScoureMap.Keys.Count];
                    content += "<table class='table table-striped table-bordered table-condensed'><thead><tr>";
                    for (int i = 0; i < keys.Length; i++) {
                        String key = couresScoureMap.Keys.ElementAt(i);
                        keys[i] = key;
                        content += "<th>" + key + "</th>";
                    }
                    content += "</tr></thead><tbody><tr>";
                    for (int i = 0; i < keys.Length; i++)
                    {
                        String key = keys[i];
                        content += "<td>" + couresScoureMap[key] + "</td>";
                    }
                    content += "</tr></tbody></table>";
                }
                TableContent.InnerHtml = content;
            }
            else
            {
                Response.Redirect("login.aspx");
            }
        }
    }
}
Back to Top