using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class Admin_printDISP : 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(); string SQL = ""; //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"); // } //} if (Request.QueryString.Count > 0) { if (myURL.LastIndexOf("utype") < 0) { Response.Write(""); Response.End(); } else { utype = Request.QueryString["utype"].ToString().Trim(); } switch (utype) { case "Tea": { //Literal1.Text = myud.DispLineData("Select ID,教师姓名,系部,课程名,督导姓名,综合评价,总评分 from TKJL where 教师姓名='"+username+"' order by 教师姓名").ToString(); // SQL = "Select ID,教师姓名,系部,课程名,听课日期,班级,综合评价 from TKJL where 综合评价 IS NOT NULL and 教师姓名='" + username + "' order by 教师姓名"; SQL = "Select ID,教师姓名,系部,课程名,听课日期,班级,综合评价 from TKJL where 教师姓名='" + username + "' order by 教师姓名"; //Response.Write("userdemp=" + userdemp); } break; case "dd": { // SQL = "Select ID,教师姓名,系部,课程名,听课日期,班级,点评评价,综合评价,总评分 from TKJL where 综合评价 IS NOT NULL and 教师姓名='" + username + "' and 系部='" + userdemp + "' order by 听课日期 Desc"; SQL = "Select ID,教师姓名,系部,课程名,听课日期,班级,点评评价,综合评价,总评分 from TKJL where 教师姓名='" + username + "' and 系部='" + userdemp + "' order by 听课日期 Desc"; } break; case "xbadmin": { //SQL = "Select ID,教师姓名,系部,课程名,听课日期,班级,点评评价,综合评价,总评分 from TKJL where 综合评价 IS NOT NULL and 系部='" + userdemp + "' order by 听课日期 Desc"; SQL = "Select ID,教师姓名,系部,课程名,听课日期,班级,点评评价,综合评价,总评分 from TKJL where 系部='" + userdemp + "' order by 听课日期 Desc"; } break; case "xyadmin": { SQL = "Select ID,教师姓名,系部,课程名,督导姓名,点评评价,综合评价,总评分 from TKJL order by 听课日期 Desc"; } break; // Literal1.Text = myud.DispLineData(sql).ToString(); } } else { Response.Redirect("../LoginNew.aspx"); } // Literal1.Text = myud.DispLineDataModi("Select ID,教师姓名,系部,课程名,听课日期,班级,综合评价,总评分 from TKJL where 综合评价 IS NOT NULL and 系部='" + userdemp + "' order by 听课日期 Desc", OP).ToString(); Literal1.Text = myud.DispLineDataModi(SQL, "print").ToString(); } }