/// <summary> /// 获取数据 /// </summary> /// <param name="strWhere">搜索条件</param> public void getdata(String strWhere) { string currentPage = Request.QueryString["currentPage"]; if (currentPage == null || currentPage.Length <= 0) { currentPage = "1"; } string userType = Session["state"].ToString(); string userCollege = ""; //usertype=2 为分院管理员登录 TeacherBll teaBll = new TeacherBll(); if (userType == "2") { int userCollegeId = teacher.college.ColID; if (strWhere == null || strWhere == "") { userCollege = "collegeId=" + userCollegeId + ""; } else { userCollege = "collegeId=" + userCollegeId + "and" + "(" + strWhere + ")"; } TableBuilder tabuilder = new TableBuilder() { StrTable = "V_Defence", StrWhere = userCollege, IntColType = 0, IntOrder = 0, IntPageNum = int.Parse(currentPage), IntPageSize = pagesize, StrColumn = "defenGroupId", StrColumnlist = "*" }; getCurrentPage = int.Parse(currentPage); ds = teaBll.SelectBypage(tabuilder, out count); } else { TableBuilder tabuilder = new TableBuilder() { StrTable = "V_Defence", StrWhere = strWhere == null || strWhere == "" ? "" : strWhere, IntColType = 0, IntOrder = 0, IntPageNum = int.Parse(currentPage), IntPageSize = pagesize, StrColumn = "defenGroupId", StrColumnlist = "*" }; getCurrentPage = int.Parse(currentPage); ds = teaBll.SelectBypage(tabuilder, out count); } }
public void getdata(string strWhere, int IntPageNum) { string strTeaType = ""; if (strWhere == "") { strTeaType = "teaType=0"; } else { strTeaType = "teaType=0 and "; } TableBuilder tbd = new TableBuilder() { StrTable = "V_Teacher", StrColumn = "teaType", IntColType = 0, IntOrder = 0, StrColumnlist = "teaAccount,teaName,sex,collegeName,phone,Email", IntPageSize = 5, IntPageNum = IntPageNum, StrWhere = strTeaType + strWhere }; ds = teabll.SelectBypage(tbd, out count); // 绑定筛选条件中的学院信息 dsColl = collbll.Select(); }
/// <summary> /// 获取数据 /// </summary> /// <param name="strWhere"></param> public void getdata(string strWhere) { string currentPage = Request.QueryString["currentPage"]; if (currentPage == null || currentPage.Length <= 0) { currentPage = "1"; } //判断身份是否是管理员 string strTeaType = ""; if (strWhere == null || strWhere == "") { strTeaType = "teaType=2"; } else { strTeaType = "teaType=2 and "; } //获取数据 TableBuilder tbd = new TableBuilder() { StrTable = "V_Teacher", StrColumn = "teaAccount", IntColType = 0, IntOrder = 0, StrColumnlist = "*", IntPageSize = pagesize, IntPageNum = int.Parse(currentPage), StrWhere = strTeaType + strWhere }; getCurrentPage = int.Parse(currentPage); ds = teaBll.SelectBypage(tbd, out count); //获取学院所有信息 dsColl = collBll.Select(); }
/// <summary> /// 获取信息 /// </summary> /// <param name="strWhere">查询条件</param> public void getdata(String strWhere) { string currentPage = Request.QueryString["currentPage"]; if (currentPage == null || currentPage.Length <= 0) { currentPage = "1"; } //判断是哪个院系的管理员登录 只加载该院系下的教师 //获取登录者的类型 string userType = Session["state"].ToString(); //string userType = "2"; string usercollege = ""; TeacherBll pro = new TeacherBll(); if (userType == "2") { //如果是分院管理员只加载该分院的教师 Teacher tea = (Teacher)Session["user"]; int usercollegeId = tea.college.ColID; string strTeaType = ""; if (strWhere == null || strWhere == "") { strTeaType = "teaType=1 and "; usercollege = "collegeId=" + "'" + usercollegeId + "'"; } else { strTeaType = "teaType=1 and "; usercollege = "collegeId=" + "'" + usercollegeId + "'" + "and " + "(" + strWhere + ")"; } TableBuilder tabuilder = new TableBuilder() { StrTable = "V_Teacher", StrWhere = strTeaType + usercollege, IntColType = 0, IntOrder = 0, IntPageNum = int.Parse(currentPage), IntPageSize = pagesize, StrColumn = "teaAccount", StrColumnlist = "*" }; getCurrentPage = int.Parse(currentPage); ds = pro.SelectBypage(tabuilder, out count); } else if (userType == "0") { //如果是超管则加载所有教师包括分院管理员 string strTeaType = "teaType = 1"; if (strWhere != null && strWhere != "") { strTeaType = "teaType = 1 and" + "(" + strWhere + ")"; } TableBuilder tabuilder = new TableBuilder() { StrTable = "V_Teacher", StrWhere = strTeaType, IntColType = 0, IntOrder = 0, IntPageNum = int.Parse(currentPage), IntPageSize = pagesize, StrColumn = "teaAccount", StrColumnlist = "*" }; getCurrentPage = int.Parse(currentPage); ds = pro.SelectBypage(tabuilder, out count); } }