PageRenderTime 42ms CodeModel.GetById 16ms RepoModel.GetById 1ms app.codeStats 0ms

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

https://github.com/panmingzhi815/SchoolManagementSystem
C# | 53 lines | 50 code | 3 blank | 0 comment | 10 complexity | aa743be9c748415767573c3d53730063 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 DataService.service.dao;
  14. using System.Collections.Generic;
  15. using Domain.Entities;
  16. namespace Domain
  17. {
  18. public partial class index : 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. }
  26. DepartmentService ds = new DepartmentService();
  27. IList<School> schoolList = ds.getSchoolList();
  28. if (schoolList != null && schoolList.Count > 0)
  29. {
  30. SchoolContent.InnerHtml = "<h1>" + schoolList[0].Name + "</h1>" + "<p class='lead'>" + schoolList[0].SimpleDescript + "</p>";
  31. }
  32. IList<Faculty> facultyList = ds.getFacultyList();
  33. string content1 = "";
  34. string content2 = "";
  35. for (int i = 0; i < facultyList.Count; i++) {
  36. Faculty faculty = facultyList[i];
  37. if (i < 3) {
  38. content1 += "<h4>" + faculty.Name + "</h4>";
  39. content1 += "<p>" + faculty.SimpleDescript + "</p>";
  40. }
  41. else if (i > 2 && i < 6) {
  42. content2 += "<h4>" + faculty.Name + "</h4>";
  43. content2 += "<p>" + faculty.SimpleDescript + "</p>";
  44. }
  45. }
  46. FacultyColumn1.InnerHtml = content1;
  47. FacultyColumn2.InnerHtml = content2;
  48. }
  49. }
  50. }