printDISP.aspx.cs 4.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 Admin_printDISP : 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. string SQL = "";
  19. //if (Session["UserName"] != null)
  20. //{
  21. // username = Session["UserName"].ToString();
  22. // usertype = Session["UserType"].ToString();
  23. // userdemp = Session["UserDemp"].ToString();
  24. //}
  25. //else
  26. //{
  27. // if (myud.ReadCookies("UserName").Trim().Length > 0)
  28. // {
  29. username = myud.ReadCookies("UserName").Trim();
  30. usertype = myud.ReadCookies("UserType").Trim();
  31. userdemp = myud.ReadCookies("UserDemp").Trim();
  32. // }
  33. // else
  34. // {
  35. // Response.Redirect("../LoginNew.aspx");
  36. // }
  37. //}
  38. if (Request.QueryString.Count > 0)
  39. {
  40. if (myURL.LastIndexOf("utype") < 0)
  41. {
  42. Response.Write("<script>alert('错误!非法调用!不能正常显示')</script>");
  43. Response.End();
  44. }
  45. else
  46. {
  47. utype = Request.QueryString["utype"].ToString().Trim();
  48. }
  49. switch (utype)
  50. {
  51. case "Tea":
  52. {
  53. //Literal1.Text = myud.DispLineData("Select ID,教师姓名,系部,课程名,督导姓名,综合评价,总评分 from TKJL where 教师姓名='"+username+"' order by 教师姓名").ToString();
  54. // SQL = "Select ID,教师姓名,系部,课程名,听课日期,班级,综合评价 from TKJL where 综合评价 IS NOT NULL and 教师姓名='" + username + "' order by 教师姓名";
  55. SQL = "Select ID,教师姓名,系部,课程名,听课日期,班级,综合评价 from TKJL where 教师姓名='" + username + "' order by 教师姓名";
  56. //Response.Write("userdemp=" + userdemp);
  57. }
  58. break;
  59. case "dd":
  60. {
  61. // SQL = "Select ID,教师姓名,系部,课程名,听课日期,班级,点评评价,综合评价,总评分 from TKJL where 综合评价 IS NOT NULL and 教师姓名='" + username + "' and 系部='" + userdemp + "' order by 听课日期 Desc";
  62. SQL = "Select ID,教师姓名,系部,课程名,听课日期,班级,点评评价,综合评价,总评分 from TKJL where 教师姓名='" + username + "' and 系部='" + userdemp + "' order by 听课日期 Desc";
  63. }
  64. break;
  65. case "xbadmin":
  66. {
  67. //SQL = "Select ID,教师姓名,系部,课程名,听课日期,班级,点评评价,综合评价,总评分 from TKJL where 综合评价 IS NOT NULL and 系部='" + userdemp + "' order by 听课日期 Desc";
  68. SQL = "Select ID,教师姓名,系部,课程名,听课日期,班级,点评评价,综合评价,总评分 from TKJL where 系部='" + userdemp + "' order by 听课日期 Desc";
  69. }
  70. break;
  71. case "xyadmin":
  72. {
  73. SQL = "Select ID,教师姓名,系部,课程名,督导姓名,点评评价,综合评价,总评分 from TKJL order by 听课日期 Desc";
  74. }
  75. break;
  76. // Literal1.Text = myud.DispLineData(sql).ToString();
  77. }
  78. }
  79. else
  80. {
  81. Response.Redirect("../LoginNew.aspx");
  82. }
  83. // Literal1.Text = myud.DispLineDataModi("Select ID,教师姓名,系部,课程名,听课日期,班级,综合评价,总评分 from TKJL where 综合评价 IS NOT NULL and 系部='" + userdemp + "' order by 听课日期 Desc", OP).ToString();
  84. Literal1.Text = myud.DispLineDataModi(SQL, "print").ToString();
  85. }
  86. }