//获取表格数据 public void getPage(String strWhere) { string currentPage = Request.QueryString["currentPage"]; if (currentPage == null || currentPage.Length <= 0) { currentPage = "1"; } TitleRecordBll titlerd = new TitleRecordBll(); Teacher tea = (Teacher)Session["loginuser"]; string teaAccount = tea.TeaAccount; string where1 = "teaAccount = " + teaAccount; string where2 = "teaAccount = " + teaAccount + " and " + strWhere; TableBuilder tabuilder = new TableBuilder() { StrTable = "V_TitleRecord", StrWhere = strWhere == null || strWhere == "" ? where1 : where2, IntColType = 0, IntOrder = 0, IntPageNum = int.Parse(currentPage), IntPageSize = pagesize, StrColumn = "titleRecordId", StrColumnlist = "*" }; getCurrentPage = int.Parse(currentPage); ds = titlerd.SelectBypage(tabuilder, out count); }
/// <summary> /// //获取数据 /// </summary> /// <param name="strWhere">查询字符串</param> public void getPage(String strWhere) { string currentPage = Request.QueryString["currentPage"]; if (currentPage == null || currentPage.Length <= 0) { currentPage = "1"; } TitleRecordBll titlerd = new TitleRecordBll(); TableBuilder tabuilder = new TableBuilder() { StrTable = "V_TitleRecord", StrWhere = strWhere == null ? "" : strWhere, IntColType = 0, IntOrder = 0, IntPageNum = int.Parse(currentPage), IntPageSize = pagesize, StrColumn = "titleRecordId", StrColumnlist = "*" }; getCurrentPage = int.Parse(currentPage); ds = titlerd.SelectBypage(tabuilder, out count); }
protected void Page_Load(object sender, EventArgs e) { string account = "", teaAccount = ""; int college = 0; int state = Convert.ToInt32(Session["state"].ToString()); if (state == 1) { Teacher tea = (Teacher)Session["loginuser"]; account = tea.TeaAccount; college = tea.college.ColID; } else if (state == 0 || state == 2) { Teacher admin = (Teacher)Session["user"]; account = admin.TeaAccount; college = admin.college.ColID; } else if (state == 3) { Student stu = (Student)Session["loginuser"]; account = stu.StuAccount; college = stu.college.ColID; TitleRecordBll trBll = new TitleRecordBll(); bool flag = trBll.selectBystuId(account); if (flag == true) { TableBuilder tbd = new TableBuilder() { StrTable = "V_TitleRecord", StrColumn = "titleRecordId", IntColType = 0, IntOrder = 0, StrColumnlist = "*", IntPageSize = 1, IntPageNum = 1, StrWhere = "stuAccount ='" + account + "'" }; dsTea = trBll.SelectBypage(tbd, out count); teaAccount = dsTea.Tables[0].Rows[0]["teaAccount"].ToString(); } } if (!Page.IsPostBack) { roleId = Request.QueryString["roleId"]; if (roleId == "0") { strteaType = "teaType=0"; newsType = "学校公告"; } else if (roleId == "1") { strteaType = "teaType=1 and teaAccount = '" + teaAccount + "'"; newsType = "学生公告"; } else if (roleId == "2") { strteaType = "teaType=2 and collegeId=" + college; newsType = "学院公告"; } getdata(strteaType); } }