DisplayPJ.aspx.cs 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7. public partial class DisplayPJ : System.Web.UI.Page
  8. {
  9. LYS.UserData1 myud = new LYS.UserData1();
  10. string username = "";
  11. string usertype = "";
  12. string userdemp = "";
  13. string utype = "";
  14. string OP = "";
  15. protected void Page_Load(object sender, EventArgs e)
  16. {
  17. string myURL = myud.GetAddressUrl().ToString();
  18. if (Session["UserName"] != null)
  19. {
  20. username = Session["UserName"].ToString();
  21. usertype = Session["UserType"].ToString();
  22. userdemp = Session["UserDemp"].ToString();
  23. }
  24. else
  25. if (myud.ReadCookies("UserName").Trim().Length > 0)
  26. {
  27. username = myud.ReadCookies("UserName").Trim();
  28. usertype = myud.ReadCookies("UserType").Trim();
  29. userdemp = myud.ReadCookies("UserDemp").Trim();
  30. }
  31. else
  32. {
  33. Response.Redirect("LoginNew.aspx");
  34. }
  35. // string sql = "select * from TKJL where 督导姓名='kcm' and 教师姓名='张XX' and 听课日期=#" + Convert.ToDateTime("2017年9月8日").ToShortDateString() + "#";
  36. //if (Session["Username"] == null)
  37. //{ Response.Redirect("LoginNew.aspx"); }
  38. //以下为督导员登录显示
  39. // Literal1.Text = myud.DispLineData("Select ID,教师姓名,系部,课程名,督导姓名,点评评价,总评分 from TKJL where 督导姓名='" + Session["Username"].ToString() + "' order by 听课日期 Desc").ToString();
  40. //以下全部显示(超级管理员),最好在页面中添加一个查询功能,可以查询系部,教师,或者听课时间
  41. //if (Request.QueryString["Type"].ToString() !="" || Request .QueryString ["Type"].Equals (null))
  42. if (Request.QueryString.Count > 0)
  43. {
  44. if (myURL.LastIndexOf("Type") < 0 || myURL.LastIndexOf("OP") < 0)
  45. {
  46. Response.Write("<script>alert('错误!参数不正确!不能正常显示')</script>");
  47. Response.End();
  48. }
  49. else
  50. {
  51. utype = Request.QueryString["Type"].ToString().Trim();
  52. OP = Request.QueryString["OP"].ToString().Trim();
  53. }
  54. // Response.Write("u=" + utype + "OP=" + OP);
  55. switch (utype)
  56. {
  57. case "Tea":
  58. {
  59. //Literal1.Text = myud.DispLineData("Select ID,教师姓名,系部,课程名,督导姓名,综合评价,总评分 from TKJL where 教师姓名='"+username+"' order by 教师姓名").ToString();
  60. Literal1.Text = myud.DispLineDataadmin("Select ID,教师姓名,系部,课程名,听课日期,班级,综合评价 from TKJL where 综合评价 IS NOT NULL and 教师姓名='" + username + "' order by 教师姓名").ToString();
  61. //Response.Write("userdemp=" + userdemp);
  62. }
  63. break;
  64. case "dd":
  65. {
  66. if (OP.Trim() == "dispzhpj")
  67. {//显示综合评价
  68. Literal1.Text = myud.DispLineDataModi("Select ID,教师姓名,系部,课程名,听课日期,班级,综合评价,总评分 from TKJL where 综合评价 IS NOT NULL and 系部='" + userdemp + "' order by 听课日期 Desc", OP).ToString();
  69. }
  70. if (OP.Trim() == "dispzhpjAdd")
  71. {//显示综合评价添加
  72. Literal1.Text = myud.DispLineDataModi("Select ID,教师姓名,系部,课程名,听课日期,班级,综合评价,总评分 from TKJL where 综合评价 IS NOT NULL and 系部='" + userdemp + "' order by 听课日期 Desc", OP).ToString();
  73. }
  74. if (OP.Trim() == "disppj")
  75. {
  76. //显示评价
  77. Literal1.Text = myud.DispLineDataModi("Select ID,教师姓名,系部,课程名,督导姓名,点评评价,总评分 from TKJL where 督导姓名='" + username + "' and 系部='" + userdemp + "' order by 听课日期 Desc", OP).ToString();
  78. }
  79. if (OP.Trim() == "modi")
  80. {
  81. //可以进行修改DispLineData
  82. Literal1.Text = myud.DispLineDataModi("Select ID,教师姓名,系部,课程名,督导姓名,点评评价,总评分 from TKJL where 督导姓名='" + username + "' and 系部='" + userdemp + "' order by 听课日期 Desc", OP).ToString();
  83. }
  84. }
  85. break;
  86. case "xbadmin":
  87. {
  88. Literal1.Text = myud.DispLineDataModi("Select ID,教师姓名,系部,课程名,督导姓名,点评评价,总评分 from TKJL where 系部='" + userdemp + "' order by 听课日期 Desc",OP).ToString();
  89. }
  90. break;
  91. case "xyadmin":
  92. {
  93. Literal1.Text = myud.DispLineDataModi("Select ID,教师姓名,系部,课程名,督导姓名,点评评价,总评分 from TKJL order by 听课日期 Desc",OP).ToString();
  94. }
  95. break;
  96. // Literal1.Text = myud.DispLineData(sql).ToString();
  97. }
  98. }
  99. else
  100. {
  101. Response.Redirect("LoginNew.aspx");
  102. }
  103. // Response.Write("userdemp=" + "Select ID,教师姓名,系部,课程名,督导姓名,点评评价,总评分 from TKJL where 督导姓名='" + username + "' and 系部='" + userdemp + "' order by 听课日期 Desc");
  104. }
  105. }