using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class DisplayPJ : System.Web.UI.Page { LYS.UserData1 myud = new LYS.UserData1(); string username = ""; string usertype = ""; string userdemp = ""; string utype = ""; string OP = ""; protected void Page_Load(object sender, EventArgs e) { string myURL = myud.GetAddressUrl().ToString(); if (Session["UserName"] != null) { username = Session["UserName"].ToString(); usertype = Session["UserType"].ToString(); userdemp = Session["UserDemp"].ToString(); } else if (myud.ReadCookies("UserName").Trim().Length > 0) { username = myud.ReadCookies("UserName").Trim(); usertype = myud.ReadCookies("UserType").Trim(); userdemp = myud.ReadCookies("UserDemp").Trim(); } else { Response.Redirect("LoginNew.aspx"); } // string sql = "select * from TKJL where 督导姓名='kcm' and 教师姓名='张XX' and 听课日期=#" + Convert.ToDateTime("2017年9月8日").ToShortDateString() + "#"; //if (Session["Username"] == null) //{ Response.Redirect("LoginNew.aspx"); } //以下为督导员登录显示 // Literal1.Text = myud.DispLineData("Select ID,教师姓名,系部,课程名,督导姓名,点评评价,总评分 from TKJL where 督导姓名='" + Session["Username"].ToString() + "' order by 听课日期 Desc").ToString(); //以下全部显示(超级管理员),最好在页面中添加一个查询功能,可以查询系部,教师,或者听课时间 //if (Request.QueryString["Type"].ToString() !="" || Request .QueryString ["Type"].Equals (null)) if (Request.QueryString.Count > 0) { if (myURL.LastIndexOf("Type") < 0 || myURL.LastIndexOf("OP") < 0) { Response.Write(""); Response.End(); } else { utype = Request.QueryString["Type"].ToString().Trim(); OP = Request.QueryString["OP"].ToString().Trim(); } // Response.Write("u=" + utype + "OP=" + OP); switch (utype) { case "Tea": { //Literal1.Text = myud.DispLineData("Select ID,教师姓名,系部,课程名,督导姓名,综合评价,总评分 from TKJL where 教师姓名='"+username+"' order by 教师姓名").ToString(); Literal1.Text = myud.DispLineDataadmin("Select ID,教师姓名,系部,课程名,听课日期,班级,综合评价 from TKJL where 综合评价 IS NOT NULL and 教师姓名='" + username + "' order by 教师姓名").ToString(); //Response.Write("userdemp=" + userdemp); } break; case "dd": { if (OP.Trim() == "dispzhpj") {//显示综合评价 Literal1.Text = myud.DispLineDataModi("Select ID,教师姓名,系部,课程名,听课日期,班级,综合评价,总评分 from TKJL where 综合评价 IS NOT NULL and 系部='" + userdemp + "' order by 听课日期 Desc", OP).ToString(); } if (OP.Trim() == "dispzhpjAdd") {//显示综合评价添加 Literal1.Text = myud.DispLineDataModi("Select ID,教师姓名,系部,课程名,听课日期,班级,综合评价,总评分 from TKJL where 综合评价 IS NOT NULL and 系部='" + userdemp + "' order by 听课日期 Desc", OP).ToString(); } if (OP.Trim() == "disppj") { //显示评价 Literal1.Text = myud.DispLineDataModi("Select ID,教师姓名,系部,课程名,督导姓名,点评评价,总评分 from TKJL where 督导姓名='" + username + "' and 系部='" + userdemp + "' order by 听课日期 Desc", OP).ToString(); } if (OP.Trim() == "modi") { //可以进行修改DispLineData Literal1.Text = myud.DispLineDataModi("Select ID,教师姓名,系部,课程名,督导姓名,点评评价,总评分 from TKJL where 督导姓名='" + username + "' and 系部='" + userdemp + "' order by 听课日期 Desc", OP).ToString(); } } break; case "xbadmin": { Literal1.Text = myud.DispLineDataModi("Select ID,教师姓名,系部,课程名,督导姓名,点评评价,总评分 from TKJL where 系部='" + userdemp + "' order by 听课日期 Desc",OP).ToString(); } break; case "xyadmin": { Literal1.Text = myud.DispLineDataModi("Select ID,教师姓名,系部,课程名,督导姓名,点评评价,总评分 from TKJL order by 听课日期 Desc",OP).ToString(); } break; // Literal1.Text = myud.DispLineData(sql).ToString(); } } else { Response.Redirect("LoginNew.aspx"); } // Response.Write("userdemp=" + "Select ID,教师姓名,系部,课程名,督导姓名,点评评价,总评分 from TKJL where 督导姓名='" + username + "' and 系部='" + userdemp + "' order by 听课日期 Desc"); } }