MyMenu.aspx.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 MyMenu : System.Web.UI.Page
  8. {
  9. LYS.UserData1 myud = new LYS.UserData1();
  10. string username = "";
  11. string usertype = "";
  12. string userdemp = "";
  13. string WorkNumber = "";
  14. protected void Page_Load(object sender, EventArgs e)
  15. {
  16. //类别:院管理员、系管理员、督导员、教师
  17. if (Session["UserName"] != null)
  18. {
  19. username = Session["UserName"].ToString();
  20. usertype = Session["UserType"].ToString();
  21. userdemp = Session["UserDemp"].ToString();
  22. WorkNumber = Session["WorkNumber"].ToString();
  23. }
  24. else if (myud.ReadCookies("UserName").Trim().Length > 0)
  25. {
  26. username = myud.ReadCookies("UserName").Trim();
  27. usertype = myud.ReadCookies("UserType").Trim();
  28. userdemp = myud.ReadCookies("UserDemp").Trim();
  29. WorkNumber = myud.ReadCookies("WorkNumber").Trim();
  30. }
  31. else
  32. {
  33. Response.Redirect("LoginNew.aspx");
  34. }
  35. Literal2.Text = "欢迎您:" + username + "(工号:" + WorkNumber + ")";
  36. Literal3.Text = usertype + "." + userdemp;
  37. Literal1.Text = myud.Prod_menu(usertype).ToString();
  38. }
  39. }