menu.aspx.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Web;
  4. using System.Web.UI;
  5. using System.Web.UI.WebControls;
  6. public partial class EditMenu_menu : System.Web.UI.Page
  7. {
  8. // UserData myud = new UserData();
  9. LYS.UserData1 myud = new LYS.UserData1();
  10. string username = "";
  11. string usertype = "";
  12. string userdemp = "";
  13. protected void Page_Load(object sender, EventArgs e)
  14. {
  15. //类别:院管理员、系管理员、督导员、教师
  16. if (Session["UserName"] != null)
  17. {
  18. username = Session["UserName"].ToString();
  19. usertype = Session["UserType"].ToString();
  20. userdemp = Session["UserDemp"].ToString();
  21. }
  22. else if (myud.ReadCookies("UserName").Trim().Length > 0)
  23. {
  24. username = myud.ReadCookies("UserName").Trim();
  25. usertype = myud.ReadCookies("UserType").Trim();
  26. userdemp = myud.ReadCookies("UserDemp").Trim();
  27. }
  28. else
  29. {
  30. Response.Redirect("LoginNew.aspx");
  31. }
  32. Literal2.Text = "欢迎您:" + username;
  33. Literal3.Text = usertype + "." + userdemp ;
  34. Literal1.Text = myud.Prod_menu(usertype).ToString();
  35. }
  36. }