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

Language C# Lines 54
MD5 Hash aa743be9c748415767573c3d53730063
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
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 DataService.service.dao;
using System.Collections.Generic;
using Domain.Entities;

namespace Domain
{
    public partial class index : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Student s = (Student)Session["user"];
            if (s != null) {
                welcomeInfo.InnerHtml = "欢迎你," + s.Name;
            }
            DepartmentService ds = new DepartmentService();

            IList<School> schoolList =  ds.getSchoolList();
            if (schoolList != null && schoolList.Count > 0)
            {
                SchoolContent.InnerHtml = "<h1>" + schoolList[0].Name + "</h1>" + "<p class='lead'>" + schoolList[0].SimpleDescript + "</p>";
            }

            IList<Faculty> facultyList = ds.getFacultyList();
            string content1 = "";
            string content2 = "";
            for (int i = 0; i < facultyList.Count; i++) { 
               Faculty faculty = facultyList[i];
               if (i < 3) {
                   content1 += "<h4>" + faculty.Name + "</h4>";
                   content1 += "<p>" + faculty.SimpleDescript + "</p>";
               }
               else if (i > 2 && i < 6) {
                   content2 += "<h4>" + faculty.Name + "</h4>";
                   content2 += "<p>" + faculty.SimpleDescript + "</p>";
               }
            }
            FacultyColumn1.InnerHtml = content1;
            FacultyColumn2.InnerHtml = content2;
        }
    }
}
Back to Top