public static Com.DataPack.DataRsp <string> page(string PageIndex, string PageSize, string txtname, string ustat, string schid) { Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>(); if (Com.Session.userid == null) { rsp.code = "expire"; rsp.msg = "你现在登录已过期,请重新登录!"; } else { try { SchSystem.BLL.ServType servtypebll = new SchSystem.BLL.ServType(); string strwhere = " "; Com.Public.PageModelResp pages = new Com.Public.PageModelResp(); pages.PageIndex = int.Parse(PageIndex); pages.PageSize = int.Parse(PageSize); int rowc = 0; int pc = 0; DataTable dt = servtypebll.GetListCols("AutoId,TypeName,TypeCode", strwhere, "AutoId", "DESC", pages.PageIndex, pages.PageSize, ref rowc, ref pc).Tables[0]; pages.PageCount = pc; pages.RowCount = rowc; if (dt.Rows.Count > 0) { pages.list = dt; } rsp.RspData = Newtonsoft.Json.JsonConvert.SerializeObject(pages); } catch (Exception ex) { rsp.code = "excepError"; rsp.msg = ex.Message; } } return(rsp); }
public static string page(string PageIndex, string PageSize, string txtname, string ustat, string cotycode, string schid) { string ret = ""; if (Com.Session.userid == null) { ret = "expire"; } else { SchSystem.BLL.SchInfo userbll = new SchSystem.BLL.SchInfo(); if (schid == "") { schid = "0"; } //Stat:0废弃,1正常,2被删除,正常界面不显示删除,超管界面可以考虑 string strwhere = "Stat<2 "; if (!string.IsNullOrEmpty(cotycode)) { strwhere += " and AreaNo = '" + Com.Public.SqlEncStr(cotycode) + "'"; } if (schid != "0") { strwhere += " and SchId = '" + Com.Public.SqlEncStr(schid) + "'"; } if (!string.IsNullOrEmpty(txtname)) { strwhere += " and SchName like '%" + Com.Public.SqlEncStr(txtname) + "%'"; } if (!string.IsNullOrEmpty(ustat)) { strwhere += " and Stat=" + Com.Public.SqlEncStr(ustat); } Com.Public.PageModelResp pages = new Com.Public.PageModelResp(); pages.PageIndex = int.Parse(PageIndex); pages.PageSize = int.Parse(PageSize); int rowc = 0; int pc = 0; DataTable dt = userbll.GetListCols("*", strwhere, "SchName", "ASC", pages.PageIndex, pages.PageSize, ref rowc, ref pc).Tables[0]; pages.PageCount = pc; pages.RowCount = rowc; if (dt.Rows.Count > 0) { dt.Columns.Add("Ustat"); dt.Columns.Add("Ucity"); for (int i = 0; i < dt.Rows.Count; i++) { dt.Rows[i]["Ustat"] = dt.Rows[i]["Stat"].ToString() == "1" ? "正常" : "停用"; dt.Rows[i]["Ucity"] = dt.Rows[i]["iscity"].ToString() == "1" ? "城区" : "非城区"; } pages.list = dt; } //Newtonsoft.Json.JsonConvert(); string ddd = Newtonsoft.Json.JsonConvert.SerializeObject(pages); ret = Newtonsoft.Json.JsonConvert.SerializeObject(pages); } return(ret); }
public static string page(string PageIndex, string PageSize, string ClassId, string SchId, string Stuname, string GradeId) { Com.Public.PageModelResp pages = new Com.Public.PageModelResp(); pages.PageIndex = int.Parse(PageIndex); pages.PageSize = int.Parse(PageSize); SchSystem.BLL.SchClassUser bllclassuser = new SchSystem.BLL.SchClassUser(); SchSystem.BLL.SchGradeUsers bllgradeuser = new SchSystem.BLL.SchGradeUsers(); string strWhere = "StuStat=1 and SchId=" + Com.Public.SqlEncStr(SchId); if (!string.IsNullOrEmpty(Stuname)) { strWhere += " and stuname LIKE '%" + Com.Public.SqlEncStr(Stuname) + "%'"; } if (GradeId != "-1" && GradeId != "")//获取当前用户的所有年级 { strWhere += " and GradeId=" + Com.Public.SqlEncStr(GradeId); } if (ClassId != "-1" && ClassId != "")//获取当前用户的所有班级 { strWhere += " and ClassId=" + Com.Public.SqlEncStr(ClassId); } int RowCount = 0; int PageCount = 0;//left('00000000',8-len(StuId))+convert(varchar(10),StuId) string cols = " GradeId,ClassId,GradeName,ClassName,StuId,TestNo,StuName,CardNo,Sex,StuNo,TelNo,StudyType,LoginName,'' GenNameO,'' GenLoginNameO ,'' GenTelO,'' GenNameT,'' GenLoginNameT ,'' GenTelT,'0' isdel,'0' isedit,'0' islook"; SchSystem.BLL.SchStuInfoV bllstuv = new SchSystem.BLL.SchStuInfoV(); DataTable dtstuv = bllstuv.GetListCols(cols, strWhere, "StuName", "ASC", pages.PageIndex, pages.PageSize, ref RowCount, ref PageCount).Tables[0]; pages.PageCount = PageCount; pages.RowCount = RowCount; if (dtstuv != null && dtstuv.Rows.Count > 0) { SchSystem.BLL.SchStuGenUV bllstugenv = new SchSystem.BLL.SchStuGenUV(); for (int i = 0; i < dtstuv.Rows.Count; i++)//将家长添加上,并且把权限加上 { //获取家长 DataTable dtgenv = bllstugenv.GetList("GenName,LoginName,TelNo,Relation", "Stat=1 and StuId=" + dtstuv.Rows[i]["StuId"].ToString()).Tables[0]; if (dtgenv != null && dtgenv.Rows.Count > 0) { dtstuv.Rows[i]["GenNameO"] = dtgenv.Rows[0]["GenName"].ToString(); dtstuv.Rows[i]["GenTelO"] = dtgenv.Rows[0]["TelNo"].ToString(); dtstuv.Rows[i]["GenLoginNameO"] = dtgenv.Rows[0]["LoginName"].ToString(); if (dtgenv.Rows.Count > 1) { dtstuv.Rows[i]["GenNameT"] = dtgenv.Rows[1]["GenName"].ToString(); dtstuv.Rows[i]["GenTelT"] = dtgenv.Rows[1]["TelNo"].ToString(); dtstuv.Rows[i]["GenLoginNameT"] = dtgenv.Rows[1]["LoginName"].ToString(); } } pages.list = dtstuv; } } return(Newtonsoft.Json.JsonConvert.SerializeObject(pages)); }
public static Com.DataPack.DataRsp <string> page(string PageIndex, string PageSize) { Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>(); if (Com.Session.userid == null) { rsp.code = "expire"; rsp.msg = "页面已经过期,请重新登录"; } else { try { SchSystem.BLL.SysGrade sysarts = new SchSystem.BLL.SysGrade(); string strwhere = "1=1 "; Com.Public.PageModelResp pages = new Com.Public.PageModelResp(); pages.PageIndex = int.Parse(PageIndex); pages.PageSize = int.Parse(PageSize); int rowc = 0; int pc = 0; DataTable dt = sysarts.GetListCols("AutoId,GradeName,GradeCode,GradeType,'' PerName", strwhere, "GradeType,GradeCode", "ASC", pages.PageIndex, pages.PageSize, ref rowc, ref pc).Tables[0]; pages.PageCount = pc; pages.RowCount = rowc; if (dt.Rows.Count > 0) { SchSystem.BLL.SysPer bllper = new SchSystem.BLL.SysPer(); DataTable dtper = bllper.GetList("PerName,PerCode", " Stat=1 ").Tables[0]; if (dtper.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { dt.Rows[i]["GradeCode"] = dt.Rows[i]["GradeCode"].ToString() + "(" + Com.Public.NumberToChinese(int.Parse(dt.Rows[i]["GradeCode"].ToString().Substring(dt.Rows[i]["GradeCode"].ToString().Length - 3))) + "年级)"; DataRow[] dtr = dtper.Select("PerCode='" + dt.Rows[i]["GradeType"].ToString() + "'"); if (dtr.Length > 0) { dt.Rows[i]["PerName"] = dtr[0]["PerName"].ToString(); } } } //转换所属学段 pages.list = dt; } rsp.data = Newtonsoft.Json.JsonConvert.SerializeObject(pages); } catch (Exception ex) { rsp.code = "error"; rsp.msg = ex.Message; } } return(rsp); }
public static Com.DataPack.DataRsp <string> page(string PageIndex, string PageSize, string txtname, string ustat, string txtcode) { Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>(); if (Com.Session.userid == null) { rsp.code = "expire"; rsp.msg = "页面已经过期,请重新登录"; } else { try { //Stat:0废弃,1正常,2被删除,正常界面不显示删除,超管界面可以考虑 string strwhere = "Stat<2 and SchId='" + Com.Session.schid + "' "; if (!string.IsNullOrEmpty(txtcode)) { strwhere += " and ChnCode = " + int.Parse(Com.Public.SqlEncStr(txtcode)); } if (!string.IsNullOrEmpty(txtname)) { strwhere += " and ChnName like '%" + Com.Public.SqlEncStr(txtname) + "%'"; } if (!string.IsNullOrEmpty(ustat)) { strwhere += " and Stat='" + Com.Public.SqlEncStr(ustat) + "'"; } Com.Public.PageModelResp pages = new Com.Public.PageModelResp(); pages.PageIndex = int.Parse(PageIndex); pages.PageSize = int.Parse(PageSize); int rowc = 0; int pc = 0; SchSystem.BLL.WebSchChn userbll = new SchSystem.BLL.WebSchChn(); string dbcols = "ChnId,Pid,SchId,ChnName,ChnCode,OrderId,Stat,Note"; DataTable dt = userbll.GetListCols(dbcols, strwhere, "ChnCode", "ASC", pages.PageIndex, pages.PageSize, ref rowc, ref pc).Tables[0]; pages.PageCount = pc; pages.RowCount = rowc; if (dt.Rows.Count > 0) { pages.list = dt; } rsp.data = Newtonsoft.Json.JsonConvert.SerializeObject(pages).Replace("\n\r", ""); } catch (Exception ex) { rsp.code = "error"; rsp.msg = ex.Message; } } return(rsp); }
public static Com.DataPack.DataRsp <string> page(string PageIndex, string PageSize) { Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>(); if (Com.Session.userid == null) { rsp.code = "expire"; rsp.msg = "页面已经过期,请重新登录"; } else { try { SchSystem.BLL.SysSub syssub = new SchSystem.BLL.SysSub(); string strwhere = "Stat<2 "; Com.Public.PageModelResp pages = new Com.Public.PageModelResp(); pages.PageIndex = int.Parse(PageIndex); pages.PageSize = int.Parse(PageSize); int rowc = 0; int pc = 0; DataTable dt = syssub.GetListCols("AutoId,SubName,SubCode,Stat", strwhere, "SubCode", "ASC", pages.PageIndex, pages.PageSize, ref rowc, ref pc).Tables[0]; pages.PageCount = pc; pages.RowCount = rowc; if (dt.Rows.Count > 0) { //dt.Columns.Add("Ustat"); //dt.Columns.Add("Ucity"); //for (int i = 0; i < dt.Rows.Count; i++) //{ // dt.Rows[i]["Ustat"] = dt.Rows[i]["Stat"].ToString() == "1" ? "正常" : "停用"; // dt.Rows[i]["Ucity"] = dt.Rows[i]["iscity"].ToString() == "1" ? "城区" : "非城区"; //} pages.list = dt; } rsp.data = Newtonsoft.Json.JsonConvert.SerializeObject(pages); } catch (Exception ex) { rsp.code = "error"; rsp.msg = ex.Message; } } return(rsp); }
public static Com.DataPack.DataRsp <string> page(string PageIndex, string PageSize) { Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>(); if (Com.Session.userid == null) { rsp.code = "expire"; rsp.msg = "你现在登录已过期,请重新登录!"; } else { SchSystem.BLL.ServBusThd servbusthdbll = new SchSystem.BLL.ServBusThd(); string strwhere = "1=1 "; Com.Public.PageModelResp pages = new Com.Public.PageModelResp(); pages.PageIndex = int.Parse(PageIndex); pages.PageSize = int.Parse(PageSize); int rowc = 0; int pc = 0; string dbcols = "BusId,ThdName,ServiceId,FeeCode,CnName,BusMonth,BusNote,BusArea,BusUtype,Mbusid,BusType,BusUrl,Note,ThdMonth"; DataTable dt = servbusthdbll.GetListCols(dbcols, strwhere, "BusId", "DESC", pages.PageIndex, pages.PageSize, ref rowc, ref pc).Tables[0]; pages.PageCount = pc; pages.RowCount = rowc; if (dt.Rows.Count > 0) { dt.Columns.Add("SHENG"); dt.Columns.Add("SHI"); dt.Columns.Add("TUserType"); dt.Columns.Add("TBusMonth"); dt.Columns.Add("TThdMonth"); dt.Columns.Add("TMbusidName"); for (int i = 0; i < dt.Rows.Count; i++) { dt.Rows[i]["SHENG"] = Com.Public.GetSSQ("0", dt.Rows[i]["BusArea"].ToString()); dt.Rows[i]["SHI"] = Com.Public.GetSSQ("1", dt.Rows[i]["BusArea"].ToString()); dt.Rows[i]["TUserType"] = dt.Rows[i]["BusUtype"].ToString() == "1" ? " 老师" : dt.Rows[i]["BusUtype"].ToString() == "2" ? " 家长" : "学生"; dt.Rows[i]["TBusMonth"] = Com.Public.InttoMonth(Convert.ToInt32(dt.Rows[i]["BusMonth"])); dt.Rows[i]["TThdMonth"] = Com.Public.InttoMonth(Convert.ToInt32(dt.Rows[i]["ThdMonth"])); dt.Rows[i]["TMbusidName"] = servbusthdbll.GetServBusNames(" BusId=" + Convert.ToInt32(dt.Rows[i]["Mbusid"])); } pages.list = dt; } rsp.RspData = Newtonsoft.Json.JsonConvert.SerializeObject(pages); } return(rsp); }
public static Com.DataPack.DataRsp <string> page(string PageIndex, string PageSize, string txtname, string ustat, string schid) { Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>(); if (Com.Session.userid == null) { rsp.code = "expire"; rsp.msg = "你现在登录已过期,请重新登录!"; } else { try { SchSystem.BLL.ServSys ssBll = new SchSystem.BLL.ServSys(); string strwhere = ""; //if (schid != "") //{ // strwhere += " and SchId = '" + Com.Public.SqlEncStr(schid) + "'"; //} Com.Public.PageModelResp pages = new Com.Public.PageModelResp(); pages.PageIndex = int.Parse(PageIndex); pages.PageSize = int.Parse(PageSize); int rowc = 0; int pc = 0; string dbcols = "SysName,SysCode,SysUrl"; DataTable dt = ssBll.GetListCols(dbcols, strwhere, "AutoId", "DESC", pages.PageIndex, pages.PageSize, ref rowc, ref pc).Tables[0]; pages.PageCount = pc; pages.RowCount = rowc; if (dt.Rows.Count > 0) { pages.list = dt; } rsp.RspData = Newtonsoft.Json.JsonConvert.SerializeObject(pages); } catch (Exception ex) { rsp.code = "excepError"; rsp.msg = ex.Message; } } return(rsp); }
public static string page(string PageIndex, string PageSize, string UserName) { string ret = ""; if (Com.Session.userid == null) { ret = "expire"; } else { SchSystem.BLL.ServUserForDetail servuserfordetailbll = new SchSystem.BLL.ServUserForDetail(); string strwhere = "1=1 "; if (!string.IsNullOrEmpty(UserName)) { strwhere += " and UserName = '******'"; } Com.Public.PageModelResp pages = new Com.Public.PageModelResp(); pages.PageIndex = int.Parse(PageIndex); pages.PageSize = int.Parse(PageSize); int rowc = 0; int pc = 0; string dbcols = "AutoId,UserName,FromType,RecUser,ServiceId,ServMonth,FeeM,RecTime,EndTime,EditTime,DoNote,CnName,FuncStr,BusType,Usex,UTname,Uareano,Stat"; DataTable dt = servuserfordetailbll.GetListCols(dbcols, strwhere, "AutoId", "ASC", pages.PageIndex, pages.PageSize, ref rowc, ref pc).Tables[0]; pages.PageCount = pc; pages.RowCount = rowc; if (dt.Rows.Count > 0) { dt.Columns.Add("SHENG"); dt.Columns.Add("SHI"); dt.Columns.Add("TServMonth"); for (int i = 0; i < dt.Rows.Count; i++) { dt.Rows[i]["SHENG"] = Com.Public.GetSSQ("0", dt.Rows[i]["Uareano"].ToString()); dt.Rows[i]["SHI"] = Com.Public.GetSSQ("1", dt.Rows[i]["Uareano"].ToString()); dt.Rows[i]["TServMonth"] = Com.Public.InttoMonth(Convert.ToInt32(dt.Rows[i]["ServMonth"])); } pages.list = dt; } ret = Newtonsoft.Json.JsonConvert.SerializeObject(pages); } return(ret); }
public static Com.DataPack.DataRsp <string> page(string PageIndex, string PageSize, string ustat, string txttel) { Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>(); if (Com.Session.userid == null) { rsp.code = "expire"; rsp.msg = "你现在登录已过期,请重新登录!"; } else { try { SchSystem.BLL.ServUser suBll = new SchSystem.BLL.ServUser(); string strwhere = "Stat=1 "; if (!string.IsNullOrEmpty(txttel)) { strwhere += " and UserName = '******'"; } Com.Public.PageModelResp pages = new Com.Public.PageModelResp(); pages.PageIndex = int.Parse(PageIndex); pages.PageSize = int.Parse(PageSize); int rowc = 0; int pc = 0; string dbcols = "UserName,UTname,Uareano"; DataTable dt = suBll.GetListCols(dbcols, strwhere, "AutoId", "ASC", pages.PageIndex, pages.PageSize, ref rowc, ref pc).Tables[0]; pages.PageCount = pc; pages.RowCount = rowc; if (dt.Rows.Count > 0) { pages.list = dt; } rsp.RspData = Newtonsoft.Json.JsonConvert.SerializeObject(pages); } catch (Exception ex) { rsp.code = "excepError"; rsp.msg = ex.Message; } } return(rsp); }
public static Com.DataPack.DataRsp <string> page(string PageIndex, string PageSize) { Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>(); if (Com.Session.userid == null) { rsp.code = "expire"; rsp.msg = "页面已经过期,请重新登录"; } else { try { SchSystem.BLL.SysFasc sysfasc = new SchSystem.BLL.SysFasc(); string strwhere = "Stat<2 "; Com.Public.PageModelResp pages = new Com.Public.PageModelResp(); pages.PageIndex = int.Parse(PageIndex); pages.PageSize = int.Parse(PageSize); int rowc = 0; int pc = 0; DataTable dt = sysfasc.GetListCols("AutoId,FascName,FascCode,Stat", strwhere, "FascCode", "ASC", pages.PageIndex, pages.PageSize, ref rowc, ref pc).Tables[0]; pages.PageCount = pc; pages.RowCount = rowc; if (dt.Rows.Count > 0) { pages.list = dt; } rsp.data = Newtonsoft.Json.JsonConvert.SerializeObject(pages); } catch (Exception ex) { rsp.code = "error"; rsp.msg = ex.Message; } } return(rsp); }
public static Com.DataPack.DataRsp <string> page(string PageIndex, string PageSize, string txtname, string cotycode, string schid) { Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>(); if (Com.Session.userid == null) { rsp.code = "expire"; rsp.msg = "页面已经过期,请重新登录"; } else { try { SchSystem.BLL.SchThdInfo thdbll = new SchSystem.BLL.SchThdInfo(); string strwhere = " "; if (!string.IsNullOrEmpty(schid)) { strwhere += " SchId = '" + Com.Public.SqlEncStr(schid) + "'"; } Com.Public.PageModelResp pages = new Com.Public.PageModelResp(); pages.PageIndex = int.Parse(PageIndex); pages.PageSize = int.Parse(PageSize); int rowc = 0; int pc = 0; DataTable dt = thdbll.GetListCols("*", strwhere, "", "", pages.PageIndex, pages.PageSize, ref rowc, ref pc).Tables[0]; pages.PageCount = pc; pages.RowCount = rowc; pages.list = dt; rsp.data = Newtonsoft.Json.JsonConvert.SerializeObject(pages); } catch (Exception ex) { rsp.code = "error"; rsp.msg = ex.Message; } } return(rsp); }
public static Com.DataPack.DataRsp <string> page(string PageIndex, string PageSize, string txtname, string ustat, string cotycode, string aprovserch, string acityserch, string schname) { Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>(); if (Com.Session.userid == null) { rsp.code = "expire"; rsp.msg = "页面已经过期,请重新登录"; } else { try { SchSystem.BLL.SchInfo userbll = new SchSystem.BLL.SchInfo(); //Stat:0废弃,1正常,2被删除,正常界面不显示删除,超管界面可以考虑 string strwhere = "Stat<2 "; if (!string.IsNullOrEmpty(cotycode)) { strwhere += " and AreaNo = '" + Com.Public.SqlEncStr(cotycode) + "'"; } if (!string.IsNullOrEmpty(aprovserch)) { strwhere += " and left(AreaNo,2) = '" + Com.Public.SqlEncStr(aprovserch.Substring(0, 2)) + "'"; } if (!string.IsNullOrEmpty(acityserch)) { strwhere += " and left(AreaNo,4) = '" + Com.Public.SqlEncStr(acityserch.Substring(0, 4)) + "'"; } if (!string.IsNullOrEmpty(schname)) { strwhere += " and SchName like '%" + Com.Public.SqlEncStr(schname) + "%'"; } if (!string.IsNullOrEmpty(txtname)) { strwhere += " and SchId = '" + Com.Public.SqlEncStr(txtname) + "'"; } if (!string.IsNullOrEmpty(ustat)) { strwhere += " and HomeschServStat=" + Com.Public.SqlEncStr(ustat); } string currentYear = ""; if (DateTime.Now.Month < 8) { currentYear = (DateTime.Now.Year - 1).ToString(); } else { currentYear = DateTime.Now.Year.ToString(); } Com.Public.PageModelResp pages = new Com.Public.PageModelResp(); pages.PageIndex = int.Parse(PageIndex); pages.PageSize = int.Parse(PageSize); int rowc = 0; int pc = 0; string dbcols = "SchId,SchName,HomeSchPlatName,HomeSchPlatUrl,HomeSchPlatIco,HomeSchPlatIP,SchMaster,SchoolSection,ServiceName,Artisan,SchCreator,RecTime,HomeschServStat,AreaNo"; DataTable dt = userbll.GetListCols(dbcols, strwhere, "SchName", "ASC", pages.PageIndex, pages.PageSize, ref rowc, ref pc).Tables[0]; pages.PageCount = pc; pages.RowCount = rowc; if (dt.Rows.Count > 0) { dt.Columns.Add("SHENG"); dt.Columns.Add("SHI"); dt.Columns.Add("QU"); dt.Columns.Add("graduated"); dt.Columns.Add("SoureName"); dt.Columns.Add("SchSubNames"); for (int i = 0; i < dt.Rows.Count; i++) { string[] areanames = Com.Public.GetArea(dt.Rows[i]["AreaNo"].ToString()).Split('|'); dt.Rows[i]["SHENG"] = areanames[0]; dt.Rows[i]["SHI"] = areanames[1]; dt.Rows[i]["QU"] = areanames[2]; //查询最近毕业年级 SchSystem.BLL.SchGradeInfo sgibll = new SchSystem.BLL.SchGradeInfo(); //dt.Rows[i]["graduated"] = sgibll.GetGradedYear("SchId=" + dt.Rows[i]["SchId"].ToString() + " and IsFinish=1"); string gradecurrent = " and isfinish=1 and ((left(GradeCode,1)='4' and " + currentYear + "-GradeYear=3) or (left(GradeCode,1)='3' and " + currentYear + "-GradeYear=3) or (left(GradeCode,1)='2' and " + currentYear + "-GradeYear=6) or (left(GradeCode,1)='1' and " + currentYear + "-GradeYear=5))"; dt.Rows[i]["graduated"] = sgibll.GetGradedYear("SchId=" + dt.Rows[i]["SchId"].ToString() + gradecurrent); //查询子模块 SchSystem.BLL.SchAppRoleXXT sarxxtBll = new SchSystem.BLL.SchAppRoleXXT(); DataTable dtsarxxt = sarxxtBll.GetList("SchId='" + dt.Rows[i]["SchId"].ToString() + "'").Tables[0]; if (dtsarxxt.Rows.Count > 0) { string[] sarsAppCodearr = dtsarxxt.Rows[0]["AppStr"].ToString().Split(','); StringBuilder sarsAppCodesb = new StringBuilder(); StringBuilder sasSoureName = new StringBuilder(); for (int j = 0; j < sarsAppCodearr.Length; j++) { sarsAppCodesb.Append(sarsAppCodearr[j] + ","); } SchSystem.BLL.SchAppXXT saxxtBll = new SchSystem.BLL.SchAppXXT(); if (sarsAppCodesb.ToString() != "") { try { DataTable dtsas = saxxtBll.GetList("AppName", "AppCode in (" + sarsAppCodesb.ToString().Substring(0, sarsAppCodesb.ToString().Length - 1) + ")").Tables[0]; if (dtsas.Rows.Count > 0) { foreach (DataRow dr in dtsas.Rows) { sasSoureName.Append(dr["AppName"] + ","); } dt.Rows[i]["SoureName"] = sasSoureName.ToString().Substring(0, sasSoureName.Length - 1); } } catch (Exception e) { } } else { dt.Rows[i]["SoureName"] = ""; } } //查询科目 SchSystem.BLL.SchSub ssBll = new SchSystem.BLL.SchSub(); dt.Rows[i]["SchSubNames"] = ssBll.GetSubNames("Stat=1 and SchId='" + dt.Rows[i]["SchId"].ToString() + "'"); } pages.list = dt; } rsp.data = Newtonsoft.Json.JsonConvert.SerializeObject(pages); } catch (Exception ex) { rsp.code = "error"; rsp.msg = ex.Message; } } return(rsp); }
public static Com.DataPack.DataRsp <string> page(string PageIndex, string PageSize, string txtname, string ustat, string cotycode, string schid, string aprovserch, string acityserch, string txtschid) { Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>(); if (Com.Session.userid == null) { rsp.code = "expire"; rsp.msg = "页面已经过期,请重新登录"; } else { try { SchSystem.BLL.SchInfo userbll = new SchSystem.BLL.SchInfo(); if (schid == "") { schid = "0"; } //Stat:0废弃,1正常,2被删除,正常界面不显示删除,超管界面可以考虑 string strwhere = "Stat<2 "; if (!string.IsNullOrEmpty(cotycode)) { strwhere += " and AreaNo = '" + Com.Public.SqlEncStr(cotycode) + "'"; } if (!string.IsNullOrEmpty(aprovserch)) { strwhere += " and left(AreaNo,2) = '" + Com.Public.SqlEncStr(aprovserch.Substring(0, 2)) + "'"; } if (!string.IsNullOrEmpty(acityserch)) { strwhere += " and left(AreaNo,4) = '" + Com.Public.SqlEncStr(acityserch.Substring(0, 4)) + "'"; } if (!string.IsNullOrEmpty(txtschid)) { strwhere += " and SchId = " + int.Parse(Com.Public.SqlEncStr(txtschid)); } else { if (schid != "0") { strwhere += " and SchId = '" + Com.Public.SqlEncStr(schid) + "'"; } } if (!string.IsNullOrEmpty(txtname)) { strwhere += " and SchName like '%" + Com.Public.SqlEncStr(txtname) + "%'"; } if (!string.IsNullOrEmpty(ustat)) { strwhere += " and Stat='1' and SonSysStat='" + Com.Public.SqlEncStr(ustat) + "'"; } string currentYear = ""; if (DateTime.Now.Month < 8) { currentYear = (DateTime.Now.Year - 1).ToString(); } else { currentYear = DateTime.Now.Year.ToString(); } Com.Public.PageModelResp pages = new Com.Public.PageModelResp(); pages.PageIndex = int.Parse(PageIndex); pages.PageSize = int.Parse(PageSize); int rowc = 0; int pc = 0; string dbcols = "SchId,SchName,PlatformIP,AloneUser,AreaNo,AloneTime,PlatformUrl,IsAlone"; DataTable dt = userbll.GetListCols(dbcols, strwhere, "SchName", "ASC", pages.PageIndex, pages.PageSize, ref rowc, ref pc).Tables[0]; pages.PageCount = pc; pages.RowCount = rowc; if (dt.Rows.Count > 0) { dt.Columns.Add("SHENG"); dt.Columns.Add("SHI"); dt.Columns.Add("QU"); for (int i = 0; i < dt.Rows.Count; i++) { string[] areanames = Com.Public.GetArea(dt.Rows[i]["AreaNo"].ToString()).Split('|'); dt.Rows[i]["SHENG"] = areanames[0]; dt.Rows[i]["SHI"] = areanames[1]; dt.Rows[i]["QU"] = areanames[2]; } pages.list = dt; } rsp.data = Newtonsoft.Json.JsonConvert.SerializeObject(pages).Replace("\n\r", ""); } catch (Exception ex) { rsp.code = "error"; rsp.msg = ex.Message; } } return(rsp); }
public static Com.DataPack.DataRsp <string> page(string PageIndex, string PageSize, string txtname, string BusinessType, string txtcode, string txtrange, string txtbusplat) { Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>(); if (Com.Session.userid == null) { rsp.code = "expire"; rsp.msg = "你现在登录已过期,请重新登录!"; } else { SchSystem.BLL.ServFunc sfcBll = new SchSystem.BLL.ServFunc(); string strwhere = "1=1"; if (!string.IsNullOrEmpty(txtname)) { strwhere += " and FuncName='" + txtname + "'"; } if (!string.IsNullOrEmpty(txtcode)) { strwhere += " and FuncCode='" + txtcode + "'"; } if (!string.IsNullOrEmpty(txtrange)) { strwhere += "and FuncRange='" + txtrange + "'"; } if (!string.IsNullOrEmpty(txtbusplat)) { strwhere += " and FuncSyss like '%'+(select SysCode from ServSys where SysName='" + txtbusplat + "')+'%'"; } if (!string.IsNullOrEmpty(BusinessType)) { strwhere += " and ServType.TypeCode='" + BusinessType + "'"; } Com.Public.PageModelResp pages = new Com.Public.PageModelResp(); pages.PageIndex = int.Parse(PageIndex); pages.PageSize = int.Parse(PageSize); int rowc = 0; int pc = 0; try { string dbcols = "ServFunc.AutoId,FuncName,FuncCode,ServFunc.TypeCode,FuncRange,FuncSet,FuncNote,FuncSyss,FuncDes,TypeName"; DataTable dt = sfcBll.GetListCols(dbcols, strwhere, "ServFunc.AutoId", "DESC", pages.PageIndex, pages.PageSize, ref rowc, ref pc).Tables[0]; pages.PageCount = pc; pages.RowCount = rowc; if (dt.Rows.Count > 0) { dt.Columns.Add("FuncSyssName"); for (int i = 0; i < dt.Rows.Count; i++) { //所属业务平台 string FuncSyss = dt.Rows[i]["FuncSyss"].ToString(); if (FuncSyss != "") { string[] FuncSyssArr = FuncSyss.Split(','); string FuncSysstr = ""; foreach (string s in FuncSyssArr) { FuncSysstr += "'" + s + "',"; } FuncSyss = FuncSysstr.Substring(0, FuncSysstr.Length - 1); } dt.Rows[i]["FuncSyssName"] = sfcBll.GetFuncNames("SysCode in (" + FuncSyss + ")"); //附加设置信息 string autoid = dt.Rows[i]["AutoId"].ToString(); SchSystem.BLL.ServFuncExt sfeBll = new SchSystem.BLL.ServFuncExt(); DataTable dtsfext = sfeBll.GetList("*", "FuncId='" + autoid + "'").Tables[0]; StringBuilder sbstr = new StringBuilder(); //string perstr = "", substr = "", gradestr = "", utname = "", matstr = ""; if (dtsfext.Rows.Count > 0) { for (int j = 0; j < dtsfext.Rows.Count; j++) { if (dtsfext.Rows[j]["NapeCode"].ToString() == "prd") { SchSystem.BLL.SysPer spBll = new SchSystem.BLL.SysPer(); DataTable dtres = spBll.GetList("PerName", "PerCode in(" + dtsfext.Rows[j]["NapeCodes"].ToString() + ") order by convert(int,PerCode)").Tables[0]; sbstr.Append("学段:"); for (int z = 0; z < dtres.Rows.Count; z++) { sbstr.Append(dtres.Rows[z]["PerName"].ToString() + ","); } sbstr.ToString().Substring(0, sbstr.ToString().Length - 1); } if (dtsfext.Rows[j]["NapeCode"].ToString() == "grd") { SchSystem.BLL.SysGrade sgBll = new SchSystem.BLL.SysGrade(); DataTable dtres = sgBll.GetList("GradeName", "GradeCode in(" + dtsfext.Rows[j]["NapeCodes"].ToString() + ")").Tables[0]; sbstr.Append("年级:"); for (int z = 0; z < dtres.Rows.Count; z++) { sbstr.Append(dtres.Rows[z]["GradeName"].ToString() + ","); } sbstr.ToString().Substring(0, sbstr.ToString().Length - 1); } if (dtsfext.Rows[j]["NapeCode"].ToString() == "sub") { SchSystem.BLL.SysSub ssBll = new SchSystem.BLL.SysSub(); DataTable dtres = ssBll.GetList("SubName", "SubCode in(" + dtsfext.Rows[j]["NapeCodes"].ToString() + ")").Tables[0]; sbstr.Append("科目:"); for (int z = 0; z < dtres.Rows.Count; z++) { sbstr.Append(dtres.Rows[z]["SubName"].ToString() + ","); } sbstr.ToString().Substring(0, sbstr.ToString().Length - 1); } if (dtsfext.Rows[j]["NapeCode"].ToString() == "utp") { SchSystem.BLL.SysUType sutBll = new SchSystem.BLL.SysUType(); DataTable dtres = sutBll.GetList("UTypeName", "UTypeCode in(" + dtsfext.Rows[j]["NapeCodes"].ToString() + ")").Tables[0]; sbstr.Append("角色:"); for (int z = 0; z < dtres.Rows.Count; z++) { sbstr.Append(dtres.Rows[z]["UTypeName"].ToString() + ","); } sbstr.ToString().Substring(0, sbstr.ToString().Length - 1); } if (dtsfext.Rows[j]["NapeCode"].ToString() == "mat") { SchSystem.BLL.SysMater smBll = new SchSystem.BLL.SysMater(); DataTable dtres = smBll.GetList("MaterName", "MaterCode in(" + dtsfext.Rows[j]["NapeCodes"].ToString() + ")").Tables[0]; sbstr.Append("教版:"); for (int z = 0; z < dtres.Rows.Count; z++) { sbstr.Append(dtres.Rows[z]["MaterName"].ToString() + ","); } sbstr.ToString().Substring(0, sbstr.ToString().Length - 1); } } dt.Rows[i]["FuncSet"] = sbstr.ToString(); } } pages.list = dt; } } catch (Exception ex) { rsp.code = "excepError"; rsp.msg = ex.Message; } rsp.RspData = Newtonsoft.Json.JsonConvert.SerializeObject(pages); } return(rsp); }
public static Com.DataPack.DataRsp <string> page(string PageIndex, string PageSize, string txtname, string ustat, string cotycode, string schid, string aprovserch, string acityserch, string txtschid) { Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>(); if (Com.Session.userid == null) { rsp.code = "expire"; rsp.msg = "页面已经过期,请重新登录"; } else { try { SchSystem.BLL.SchInfo userbll = new SchSystem.BLL.SchInfo(); SchSystem.BLL.SchGradeInfo schgradebll = new SchSystem.BLL.SchGradeInfo(); string strwhere = "Stat<2 "; if (!string.IsNullOrEmpty(cotycode)) { strwhere += " and AreaNo = '" + Com.Public.SqlEncStr(cotycode) + "'"; } if (!string.IsNullOrEmpty(aprovserch)) { strwhere += " and left(AreaNo,2) = '" + Com.Public.SqlEncStr(aprovserch.Substring(0, 2)) + "'"; } if (!string.IsNullOrEmpty(acityserch)) { strwhere += " and left(AreaNo,4) = '" + Com.Public.SqlEncStr(acityserch.Substring(0, 4)) + "'"; } if (!string.IsNullOrEmpty(txtschid)) { strwhere += " and SchId = " + int.Parse(Com.Public.SqlEncStr(txtschid)); } else { if (schid != "0") { strwhere += " and SchId = '" + Com.Public.SqlEncStr(schid) + "'"; } } if (!string.IsNullOrEmpty(ustat)) { if (ustat == "1") { strwhere += " and schid in (select schid from SchThdInfo)"; } else { strwhere += " and schid not in (select schid from SchThdInfo)"; } } //"schid in (select schid from SchThdInfo)" if (!string.IsNullOrEmpty(txtname)) { strwhere += " and SchName like '%" + Com.Public.SqlEncStr(txtname) + "%'"; } Com.Public.PageModelResp pages = new Com.Public.PageModelResp(); pages.PageIndex = int.Parse(PageIndex); pages.PageSize = int.Parse(PageSize); int rowc = 0; int pc = 0; SchSystem.BLL.SchThdInfo thdbll = new SchSystem.BLL.SchThdInfo(); string clos = "SchId,SchName,AreaNo"; DataTable dt = userbll.GetListCols(clos, strwhere, "SchName", "", pages.PageIndex, pages.PageSize, ref rowc, ref pc).Tables[0]; pages.PageCount = pc; pages.RowCount = rowc; if (dt.Rows.Count > 0) { dt.Columns.Add("Ustat"); dt.Columns.Add("SHENG"); dt.Columns.Add("SHI"); dt.Columns.Add("QU"); for (int i = 0; i < dt.Rows.Count; i++) { bool thdbool = thdbll.Exists(int.Parse(dt.Rows[i]["SchId"].ToString())); if (thdbool) { dt.Rows[i]["Ustat"] = "有"; } else { dt.Rows[i]["Ustat"] = "无"; } string[] areanames = Com.Public.GetArea(dt.Rows[i]["AreaNo"].ToString()).Split('|'); dt.Rows[i]["SHENG"] = areanames[0]; dt.Rows[i]["SHI"] = areanames[1]; dt.Rows[i]["QU"] = areanames[2]; } pages.list = dt; } rsp.data = Newtonsoft.Json.JsonConvert.SerializeObject(pages); } catch (Exception ex) { rsp.code = "error"; rsp.msg = ex.Message; } } return(rsp); }
public static Com.DataPack.DataRsp <string> page(string PageIndex, string PageSize, string txtname, string txtcard, string clssid, string gradeid, string schid, string cotyid, string cityid, string provid, string iscard) { Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>(); if (Com.Session.userid == null) { rsp.code = "expire"; rsp.msg = "页面已经过期,请重新登录"; } else { try { SchSystem.BLL.SchStuInfoV userbll = new SchSystem.BLL.SchStuInfoV(); //Stat:0废弃,1正常,2被删除,正常界面不显示删除,超管界面可以考虑 string strwhere = " 1=1 "; //SysType if (!string.IsNullOrEmpty(txtname)) //按学生姓名查询 { strwhere += " and StuName like '%" + Com.Public.SqlEncStr(txtname) + "%'"; } if (!string.IsNullOrEmpty(txtcard))//按卡地址查 { strwhere += " and CardNo like '%" + Com.Public.SqlEncStr(txtcard) + "%'"; } if (iscard == "1")//已有卡 { strwhere += " and len(CardNo)>7 "; } else if (iscard == "0")//无卡 { strwhere += " and len(CardNo)<8 "; } if (!string.IsNullOrEmpty(clssid)) { strwhere += " and ClassId= " + Com.Public.SqlEncStr(clssid); } if (!string.IsNullOrEmpty(gradeid)) { strwhere += " and GradeId= " + Com.Public.SqlEncStr(gradeid); } if (!string.IsNullOrEmpty(schid)) { strwhere += " and SchId= " + Com.Public.SqlEncStr(schid); } if (!string.IsNullOrEmpty(cotyid)) { strwhere += " and AreaNo= '" + Com.Public.SqlEncStr(cotyid) + "'"; } if (!string.IsNullOrEmpty(cityid)) { strwhere += " and left(AreaNo,4)= '" + Com.Public.SqlEncStr(cityid.Substring(0, 4)) + "'"; } if (!string.IsNullOrEmpty(provid)) { strwhere += " and left(AreaNo,2)= '" + Com.Public.SqlEncStr(provid.Substring(0, 2)) + "'"; } Com.Public.PageModelResp pages = new Com.Public.PageModelResp(); pages.PageIndex = int.Parse(PageIndex); pages.PageSize = int.Parse(PageSize); int rowc = 0; int pc = 0; DataTable dt = userbll.GetListCols("AreaNo,SchName,GradeName,ClassName,StuId,StuName,CardNo", strwhere, "StuName", "ASC", pages.PageIndex, pages.PageSize, ref rowc, ref pc).Tables[0]; pages.PageCount = pc; pages.RowCount = rowc; if (dt.Rows.Count > 0) { dt.Columns.Add("SHENG"); dt.Columns.Add("SHI"); dt.Columns.Add("QU"); for (int i = 0; i < dt.Rows.Count; i++) { string[] areanames = Com.Public.GetArea(dt.Rows[i]["AreaNo"].ToString()).Split('|'); dt.Rows[i]["SHENG"] = areanames[0]; dt.Rows[i]["SHI"] = areanames[1]; dt.Rows[i]["QU"] = areanames[2]; } //dt.Columns.Add("Dpts"); //获取关联的部门 pages.list = dt; } rsp.data = Newtonsoft.Json.JsonConvert.SerializeObject(pages); } catch (Exception ex) { rsp.code = "error"; rsp.msg = ex.Message; } } return(rsp); }
public static string page(string PageIndex, string PageSize, string ClassId, string SchId, string Stuname, string GradeId) { bool islist = false; Com.Public.PageModelResp pages = new Com.Public.PageModelResp(); pages.PageIndex = int.Parse(PageIndex); pages.PageSize = int.Parse(PageSize); SchSystem.BLL.SchClassUser bllclassuser = new SchSystem.BLL.SchClassUser(); SchSystem.BLL.SchGradeUsers bllgradeuser = new SchSystem.BLL.SchGradeUsers(); #region 添加按钮和列表显示权限 pages.isadd = false; if (Com.SoureSession.Souresystype == "1")//学校超管 { islist = true; if (GradeId == "-1" || ClassId == "-1" || GradeId == "" || ClassId == "") //系统编辑状态为0,或者年级,班级其中一个选择了全部,则不允许出现添加按钮 { pages.isadd = false; } else { pages.isadd = true; } } else//普通老师账号 { if (bllclassuser.ExistsIsMs(Com.Public.SqlEncStr(ClassId), Com.SoureSession.Soureuserid, Com.SoureSession.Soureschid, 1) == true)//班主任 { if (Com.Session.appeditstat == "1") { pages.isadd = true; } islist = true; } else { pages.isadd = false; if (bllgradeuser.ExistsGrade(Com.Public.SqlEncStr(GradeId), Com.SoureSession.Soureschid, Com.SoureSession.Soureuserid) == true)//年级主任 { islist = true; } if (bllclassuser.ExistsIsMs(Com.Public.SqlEncStr(ClassId), Com.SoureSession.Soureuserid, Com.SoureSession.Soureschid, 0) == true)//任课老师 { islist = true; } } if (Com.Public.IsUserVal(Com.Session.userrolestr, 2)) { islist = true; } ; } #endregion if (islist) { string strWhere = "StuStat=1 "; if (!string.IsNullOrEmpty(Stuname)) { strWhere += " and stuname LIKE '%" + Com.Public.SqlEncStr(Stuname) + "%'"; } if (GradeId == "-1" || GradeId == "")//获取当前用户的所有年级 { strWhere += " and GradeId in (" + Com.Public.GetIdsAllStu("4", Com.SoureSession.Soureschid) + ")"; } else { strWhere += " and GradeId=" + Com.Public.SqlEncStr(GradeId); } if (ClassId == "-1" || ClassId == "")//获取当前用户的所有班级 { if (GradeId == "") { GradeId = "-1"; } strWhere += " and ClassId in (" + Com.Public.GetIdsAllStu("5", Com.Public.SqlEncStr(GradeId)) + ")"; } else { strWhere += " and ClassId=" + Com.Public.SqlEncStr(ClassId); } int RowCount = 0; int PageCount = 0;//left('00000000',8-len(StuId))+convert(varchar(10),StuId) string cols = " GradeId,ClassId,GradeName,ClassName,StuId,TestNo,StuName,CardNo,Sex,StuNo,TelNo,StudyType,LoginName,'' GenNameO,'' GenLoginNameO ,'' GenTelO,'' GenNameT,'' GenLoginNameT ,'' GenTelT,'0' isdel,'0' isedit,'0' islook"; SchSystem.BLL.SchStuInfoV bllstuv = new SchSystem.BLL.SchStuInfoV(); DataTable dtstuv = bllstuv.GetListCols(cols, strWhere, "StuName", "ASC", pages.PageIndex, pages.PageSize, ref RowCount, ref PageCount).Tables[0]; pages.PageCount = PageCount; pages.RowCount = RowCount; if (dtstuv != null && dtstuv.Rows.Count > 0) { SchSystem.BLL.SchStuGenUV bllstugenv = new SchSystem.BLL.SchStuGenUV(); for (int i = 0; i < dtstuv.Rows.Count; i++)//将家长添加上,并且把权限加上 { //获取家长 DataTable dtgenv = bllstugenv.GetList("GenName,LoginName,TelNo,Relation", "Stat=1 and StuId=" + dtstuv.Rows[i]["StuId"].ToString()).Tables[0]; if (dtgenv != null && dtgenv.Rows.Count > 0) { dtstuv.Rows[i]["GenNameO"] = dtgenv.Rows[0]["GenName"].ToString(); dtstuv.Rows[i]["GenTelO"] = dtgenv.Rows[0]["TelNo"].ToString(); dtstuv.Rows[i]["GenLoginNameO"] = dtgenv.Rows[0]["LoginName"].ToString(); if (dtgenv.Rows.Count > 1) { dtstuv.Rows[i]["GenNameT"] = dtgenv.Rows[1]["GenName"].ToString(); dtstuv.Rows[i]["GenTelT"] = dtgenv.Rows[1]["TelNo"].ToString(); dtstuv.Rows[i]["GenLoginNameT"] = dtgenv.Rows[1]["LoginName"].ToString(); } } //权限 if (Com.SoureSession.Souresystype == "1") //学校超管,可看 { if (Com.Session.appeditstat == "1") //系统未被屏蔽编辑功能,则可编辑和删除 { dtstuv.Rows[i]["isdel"] = "1"; dtstuv.Rows[i]["isedit"] = "1"; } dtstuv.Rows[i]["islook"] = "1"; } else//普通老师账号 { if (bllclassuser.ExistsIsMs(dtstuv.Rows[i]["ClassId"].ToString(), Com.SoureSession.Soureuserid, Com.SoureSession.Soureschid, 1) == true)//班主任可查看 { dtstuv.Rows[i]["islook"] = "1"; if (Com.Session.appeditstat == "1") { dtstuv.Rows[i]["isdel"] = "1"; dtstuv.Rows[i]["isedit"] = "1"; } } else { if (bllgradeuser.ExistsGrade(dtstuv.Rows[i]["GradeId"].ToString(), Com.SoureSession.Soureschid, Com.SoureSession.Soureuserid) == true)//年级主任 { islist = true; dtstuv.Rows[i]["islook"] = "1"; } } if (Com.Public.IsUserVal(Com.Session.userrolestr, 2)) { dtstuv.Rows[i]["islook"] = "1"; islist = true; } } } pages.list = dtstuv; } } return(Newtonsoft.Json.JsonConvert.SerializeObject(pages)); }
public static Com.DataPack.DataRsp <string> page(string PageIndex, string PageSize, string txtname, string ustat, string cotycode, string schid, string aprovserch, string acityserch, string txtschid) { Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>(); if (Com.Session.userid == null) { rsp.code = "expire"; rsp.msg = "页面已经过期,请重新登录"; } else { try { SchSystem.BLL.SchInfo userbll = new SchSystem.BLL.SchInfo(); if (schid == "") { schid = "0"; } //Stat:0废弃,1正常,2被删除,正常界面不显示删除,超管界面可以考虑 string strwhere = "Stat<2 "; if (!string.IsNullOrEmpty(cotycode)) { strwhere += " and AreaNo = '" + Com.Public.SqlEncStr(cotycode) + "'"; } if (!string.IsNullOrEmpty(aprovserch)) { strwhere += " and left(AreaNo,2) = '" + Com.Public.SqlEncStr(aprovserch.Substring(0, 2)) + "'"; } if (!string.IsNullOrEmpty(acityserch)) { strwhere += " and left(AreaNo,4) = '" + Com.Public.SqlEncStr(acityserch.Substring(0, 4)) + "'"; } if (!string.IsNullOrEmpty(txtschid)) { strwhere += " and SchId = " + int.Parse(Com.Public.SqlEncStr(txtschid)); } else { if (schid != "0") { strwhere += " and SchId = '" + Com.Public.SqlEncStr(schid) + "'"; } } if (!string.IsNullOrEmpty(txtname)) { strwhere += " and SchName like '%" + Com.Public.SqlEncStr(txtname) + "%'"; } if (!string.IsNullOrEmpty(ustat)) { strwhere += " and Stat='1' and SonSysStat='" + Com.Public.SqlEncStr(ustat) + "'"; } string currentYear = ""; if (DateTime.Now.Month < 8) { currentYear = (DateTime.Now.Year - 1).ToString(); } else { currentYear = DateTime.Now.Year.ToString(); } Com.Public.PageModelResp pages = new Com.Public.PageModelResp(); pages.PageIndex = int.Parse(PageIndex); pages.PageSize = int.Parse(PageSize); int rowc = 0; int pc = 0; string dbcols = "SchId,SchName,PlatformIP,SchoolSection,SonSysStat,RecTime,SchSonSysEnableTime,SchSonSysEndDateTime,AreaNo,Stat,PlatformUrl,SonSysStat"; DataTable dt = userbll.GetListCols(dbcols, strwhere, "SchName", "ASC", pages.PageIndex, pages.PageSize, ref rowc, ref pc).Tables[0]; pages.PageCount = pc; pages.RowCount = rowc; if (dt.Rows.Count > 0) { dt.Columns.Add("SHENG"); dt.Columns.Add("SHI"); dt.Columns.Add("QU"); dt.Columns.Add("SchoolSections"); dt.Columns.Add("graduated"); dt.Columns.Add("AppSonSys"); for (int i = 0; i < dt.Rows.Count; i++) { string[] areanames = Com.Public.GetArea(dt.Rows[i]["AreaNo"].ToString()).Split('|'); dt.Rows[i]["SHENG"] = areanames[0]; dt.Rows[i]["SHI"] = areanames[1]; dt.Rows[i]["QU"] = areanames[2]; StringBuilder sbstr = new StringBuilder(); if (!string.IsNullOrEmpty(dt.Rows[i]["SchoolSection"].ToString())) { string[] str = dt.Rows[i]["SchoolSection"].ToString().Split(','); for (int j = 0; j < str.Length; j++) { if (str[j] == "1") { sbstr.Append("幼儿园,"); } else if (str[j] == "2") { sbstr.Append("小学,"); } else if (str[j] == "3") { sbstr.Append("初中,"); } else if (str[j] == "4") { sbstr.Append("高中,"); } } if (sbstr.ToString() != "") { dt.Rows[i]["SchoolSections"] = sbstr.ToString().Substring(0, sbstr.ToString().Length - 1); } else { dt.Rows[i]["SchoolSections"] = ""; } } //查询最近毕业年级 SchSystem.BLL.SchGradeInfo sgibll = new SchSystem.BLL.SchGradeInfo(); //dt.Rows[i]["graduated"] = sgibll.GetGradedYear("SchId=" + dt.Rows[i]["SchId"].ToString() + " and IsFinish=1"); string gradecurrent = " and isfinish=1 and ((left(GradeCode,1)='4' and " + currentYear + "-GradeYear=3) or (left(GradeCode,1)='3' and " + currentYear + "-GradeYear=3) or (left(GradeCode,1)='2' and " + currentYear + "-GradeYear=6) or (left(GradeCode,1)='1' and " + currentYear + "-GradeYear=5))"; dt.Rows[i]["graduated"] = sgibll.GetGradedYear("SchId=" + dt.Rows[i]["SchId"].ToString() + gradecurrent); //查询应用子系统 SchSystem.BLL.SchAppRole sarBll = new SchSystem.BLL.SchAppRole(); DataTable dtsars = sarBll.GetList("SchId='" + dt.Rows[i]["SchId"].ToString() + "'").Tables[0]; StringBuilder sbsars = new StringBuilder(); if (dtsars.Rows.Count > 0) { string sarsarr = dtsars.Rows[0]["AppStr"].ToString(); SchSystem.BLL.SchApp saBll = new SchSystem.BLL.SchApp(); StringBuilder sbsas = new StringBuilder(); DataTable dtsas = saBll.GetList("AppName", "AppCode in (" + sarsarr + ")").Tables[0]; if (dtsas.Rows.Count > 0) { foreach (DataRow drsas in dtsas.Rows) { sbsas.Append(drsas["AppName"] + ","); } //sbsas.ToString().Substring(0, sbsas.ToString().Length - 1); dt.Rows[i]["AppSonSys"] = sbsas.ToString().Substring(0, sbsas.ToString().Length - 1); } } } pages.list = dt; } rsp.data = Newtonsoft.Json.JsonConvert.SerializeObject(pages).Replace("\n\r", ""); } catch (Exception ex) { rsp.code = "error"; rsp.msg = ex.Message; } } return(rsp); }
public static Com.DataPack.DataRsp <string> page(string PageIndex, string PageSize, string txtname, string ustat, string cotycode, string schid, string aprovserch, string acityserch) { Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>(); if (Com.Session.userid == null) { rsp.code = "expire"; rsp.msg = "页面已经过期,请重新登录"; } else { try { SchSystem.BLL.SchInfo userbll = new SchSystem.BLL.SchInfo(); //Stat:0废弃,1正常,2被删除,正常界面不显示删除,超管界面可以考虑 string strwhere = "Stat<2 "; if (!string.IsNullOrEmpty(cotycode)) { strwhere += " and AreaNo = '" + Com.Public.SqlEncStr(cotycode) + "'"; } if (!string.IsNullOrEmpty(aprovserch)) { strwhere += " and left(AreaNo,2)= '" + Com.Public.SqlEncStr(aprovserch.Substring(0, 2)) + "'"; } if (!string.IsNullOrEmpty(acityserch)) { strwhere += " and left(AreaNo,4)= '" + Com.Public.SqlEncStr(acityserch.Substring(0, 4)) + "'"; } if (schid != "") { strwhere += " and SchId = '" + Com.Public.SqlEncStr(schid) + "'"; } if (!string.IsNullOrEmpty(txtname)) { strwhere += " and SchName like '%" + Com.Public.SqlEncStr(txtname) + "%'"; } if (!string.IsNullOrEmpty(ustat)) { strwhere += " and SonSysStat=" + Com.Public.SqlEncStr(ustat); } Com.Public.PageModelResp pages = new Com.Public.PageModelResp(); pages.PageIndex = int.Parse(PageIndex); pages.PageSize = int.Parse(PageSize); int rowc = 0; int pc = 0; string dbcols = "SchId,SchName,PlatformName,PlatformUrl,PlatformIco,PlatformIP,SchMaster,SchoolSection,ServiceName,Artisan,SchCreator,RecTime,Stat,iscity,SonSysStat,AreaNo,SchType"; DataTable dt = userbll.GetListCols(dbcols, strwhere, "SchName", "ASC", pages.PageIndex, pages.PageSize, ref rowc, ref pc).Tables[0]; pages.PageCount = pc; pages.RowCount = rowc; if (dt.Rows.Count > 0) { dt.Columns.Add("SHENG"); dt.Columns.Add("SHI"); dt.Columns.Add("QU"); dt.Columns.Add("ManagerAcount"); dt.Columns.Add("InitialPwd"); dt.Columns.Add("graduated"); dt.Columns.Add("AppSonSys"); dt.Columns.Add("SchSubNames"); dt.Columns.Add("SchTypeName"); SchSystem.BLL.SysPer bllper = new SchSystem.BLL.SysPer(); DataTable dtper = bllper.GetList("PerName,PerCode", " Stat=1 ").Tables[0]; for (int i = 0; i < dt.Rows.Count; i++) { string[] areanames = Com.Public.GetArea(dt.Rows[i]["AreaNo"].ToString()).Split('|'); dt.Rows[i]["SHENG"] = areanames[0]; dt.Rows[i]["SHI"] = areanames[1]; dt.Rows[i]["QU"] = areanames[2]; DataRow[] dtr = dtper.Select("PerCode='" + dt.Rows[i]["SchType"].ToString() + "'"); if (dtr.Length > 0) { dt.Rows[i]["SchTypeName"] = dtr[0]["PerName"].ToString(); } else { dt.Rows[i]["SchTypeName"] = ""; } //获取管理员账号密码信息 SchSystem.BLL.SchUserInfo suiBll = new SchSystem.BLL.SchUserInfo(); SchSystem.Model.SchUserInfo modeluserinfo = suiBll.GetSupportModel(int.Parse(dt.Rows[i]["SchId"].ToString()), 1); if (modeluserinfo != null) { if (modeluserinfo.UserName != "" && modeluserinfo.UserName != null) { dt.Rows[i]["ManagerAcount"] = modeluserinfo.UserName; } if (modeluserinfo.PassWord != "" && modeluserinfo.PassWord != null) { dt.Rows[i]["InitialPwd"] = 1; } } else { dt.Rows[i]["ManagerAcount"] = ""; dt.Rows[i]["InitialPwd"] = ""; } //查询最近毕业年级 string currentYear = ""; if (DateTime.Now.Month < 8) { currentYear = (DateTime.Now.Year - 1).ToString(); } else { currentYear = DateTime.Now.Year.ToString(); } SchSystem.BLL.SchGradeInfo sgibll = new SchSystem.BLL.SchGradeInfo(); //dt.Rows[i]["graduated"] = sgibll.GetGradedYear("SchId=" + dt.Rows[i]["SchId"].ToString() + " and IsFinish=1"); string gradecurrent = " and isfinish=1 and ((left(GradeCode,1)='4' and " + currentYear + "-GradeYear=3) or (left(GradeCode,1)='3' and " + currentYear + "-GradeYear=3) or (left(GradeCode,1)='2' and " + currentYear + "-GradeYear=6) or (left(GradeCode,1)='1' and " + currentYear + "-GradeYear=5))"; dt.Rows[i]["graduated"] = sgibll.GetGradedYear("SchId=" + dt.Rows[i]["SchId"].ToString() + gradecurrent); // //查询应用子系统 SchSystem.BLL.SchAppRole sarBll = new SchSystem.BLL.SchAppRole(); DataTable dtsars = sarBll.GetList("SchId='" + dt.Rows[i]["SchId"].ToString() + "'").Tables[0]; StringBuilder sbsars = new StringBuilder(); if (dtsars.Rows.Count > 0) { string sarsarr = dtsars.Rows[0]["AppStr"].ToString(); SchSystem.BLL.SchApp saBll = new SchSystem.BLL.SchApp(); StringBuilder sbsas = new StringBuilder(); DataTable dtsas = saBll.GetList("AppName", "AppCode in (" + sarsarr + ")").Tables[0]; if (dtsas.Rows.Count > 0) { foreach (DataRow drsas in dtsas.Rows) { sbsas.Append(drsas["AppName"] + ","); } dt.Rows[i]["AppSonSys"] = sbsas.ToString().Substring(0, sbsas.ToString().Length - 1); } } //查询科目 SchSystem.BLL.SchSub ssBll = new SchSystem.BLL.SchSub(); dt.Rows[i]["SchSubNames"] = ssBll.GetSubNames("Stat=1 and SchId='" + dt.Rows[i]["SchId"].ToString() + "'"); } pages.list = dt; } rsp.data = Newtonsoft.Json.JsonConvert.SerializeObject(pages); } catch (Exception ex) { rsp.code = "error"; rsp.msg = ex.Message; } } return(rsp); }
public static string page(string PageIndex, string PageSize, string txtname, string dptid, string ustat, string schid, string schsubs, string childrenids) { string ret = ""; if (Com.Session.userid == null) { ret = "expire"; } else { SchSystem.BLL.SchUserInfo userbll = new SchSystem.BLL.SchUserInfo(); if (schid == "") { schid = "0"; } //Stat:0废弃,1正常,2被删除,正常界面不显示删除,超管界面可以考虑 string strwhere = " Stat=1 and SchId='" + Com.Public.SqlEncStr(schid) + "'";//SysType if (!string.IsNullOrEmpty(txtname)) { strwhere += " and UserTname like '%" + Com.Public.SqlEncStr(txtname) + "%'"; } if (Com.Session.systype != "2") { strwhere += " and SysType=0 "; } if (!string.IsNullOrEmpty(ustat)) { if (ustat != "3") { strwhere += " and AccStat='" + Com.Public.SqlEncStr(ustat) + "' and len(UserName)>0 "; } else { strwhere += " and (len(UserName)=0 or UserName=NULL) "; } } if (!string.IsNullOrEmpty(schsubs) && schsubs != "0") { strwhere += " and SubCode='" + Com.Public.SqlEncStr(schsubs) + "'"; } if (!string.IsNullOrEmpty(dptid) && dptid != "0") { if (!string.IsNullOrEmpty(childrenids)) { childrenids = childrenids.Substring(0, childrenids.Length - 1); strwhere += " and UserId in (select UserName from SchUserDept where DeptId in (" + Com.Public.SqlEncStr(childrenids) + "))"; } else { strwhere += " and UserId in (select UserName from SchUserDept where DeptId=" + Com.Public.SqlEncStr(dptid) + ")"; } } Com.Public.PageModelResp pages = new Com.Public.PageModelResp(); pages.PageIndex = int.Parse(PageIndex); pages.PageSize = int.Parse(PageSize); int rowc = 0; int pc = 0; DataTable dt = userbll.GetListCols("Mobile,UserId,UserName,UserTname,Postion,Title,Sex,AccStat,SchId", strwhere, "UserTname", "ASC", pages.PageIndex, pages.PageSize, ref rowc, ref pc).Tables[0]; pages.PageCount = pc; pages.RowCount = rowc; if (dt.Rows.Count > 0) { dt.Columns.Add("Dpts"); //获取关联的部门 //性别 dt.Columns.Add("Sexn"); //获取关联的角色 dt.Columns.Add("Roles"); //获取关联科目 dt.Columns.Add("SubName"); //获取关联科目 dt.Columns.Add("Ustat"); SchSystem.BLL.SchUserRoleV rolevbll = new SchSystem.BLL.SchUserRoleV(); SchSystem.BLL.SchUserDeptV deptvbll = new SchSystem.BLL.SchUserDeptV(); for (int i = 0; i < dt.Rows.Count; i++) { dt.Rows[i]["Roles"] = rolevbll.GetNames("UserName='******' and Stat=1 and schid=" + dt.Rows[i]["SchId"]); dt.Rows[i]["Roles"] = rolevbll.GetNames("UserId='" + dt.Rows[i]["UserId"] + "' and Stat=1 and schid=" + dt.Rows[i]["SchId"]); dt.Rows[i]["Dpts"] = deptvbll.GetNames("UserId='" + dt.Rows[i]["UserId"] + "' and Stat=1 and schid=" + dt.Rows[i]["SchId"]); dt.Rows[i]["Sexn"] = dt.Rows[i]["Sex"].ToString() == "1" ? "男" : "女"; //dt.Rows[i]["Ustat"] = dt.Rows[i]["Stat"].ToString() == "1" ? "正常" : "停用"; if (dt.Rows[i]["AccStat"].ToString() == "1") { dt.Rows[i]["Ustat"] = "正常"; } else if (dt.Rows[i]["AccStat"].ToString() == "0") { dt.Rows[i]["Ustat"] = "停用"; } //if (!string.IsNullOrEmpty(dt.Rows[i]["SubCode"].ToString())) // dt.Rows[i]["SubName"] = Com.Public.GetSubName(dt.Rows[i]["SubCode"].ToString(), dt.Rows[i]["SchId"].ToString()); //else // dt.Rows[i]["SubName"] = ""; } pages.list = dt; } ret = Newtonsoft.Json.JsonConvert.SerializeObject(pages); } return(ret); }
public static Com.DataPack.DataRsp <string> page(string PageIndex, string PageSize, string txtname, string ustat, string cotycode, string schid, string aprovserch, string acityserch, string txtschid, string gradelv, string isfinish) { Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>(); if (Com.Session.userid == null) { rsp.code = "expire"; rsp.msg = "页面已经过期,请重新登录"; } else { if (schid == "") { schid = "0"; } //Stat:0废弃,1正常,2被删除,正常界面不显示删除,超管界面可以考虑 string strwhere = "Stat<2 "; if (!string.IsNullOrEmpty(cotycode)) { strwhere += " and AreaNo = '" + Com.Public.SqlEncStr(cotycode) + "'"; } if (!string.IsNullOrEmpty(aprovserch)) { strwhere += " and left(AreaNo,2)= '" + Com.Public.SqlEncStr(aprovserch.Substring(0, 2)) + "'"; } if (!string.IsNullOrEmpty(acityserch)) { strwhere += " and left(AreaNo,4)= '" + Com.Public.SqlEncStr(acityserch.Substring(0, 4)) + "'"; } if (!string.IsNullOrEmpty(txtschid)) { strwhere += " and SchId = " + int.Parse(Com.Public.SqlEncStr(txtschid)); } else { if (schid != "0") { strwhere += " and SchId = '" + Com.Public.SqlEncStr(schid) + "'"; } } if (!string.IsNullOrEmpty(txtname)) { strwhere += " and SchName like '%" + Com.Public.SqlEncStr(txtname) + "%'"; } if (!string.IsNullOrEmpty(ustat)) { strwhere += " and SonSysStat=" + Com.Public.SqlEncStr(ustat); } string currentYear = ""; if (DateTime.Now.Month < 8) { currentYear = (DateTime.Now.Year - 1).ToString(); } else { currentYear = DateTime.Now.Year.ToString(); } if (!string.IsNullOrEmpty(gradelv)) //选择了学段 { if (!string.IsNullOrEmpty(isfinish)) //并且选择了是否有毕业班需要升级 { string yearlv = "0"; if (gradelv == "1") { yearlv = "4"; } else if (gradelv == "2") { yearlv = "5"; } else if (gradelv == "3") { yearlv = "3"; } else if (gradelv == "4") { yearlv = "3"; } if (isfinish == "0")//无毕业班,需要剔除有该学段毕业班学校 { strwhere += " and schid not in (select schid from SchGradeInfo where isfinish=0 and left(GradeCode,1)='" + Com.Public.SqlEncStr(gradelv) + "' and " + currentYear + "-GradeYear>" + yearlv + ")"; } else//有毕业班,含有该学段且有毕业班的学校 { strwhere += " and schid in (select schid from SchGradeInfo where isfinish=0 and left(GradeCode,1)='" + Com.Public.SqlEncStr(gradelv) + "' and " + currentYear + "-GradeYear>" + yearlv + ")"; } } else//仅选择了学段,则选择有该学段的学校 { strwhere += " and schid in (select schid from SchGradeInfo where isfinish=0 and left(GradeCode,1)='" + Com.Public.SqlEncStr(gradelv) + "')"; } } else { if (!string.IsNullOrEmpty(isfinish)) { if (isfinish == "0")//无毕业班,需要剔除含有毕业班学校 { strwhere += " and schid not in (select schid from SchGradeInfo where (isfinish=0 or isfinish=2) and ((left(GradeCode,1)='4' and " + currentYear + "-GradeYear>3) or (left(GradeCode,1)='3' and " + currentYear + "-GradeYear>3) or (left(GradeCode,1)='2' and " + currentYear + "-GradeYear>5) or (left(GradeCode,1)='1' and " + currentYear + "-GradeYear>4)))"; } else//有毕业班,含有毕业班的学校 { strwhere += " and schid in (select schid from SchGradeInfo where (isfinish=0 or isfinish=2) and ((left(GradeCode,1)='4' and " + currentYear + "-GradeYear>3) or (left(GradeCode,1)='3' and " + currentYear + "-GradeYear>3) or (left(GradeCode,1)='2' and " + currentYear + "-GradeYear>5) or (left(GradeCode,1)='1' and " + currentYear + "-GradeYear>4)))"; } } } //isfinish=0 and SchId=@SchId and ((left(GradeCode,1)='4' and @GradeYear-GradeYear>3) or (left(GradeCode,1)='3' and @GradeYear-GradeYear>3) or (left(GradeCode,1)='2' and @GradeYear-GradeYear>5) or (left(GradeCode,1)='1' and @GradeYear-GradeYear>4)) Com.Public.PageModelResp pages = new Com.Public.PageModelResp(); pages.PageIndex = int.Parse(PageIndex); pages.PageSize = int.Parse(PageSize); int rowc = 0; int pc = 0; try { SchSystem.BLL.SchInfo userbll = new SchSystem.BLL.SchInfo(); //查询最近毕业年级 SchSystem.BLL.SchGradeInfo sgibll = new SchSystem.BLL.SchGradeInfo(); SchSystem.BLL.SchApp saBll = new SchSystem.BLL.SchApp(); string dbcols = "SchId,SchName,PlatformIP,SchoolSection,SonSysStat,RecTime,SchSonSysEnableTime,SchSonSysEndDateTime,AreaNo,Stat,PlatformUrl";//,PlatformIco,SchMaster,ServiceName,Artisan,SchCreator,iscity DataTable dt = userbll.GetListCols(dbcols, strwhere, "SchName", "Asc", pages.PageIndex, pages.PageSize, ref rowc, ref pc).Tables[0]; pages.PageCount = pc; pages.RowCount = rowc; if (dt.Rows.Count > 0) { dt.Columns.Add("IsUpgrade"); dt.Columns.Add("SHENG"); dt.Columns.Add("SHI"); dt.Columns.Add("QU"); dt.Columns.Add("SchoolSections"); dt.Columns.Add("graduated"); dt.Columns.Add("AppSonSys"); for (int i = 0; i < dt.Rows.Count; i++) { string[] areanames = Com.Public.GetArea(dt.Rows[i]["AreaNo"].ToString()).Split('|'); dt.Rows[i]["SHENG"] = areanames[0]; dt.Rows[i]["SHI"] = areanames[1]; dt.Rows[i]["QU"] = areanames[2]; StringBuilder sbstr = new StringBuilder(); string ss = dt.Rows[i]["SchoolSection"].ToString(); if (!string.IsNullOrEmpty(dt.Rows[i]["SchoolSection"].ToString())) { string[] str = dt.Rows[i]["SchoolSection"].ToString().Split(','); for (int j = 0; j < str.Length; j++) { if (str[j] == "1") { sbstr.Append("幼儿园,"); } else if (str[j] == "2") { sbstr.Append("小学,"); } else if (str[j] == "3") { sbstr.Append("初中,"); } else if (str[j] == "4") { sbstr.Append("高中,"); } } if (sbstr.ToString() != "") { dt.Rows[i]["SchoolSections"] = sbstr.ToString().Substring(0, sbstr.ToString().Length - 1); } else { dt.Rows[i]["SchoolSections"] = ""; } } bool resBool = false; if (!string.IsNullOrEmpty(dt.Rows[i]["SchId"].ToString())) { resBool = sgibll.ExistsGradeFinish(int.Parse(dt.Rows[i]["SchId"].ToString()), int.Parse(currentYear)); } if (resBool) { dt.Rows[i]["IsUpgrade"] = "1"; } else { dt.Rows[i]["IsUpgrade"] = "0"; } string gradecurrent = " and isfinish=1 and ((left(GradeCode,1)='4' and " + currentYear + "-GradeYear=3) or (left(GradeCode,1)='3' and " + currentYear + "-GradeYear=3) or (left(GradeCode,1)='2' and " + currentYear + "-GradeYear=6) or (left(GradeCode,1)='1' and " + currentYear + "-GradeYear=5))"; dt.Rows[i]["graduated"] = sgibll.GetGradedYear("SchId=" + dt.Rows[i]["SchId"].ToString() + gradecurrent); //查询应用子系统 SchSystem.BLL.SchAppRole sarBll = new SchSystem.BLL.SchAppRole(); DataTable dtsars = sarBll.GetList("SchId='" + dt.Rows[i]["SchId"].ToString() + "'").Tables[0]; StringBuilder sbsars = new StringBuilder(); if (dtsars.Rows.Count > 0) { string sarsarr = dtsars.Rows[0]["AppStr"].ToString(); StringBuilder sbsas = new StringBuilder(); DataTable dtsas = saBll.GetList("AppName", "AppCode in (" + sarsarr + ")").Tables[0]; if (dtsas.Rows.Count > 0) { foreach (DataRow drsas in dtsas.Rows) { sbsas.Append(drsas["AppName"] + ","); } dt.Rows[i]["AppSonSys"] = sbsas.ToString().Substring(0, sbsas.ToString().Length - 1); } } } pages.list = dt; } rsp.data = Newtonsoft.Json.JsonConvert.SerializeObject(pages); } catch (Exception ex) { rsp.code = "ExcepError"; rsp.msg = ex.Message; } } return(rsp); }
public static Com.DataPack.DataRsp <string> page(string PageIndex, string PageSize, string txtname, string ustat, string cotycode, string schid, string aprovserch, string acityserch, string txtschid) { Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>(); if (Com.Session.userid == null) { rsp.code = "expire"; rsp.msg = "页面已经过期,请重新登录"; } else { try { SchSystem.BLL.SchInfo userbll = new SchSystem.BLL.SchInfo(); if (schid == "") { schid = "0"; } //Stat:0废弃,1正常,2被删除,正常界面不显示删除,超管界面可以考虑 string strwhere = "Stat<2 "; if (!string.IsNullOrEmpty(cotycode)) { strwhere += " and AreaNo = '" + Com.Public.SqlEncStr(cotycode) + "'"; } if (!string.IsNullOrEmpty(aprovserch)) { strwhere += " and left(AreaNo,2) = '" + Com.Public.SqlEncStr(aprovserch.Substring(0, 2)) + "'"; } if (!string.IsNullOrEmpty(acityserch)) { strwhere += " and left(AreaNo,4) = '" + Com.Public.SqlEncStr(acityserch.Substring(0, 4)) + "'"; } if (!string.IsNullOrEmpty(txtschid)) { strwhere += " and Schid='" + Com.Public.SqlEncStr(txtschid) + "' "; } if (!string.IsNullOrEmpty(txtname)) { strwhere += " and SchName like '%" + Com.Public.SqlEncStr(txtname) + "%'"; } if (!string.IsNullOrEmpty(ustat)) { strwhere += " and Stat='1' and HomeschServStat='" + Com.Public.SqlEncStr(ustat) + "'"; } Com.Public.PageModelResp pages = new Com.Public.PageModelResp(); pages.PageIndex = int.Parse(PageIndex); pages.PageSize = int.Parse(PageSize); int rowc = 0; int pc = 0; string dbcols = "SchId,SchName,SchoolSection,ServiceName,AreaNo,RecTime,HomeSchEnableTime,HomeSchEndTime,HomeschServStat,HomeSchPlatName,HomeSchPlatIco,HomeSchPlatUrl,HomeSchPlatIP"; DataTable dt = userbll.GetListCols(dbcols, strwhere, "SchName", "ASC", pages.PageIndex, pages.PageSize, ref rowc, ref pc).Tables[0]; pages.PageCount = pc; pages.RowCount = rowc; if (dt.Rows.Count > 0) { //dt.Columns.Add("Ustat"); dt.Columns.Add("SoureName"); dt.Columns.Add("SHENG"); dt.Columns.Add("SHI"); dt.Columns.Add("QU"); for (int i = 0; i < dt.Rows.Count; i++) { SchSystem.BLL.SchAppRoleXXT sarxxtBll = new SchSystem.BLL.SchAppRoleXXT(); DataTable dtsarxxt = sarxxtBll.GetList("SchId='" + dt.Rows[i]["SchId"].ToString() + "'").Tables[0]; if (dtsarxxt.Rows.Count > 0) { string[] sarsAppCodearr = dtsarxxt.Rows[0]["AppStr"].ToString().Split(','); StringBuilder sarsAppCodesb = new StringBuilder(); StringBuilder sasSoureName = new StringBuilder(); for (int j = 0; j < sarsAppCodearr.Length; j++) { sarsAppCodesb.Append(sarsAppCodearr[j] + ","); } SchSystem.BLL.SchAppXXT saxxtBll = new SchSystem.BLL.SchAppXXT(); if (sarsAppCodesb.ToString() != "") { try { DataTable dtsas = saxxtBll.GetList("AppName", "AppCode in (" + sarsAppCodesb.ToString().Substring(0, sarsAppCodesb.ToString().Length - 1) + ")").Tables[0]; if (dtsas.Rows.Count > 0) { foreach (DataRow dr in dtsas.Rows) { sasSoureName.Append(dr["AppName"] + ","); } dt.Rows[i]["SoureName"] = sasSoureName.ToString().Substring(0, sasSoureName.Length - 1); } } catch (Exception e) { } } else { dt.Rows[i]["SoureName"] = ""; } } string[] areanames = Com.Public.GetArea(dt.Rows[i]["AreaNo"].ToString()).Split('|'); dt.Rows[i]["SHENG"] = areanames[0]; dt.Rows[i]["SHI"] = areanames[1]; dt.Rows[i]["QU"] = areanames[2]; } pages.list = dt; } rsp.data = Newtonsoft.Json.JsonConvert.SerializeObject(pages).Replace("\n\r", ""); } catch (Exception ex) { rsp.code = "error"; rsp.msg = ex.Message; } } return(rsp); }
public static Com.DataPack.DataRsp <string> page(List <string> arr) { //变量声明区域 Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>(); if (Com.Session.userid == null) { rsp.code = "expire"; rsp.msg = "你现在登录已过期,请重新登录!"; } else { string PageIndex = ""; string PageSize = ""; string txtAccount = "", txtUserTname = "", txtProvince = "", txtCity = "", txtUserType = "", txtAdditional = "", txtPackage = "", txtStat = ""; string txtSource = "", txtStartTime01 = "", txtStartTime02 = "", txtEndTime01 = "", txtEndTime02 = ""; //分解前台传递过来的参数并给变量赋值 foreach (string str in arr) { string[] strarr = str.Split('#'); if (strarr[0] == "PageIndex") { PageIndex = strarr[1]; } else if (strarr[0] == "PageSize") { PageSize = strarr[1]; } else if (strarr[0] == "txtAccount") { txtAccount = strarr[1]; } else if (strarr[0] == "txtUserTname") { txtUserTname = strarr[1]; } else if (strarr[0] == "txtProvince") { txtProvince = strarr[1]; } else if (strarr[0] == "txtCity") { txtCity = strarr[1]; } else if (strarr[0] == "txtUserType") { txtUserType = strarr[1]; } else if (strarr[0] == "txtAdditional") { txtAdditional = strarr[1]; } else if (strarr[0] == "txtPackage") { txtPackage = strarr[1]; } else if (strarr[0] == "txtStat") { txtStat = strarr[1]; } else if (strarr[0] == "txtStartTime01") { txtStartTime01 = strarr[1]; } else if (strarr[0] == "txtStartTime02") { txtStartTime02 = strarr[1]; } else if (strarr[0] == "txtEndTime01") { txtEndTime01 = strarr[1]; } else if (strarr[0] == "txtEndTime02") { txtEndTime02 = strarr[1]; } else if (strarr[0] == "txtSource") { txtSource = strarr[1]; } } //实例化对象 SchSystem.BLL.ServUserFor sufBll = new SchSystem.BLL.ServUserFor(); //声明SQL拼接变量 StringBuilder strwhere = new StringBuilder(); //条件SQL拼接 strwhere.Append("1=1"); if (!string.IsNullOrEmpty(txtAccount)) { strwhere.Append(" and UserName='******'"); } if (!string.IsNullOrEmpty(txtUserTname)) { strwhere.Append(" and UTname='" + txtUserTname + "'"); } if (!string.IsNullOrEmpty(txtProvince)) { strwhere.Append(" and left(Uareano,2)='" + Com.Public.SqlEncStr(txtProvince.Substring(0, 2)) + "'"); } if (!string.IsNullOrEmpty(txtCity)) { strwhere.Append(" and left(Uareano,4)='" + Com.Public.SqlEncStr(txtCity.Substring(0, 4)) + "'"); } if (!string.IsNullOrEmpty(txtStat)) { strwhere.Append(" and ServStat='" + txtStat + "'"); } if (!string.IsNullOrEmpty(txtStartTime01) && !string.IsNullOrEmpty(txtStartTime02)) { strwhere.Append(" and RecTime between '" + DateTime.Parse(txtStartTime01) + "' and '" + DateTime.Parse(txtStartTime02) + "'"); } if (!string.IsNullOrEmpty(txtSource)) { strwhere.Append(" and FromType='" + txtSource + "'"); } if (!string.IsNullOrEmpty(txtEndTime01) && !string.IsNullOrEmpty(txtEndTime02)) { strwhere.Append(" and EndTime between '" + DateTime.Parse(txtEndTime01) + "' and '" + DateTime.Parse(txtEndTime02) + "'"); } if (!string.IsNullOrEmpty(txtPackage)) { strwhere.Append(" and ServiceId='" + txtPackage + "'"); } Com.Public.PageModelResp pages = new Com.Public.PageModelResp(); pages.PageIndex = int.Parse(PageIndex); pages.PageSize = int.Parse(PageSize); int rowc = 0; int pc = 0; try { string dbcols = "AutoId,UserName,UTname,Uareano,FromType,RecUser,CnName,FeeM,ServMonth,RecTime,EndTime,EditTime,ServStat,DoNote"; DataTable dt = sufBll.GetListColsV(dbcols, strwhere.ToString(), "AutoId", "DESC", pages.PageIndex, pages.PageSize, ref rowc, ref pc).Tables[0]; if (dt.Rows.Count > 0) { dt.Columns.Add("Province"); dt.Columns.Add("City"); for (int i = 0; i < dt.Rows.Count; i++) { if (dt.Rows[i]["Uareano"].ToString() != "") { dt.Rows[i]["Province"] = Com.Public.GetSSQ("0", dt.Rows[i]["Uareano"].ToString()); dt.Rows[i]["City"] = Com.Public.GetSSQ("1", dt.Rows[i]["Uareano"].ToString()); } else { dt.Rows[i]["Province"] = ""; dt.Rows[i]["City"] = ""; } } } pages.PageCount = pc; pages.RowCount = rowc; if (dt.Rows.Count > 0) { pages.list = dt; } rsp.RspData = Newtonsoft.Json.JsonConvert.SerializeObject(pages); } catch (Exception ex) { rsp.code = "excepError"; rsp.msg = ex.Message; } } return(rsp); }
public static Com.DataPack.DataRsp <string> page(string PageIndex, string PageSize, string txtname, string ustat, string txtcode, string drptype) { Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>(); if (Com.Session.userid == null) { rsp.code = "expire"; rsp.msg = "页面已经过期,请重新登录"; } else { try { //Stat:0废弃,1正常,2被删除,正常界面不显示删除,超管界面可以考虑 string strwhere = "Stat<2 and SchId='" + Com.Session.schid + "' "; if (!string.IsNullOrEmpty(txtname)) { strwhere += " and Topic like '%" + Com.Public.SqlEncStr(txtname) + "%'"; } if (!string.IsNullOrEmpty(ustat)) { strwhere += " and Stat='" + Com.Public.SqlEncStr(ustat) + "'"; } if (txtcode != "0") { strwhere += " and ChnId='" + Com.Public.SqlEncStr(txtcode) + "'"; } if (drptype != "") { strwhere += " and Lv='" + Com.Public.SqlEncStr(drptype) + "'"; } Com.Public.PageModelResp pages = new Com.Public.PageModelResp(); pages.PageIndex = int.Parse(PageIndex); pages.PageSize = int.Parse(PageSize); int rowc = 0; int pc = 0; SchSystem.BLL.WebSchChnNewsV userbll = new SchSystem.BLL.WebSchChnNewsV(); string dbcols = "NewsId,ChnName,ChnId,Topic,RecTime,GradeId,ClassId,Lv,'' GradeName,'' ClassName,'' LvName,'0' isdel,'0' isedit,'1' islook,Stat,IsTop"; DataTable dt = userbll.GetListCols(dbcols, strwhere, "IsTop Desc,RecTime DESC", "", pages.PageIndex, pages.PageSize, ref rowc, ref pc).Tables[0]; pages.PageCount = pc; pages.RowCount = rowc; if (dt.Rows.Count > 0) { SchSystem.BLL.SchClassUser bllclassuser = new SchSystem.BLL.SchClassUser(); SchSystem.BLL.SchGradeUsers bllgradeuser = new SchSystem.BLL.SchGradeUsers(); SchSystem.BLL.SchClassInfo bllclass = new SchSystem.BLL.SchClassInfo(); SchSystem.BLL.SchGradeInfo bllgrade = new SchSystem.BLL.SchGradeInfo(); //权限 for (int i = 0; i < dt.Rows.Count; i++) { if (Com.Session.appeditstat == "1") //允许编辑 { if (dt.Rows[i]["Lv"].ToString() == "0") //班级新闻 { if (Com.Public.IsUserVal(Com.Session.userrolestr, 14) || bllclassuser.ExistsIsMs(dt.Rows[i]["ClassId"].ToString(), Com.Session.usertid, Com.Session.schid, 1) == true) //如果有所有班级权限或是班主任 { dt.Rows[i]["isdel"] = "1"; dt.Rows[i]["isedit"] = "1"; } //获取年级,班级,类型 dt.Rows[i]["GradeName"] = bllgrade.GetName(int.Parse(dt.Rows[i]["GradeId"].ToString())); dt.Rows[i]["ClassName"] = bllclass.GetName(int.Parse(dt.Rows[i]["ClassId"].ToString())); dt.Rows[i]["LvName"] = "班级"; } else if (dt.Rows[i]["Lv"].ToString() == "1") //年级新闻 { if (Com.Public.IsUserVal(Com.Session.userrolestr, 13) || bllgradeuser.ExistsGrade(dt.Rows[i]["GradeId"].ToString(), Com.Session.schid, Com.Session.usertid) == true) //如果有全校权限或是年级组长 { dt.Rows[i]["isdel"] = "1"; dt.Rows[i]["isedit"] = "1"; } //获取年级 dt.Rows[i]["GradeName"] = bllgrade.GetName(int.Parse(dt.Rows[i]["GradeId"].ToString())); dt.Rows[i]["LvName"] = "年级"; } else if (dt.Rows[i]["Lv"].ToString() == "2") //学校新闻 { if (Com.Public.IsUserVal(Com.Session.userrolestr, 13)) //如果有全校权限 { dt.Rows[i]["isdel"] = "1"; dt.Rows[i]["isedit"] = "1"; } dt.Rows[i]["LvName"] = "学校"; } } } pages.list = dt; } rsp.RspData = Newtonsoft.Json.JsonConvert.SerializeObject(pages).Replace("\n\r", ""); } catch (Exception ex) { rsp.code = "error"; rsp.msg = ex.Message; } } return(rsp); }
public static Com.DataPack.DataRsp <string> page(string PageIndex, string PageSize, string ServiceId, string CnName, string FeeCode, string BusMonth) { Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>(); if (Com.Session.userid == null) { rsp.code = "expire"; rsp.msg = "你现在登录已过期,请重新登录!"; } else { SchSystem.BLL.ServBus servbusbll = new SchSystem.BLL.ServBus(); string strwhere = "1=1 "; if (!string.IsNullOrEmpty(ServiceId)) { strwhere += " and ServiceId = '" + Com.Public.SqlEncStr(ServiceId) + "'"; } if (!string.IsNullOrEmpty(CnName)) { strwhere += " and CnName = '" + Com.Public.SqlEncStr(CnName) + "'"; } if (!string.IsNullOrEmpty(FeeCode)) { strwhere += " and FeeCode = '" + Com.Public.SqlEncStr(FeeCode) + "'"; } if (!string.IsNullOrEmpty(BusMonth)) { strwhere += " and BusMonth = '" + Com.Public.SqlEncStr(BusMonth) + "'"; } Com.Public.PageModelResp pages = new Com.Public.PageModelResp(); pages.PageIndex = int.Parse(PageIndex); pages.PageSize = int.Parse(PageSize); int rowc = 0; int pc = 0; try { string dbcols = "BusId,ServiceId,FeeCode,CnName,FuncStr,BusMonth,BusNote,BusType,BusUrl,Note,CapName,BusArea,FrmType"; DataTable dt = servbusbll.GetListCols(dbcols, strwhere, "BusId", "DESC", pages.PageIndex, pages.PageSize, ref rowc, ref pc).Tables[0]; pages.PageCount = pc; pages.RowCount = rowc; if (dt.Rows.Count > 0) { dt.Columns.Add("TBusType"); dt.Columns.Add("TBusMonth"); dt.Columns.Add("TServFuncName"); dt.Columns.Add("Province"); dt.Columns.Add("City"); for (int i = 0; i < dt.Rows.Count; i++) { string FuncStr = dt.Rows[i]["FuncStr"].ToString(); if (FuncStr != "") { string[] FuncStrArr = FuncStr.Split(','); string FuncStrstr = ""; foreach (string s in FuncStrArr) { FuncStrstr += "'" + s + "',"; } FuncStr = FuncStrstr.Substring(0, FuncStrstr.Length - 1); } dt.Rows[i]["TServFuncName"] = servbusbll.GetFuncNames("FuncCode in (" + FuncStr + ")"); dt.Rows[i]["TBusType"] = dt.Rows[i]["BusType"].ToString() == "1" ? " 自定义套餐" : "CP套餐"; dt.Rows[i]["TBusMonth"] = Com.Public.InttoMonth(Convert.ToInt32(dt.Rows[i]["BusMonth"])); if (!string.IsNullOrEmpty(dt.Rows[i]["BusArea"].ToString())) { dt.Rows[i]["Province"] = Com.Public.GetSSQ("0", dt.Rows[i]["BusArea"].ToString()); dt.Rows[i]["City"] = Com.Public.GetSSQ("1", dt.Rows[i]["BusArea"].ToString()); } else { dt.Rows[i]["Province"] = ""; dt.Rows[i]["City"] = ""; } } pages.list = dt; } } catch (Exception ex) { rsp.code = "ExcepError"; rsp.msg = ex.Message; } rsp.RspData = Newtonsoft.Json.JsonConvert.SerializeObject(pages); } return(rsp); }