public static string getaddcont(string napecode) { string ret = ""; if (Com.Session.userid == null) { ret = "expire"; } else { retprompt retobj = new retprompt(); if (napecode == "prd")//學段 { SchSystem.BLL.SysPer spBll = new SchSystem.BLL.SysPer(); DataTable dt = spBll.GetList("'0' pId,PerName name,PerCode id", "Stat=1 order by convert(int,PerCode)").Tables[0]; retobj.retxt = napecode; retobj.retobj = dt; ret = Newtonsoft.Json.JsonConvert.SerializeObject(retobj); } else if (napecode == "grd")//年級 { SchSystem.BLL.SysGrade spBll = new SchSystem.BLL.SysGrade(); DataTable dt = spBll.GetList("'0' pId,GradeName name,GradeCode id", "").Tables[0]; retobj.retxt = napecode; retobj.retobj = dt; ret = Newtonsoft.Json.JsonConvert.SerializeObject(retobj); } else if (napecode == "sub")//科目 { SchSystem.BLL.SysSub spBll = new SchSystem.BLL.SysSub(); DataTable dt = spBll.GetList("'0' pId,SubName name,SubCode id", "Stat=1 Order by SubCode").Tables[0]; retobj.retxt = napecode; retobj.retobj = dt; ret = Newtonsoft.Json.JsonConvert.SerializeObject(retobj); } else if (napecode == "utp")//角色 { SchSystem.BLL.SysUType spBll = new SchSystem.BLL.SysUType(); DataTable dt = spBll.GetList("'0' pId,UTypeName name,UTypeCOde id", "Stat=1").Tables[0]; retobj.retxt = napecode; retobj.retobj = dt; ret = Newtonsoft.Json.JsonConvert.SerializeObject(retobj); } else if (napecode == "mat")//教版 { SchSystem.BLL.SysMater spBll = new SchSystem.BLL.SysMater(); DataTable dt = spBll.GetList("'0' pId,MaterName name,MaterCode id", "Stat=1").Tables[0]; retobj.retxt = napecode; retobj.retobj = dt; ret = Newtonsoft.Json.JsonConvert.SerializeObject(retobj); } else { retobj.retxt = napecode; retobj.retobj = ""; ret = Newtonsoft.Json.JsonConvert.SerializeObject(retobj); } } return(ret); }
public static Com.DataPack.DataRsp <string> save(string Name, string stat, string AutoId) { Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>(); if (Com.Session.userid == null) { rsp.code = "expire"; rsp.msg = "页面已经过期,请重新登录"; } else { try { SchSystem.BLL.SysPer SysPer_bll = new SchSystem.BLL.SysPer(); SchSystem.Model.SysPer SysPer_model = new SchSystem.Model.SysPer(); SysPer_model.PerName = Com.Public.SqlEncStr(Name).ToString(); SysPer_model.Stat = Convert.ToInt32(Com.Public.SqlEncStr(stat)); if (AutoId != "") { SysPer_model.AutoId = int.Parse(AutoId); if (SysPer_bll.Update(SysPer_model)) { rsp.code = "success"; rsp.msg = "修改成功"; } } else { DataTable dt = SysPer_bll.GetList(" top 1 PerCode", " 1=1 order by convert(int,PerCode) desc").Tables[0]; if (dt != null && dt.Rows.Count > 0) { string Code = dt.Rows[0]["PerCode"].ToString(); SysPer_model.PerCode = (int.Parse(Code) + 1).ToString("0"); } else { SysPer_model.PerCode = "1"; } if (SysPer_bll.Add(SysPer_model) != 0) { rsp.code = "success"; rsp.msg = "添加成功"; } } } 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.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); }
protected void Page_Load(object sender, EventArgs e) { string SysType = Com.Public.SqlEncStr(Request.Params["systype"].ToString());//先得到操作类型 SchSystem.BLL.SysPer bll = new SchSystem.BLL.SysPer(); if (SysType == "e")//修改 { btname = "修改"; id = Request.Params["id"].ToString(); SchSystem.Model.SysPer model = bll.GetModel(int.Parse(id)); if (model != null) { code = model.PerCode; name = model.PerName; stat = model.Stat.ToString(); year = model.PerYear.ToString(); SchSystem.BLL.SysGrade bllgrade = new SchSystem.BLL.SysGrade(); string srtWhere = "GradeType=" + Convert.ToInt32(model.PerCode) + " order by convert(int,GradeCode)"; DataTable dt = bllgrade.GetList("AutoId as id,GradeName as name,'true' checked,GradeType", srtWhere).Tables[0]; if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { grademodelstr += dt.Rows[i]["name"].ToString() + "|"; } grademodelstr = grademodelstr.Remove(grademodelstr.Length - 1); } } else { Response.Write("无该名称!"); Response.End(); } } else { DataTable dt = bll.GetList(" top 1 PerCode", " 1=1 order by convert(int,PerCode) desc").Tables[0]; if (dt != null && dt.Rows.Count > 0) { string Code = dt.Rows[0]["PerCode"].ToString(); code = (int.Parse(Code) + 1).ToString("0"); } else { code = "1"; } } }
protected void Page_Load(object sender, EventArgs e) { schid = Com.Session.schid; //业务类型 SchSystem.BLL.ServType stBll = new SchSystem.BLL.ServType(); DataTable stdt = stBll.GetList("TypeName,TypeCode", "").Tables[0]; businessType = Newtonsoft.Json.JsonConvert.SerializeObject(stdt); //业务平台 SchSystem.BLL.ServSys ssBll = new SchSystem.BLL.ServSys(); DataTable ssdt = ssBll.GetList("'0' pId,SysName name,SysCode id,SysUrl,'false' checked", "").Tables[0]; businessPlatfrom = Newtonsoft.Json.JsonConvert.SerializeObject(ssdt); //附加設置信息 SchSystem.BLL.ServSysNape ssnBll = new SchSystem.BLL.ServSysNape(); DataTable ssndt = ssnBll.GetList("Stat=1").Tables[0]; addinfo = Newtonsoft.Json.JsonConvert.SerializeObject(ssndt); //附加設置信息之附加信息聯動內容默認下拉列表 SchSystem.BLL.SysPer spBll = new SchSystem.BLL.SysPer(); DataTable dtsp = spBll.GetList("'0' pId,PerName name,PerCode id", "Stat=1 order by convert(int,PerCode)").Tables[0]; selectprdcontent = Newtonsoft.Json.JsonConvert.SerializeObject(dtsp); }
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); }
protected void Page_Load(object sender, EventArgs e) { string SysType = Request.Params["systype"].ToString(); SchSystem.BLL.SysGrade bll = new SchSystem.BLL.SysGrade(); SchSystem.BLL.SysPer sysperbll = new SchSystem.BLL.SysPer(); DataTable dt = sysperbll.GetList("PerName Name,PerCode ID", " Stat=1 Order by convert(int,PerCode)").Tables[0]; if (SysType == "e")//修改,不能修改用户的类型及学校参数 { btname = "修改"; id = Request.Params["autoid"].ToString(); //先得到操作类型 SchSystem.Model.SysGrade model = bll.GetModel(int.Parse(id)); if (model != null && model.AutoId > 0) { name = model.GradeName; percode = model.GradeType.ToString(); gradecode = model.GradeCode + "(" + Com.Public.NumberToChinese(int.Parse(model.GradeCode.Substring(model.GradeCode.Length - 3))) + "年级)"; } else { Response.Write("无该名称!"); Response.End(); } } else//不在添加及修改之内,则返回 { if (dt.Rows.Count > 0) { percode = dt.Rows[0]["ID"].ToString(); } DataTable dtg = bll.GetList(" top 1 GradeCode", " GradeType=" + int.Parse(percode) + " order by GradeCode desc").Tables[0]; if (dtg != null && dtg.Rows.Count > 0) { string Code = dtg.Rows[0]["GradeCode"].ToString().Substring(dtg.Rows[0]["GradeCode"].ToString().Length - 3); string docode = percode + (int.Parse(Code) + 1).ToString("000"); gradecode = docode + "(" + Com.Public.NumberToChinese(int.Parse(Code) + 1) + "年级)"; } else { gradecode = percode + "001" + "(一年级)"; } } if (dt.Rows.Count > 0) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < dt.Rows.Count; i++) { if (dt.Rows[i]["ID"].ToString() == percode) { sb.Append("<option value=\"" + dt.Rows[i]["ID"].ToString() + "\" selected=\"selected\">" + dt.Rows[i]["Name"].ToString() + "</option>"); } else { sb.Append("<option value=\"" + dt.Rows[i]["ID"].ToString() + "\">" + dt.Rows[i]["Name"].ToString() + "</option>"); } //} } percodes = sb.ToString(); } }
public static string getServFunc(string ordpack) { string ret = ""; if (Com.Session.userid == null) { ret = "expire"; } else { retprompt retobj = new retprompt(); //根據套餐代碼查詢功能代碼 SchSystem.BLL.ServBus sbBll = new SchSystem.BLL.ServBus(); string funcstr = sbBll.GetList("FuncStr", "ServiceId='" + ordpack + "'").Tables[0].Rows[0]["FuncStr"].ToString(); string funcs = ""; if (!string.IsNullOrEmpty(funcstr)) { string[] funcstrarr = funcstr.Split(','); foreach (string str in funcstrarr) { funcs += "'" + str + "',"; } } //根據功能代碼查詢功能名稱以及編號 SchSystem.BLL.ServFunc sfBll = new SchSystem.BLL.ServFunc(); DataTable dtServFunc = sfBll.GetList("AutoId,FuncName,FuncCode", "FuncCode in (" + funcs.Substring(0, funcs.Length - 1) + ")").Tables[0]; retobj.retxt = "servfunc"; retobj.retobj = dtServFunc; //根據功能AutoId查詢功能擴展數據 SchSystem.BLL.ServFuncExt sfeBll = new SchSystem.BLL.ServFuncExt(); DataTable dtServFuncExt = sfeBll.GetList("FuncId,NapeCode,NapeCodes,NapeC,'' Title", "FuncId in(select AutoId from ServFunc where FuncCode in(" + funcs.Substring(0, funcs.Length - 1) + "))").Tables[0]; retobj.servfuncext = dtServFuncExt; Dictionary <string, object> listDic = new Dictionary <string, object>(); if (dtServFuncExt.Rows.Count > 0) { for (int i = 0; i < dtServFuncExt.Rows.Count; i++) { for (int j = 0; j < dtServFunc.Rows.Count; j++) { if (dtServFuncExt.Rows[i]["FuncId"].ToString() == dtServFunc.Rows[j]["AutoId"].ToString()) { SchSystem.BLL.ServUserForExt sufeBll = new SchSystem.BLL.ServUserForExt(); DataTable dtsufe = sufeBll.GetList("Fcode,NapeCode,NapeCodes", "UserForId in (select AutoId from ServUserFor where ServiceId='" + ordpack + "')").Tables[0]; if (dtServFuncExt.Rows[i]["NapeCode"].ToString() == "prd") { SchSystem.BLL.SysPer spBll = new SchSystem.BLL.SysPer(); DataTable dtSysPer = spBll.GetList("'0' pId,PerName name,PerCode id,'false' checked,'true' chkDisabled", "Stat=1 and PerCode in (" + dtServFuncExt.Rows[i]["NapeCodes"].ToString() + ") order by convert(int,PerCode)").Tables[0]; dtServFuncExt.Rows[i]["Title"] = "学段"; string prdtxt = "prd_" + dtServFuncExt.Rows[i]["FuncId"].ToString(); // if (dtSysPer.Rows.Count > 0) { for (int y = 0; y < dtSysPer.Rows.Count; y++) { if (dtsufe.Rows.Count > 0) { for (int z = 0; z < dtsufe.Rows.Count; z++) { if (dtsufe.Rows[z]["Fcode"].ToString() == dtServFunc.Rows[j]["FuncCode"].ToString() && dtServFuncExt.Rows[i]["NapeCode"].ToString() == dtsufe.Rows[z]["NapeCode"].ToString()) { if (!string.IsNullOrEmpty(dtsufe.Rows[z]["NapeCodes"].ToString())) { string[] ncarr = dtsufe.Rows[z]["NapeCodes"].ToString().Split(','); for (int x = 0; x < ncarr.Length; x++) { if (ncarr[x].ToString() == dtSysPer.Rows[y]["id"].ToString()) { dtSysPer.Rows[y]["checked"] = true; } } } } } } } } // listDic.Add(prdtxt, dtSysPer); } if (dtServFuncExt.Rows[i]["NapeCode"].ToString() == "mat") { SchSystem.BLL.SysMater smBll = new SchSystem.BLL.SysMater(); DataTable dtSysMat = smBll.GetList("'0' pId,MaterName name,MaterCode id,'false' checked,'true' chkDisabled", "Stat=1 and MaterCode in (" + dtServFuncExt.Rows[i]["NapeCodes"].ToString() + ")").Tables[0]; dtServFuncExt.Rows[i]["Title"] = "教版"; string prdtxt = "mat_" + dtServFuncExt.Rows[i]["FuncId"].ToString(); // if (dtSysMat.Rows.Count > 0) { for (int y = 0; y < dtSysMat.Rows.Count; y++) { if (dtsufe.Rows.Count > 0) { for (int z = 0; z < dtsufe.Rows.Count; z++) { if (dtsufe.Rows[z]["Fcode"].ToString() == dtServFunc.Rows[j]["FuncCode"].ToString() && dtServFuncExt.Rows[i]["NapeCode"].ToString() == dtsufe.Rows[z]["NapeCode"].ToString()) { if (!string.IsNullOrEmpty(dtsufe.Rows[z]["NapeCodes"].ToString())) { string[] ncarr = dtsufe.Rows[z]["NapeCodes"].ToString().Split(','); for (int x = 0; x < ncarr.Length; x++) { if (ncarr[x].ToString() == dtSysMat.Rows[y]["id"].ToString()) { dtSysMat.Rows[y]["checked"] = true; } } } } } } } } // listDic.Add(prdtxt, dtSysMat); } if (dtServFuncExt.Rows[i]["NapeCode"].ToString() == "sub") { SchSystem.BLL.SysSub ssBll = new SchSystem.BLL.SysSub(); DataTable dtSysSub = ssBll.GetList("'0' pId,SubName name,SubCode id,'false' checked,'true' chkDisabled", "Stat=1 and SubCode in (" + dtServFuncExt.Rows[i]["NapeCodes"].ToString() + ")").Tables[0]; dtServFuncExt.Rows[i]["Title"] = "科目"; string prdtxt = "sub_" + dtServFuncExt.Rows[i]["FuncId"].ToString(); // if (dtSysSub.Rows.Count > 0) { for (int y = 0; y < dtSysSub.Rows.Count; y++) { if (dtsufe.Rows.Count > 0) { for (int z = 0; z < dtsufe.Rows.Count; z++) { if (dtsufe.Rows[z]["Fcode"].ToString() == dtServFunc.Rows[j]["FuncCode"].ToString() && dtServFuncExt.Rows[i]["NapeCode"].ToString() == dtsufe.Rows[z]["NapeCode"].ToString()) { if (!string.IsNullOrEmpty(dtsufe.Rows[z]["NapeCodes"].ToString())) { string[] ncarr = dtsufe.Rows[z]["NapeCodes"].ToString().Split(','); for (int x = 0; x < ncarr.Length; x++) { if (ncarr[x].ToString() == dtSysSub.Rows[y]["id"].ToString()) { dtSysSub.Rows[y]["checked"] = true; } } } } } } } } // listDic.Add(prdtxt, dtSysSub); } if (dtServFuncExt.Rows[i]["NapeCode"].ToString() == "grd") { SchSystem.BLL.SysGrade sgBll = new SchSystem.BLL.SysGrade(); DataTable dtSysGrade = sgBll.GetList("'0' pId,GradeName name,GradeCode id,'false' checked,'true' chkDisabled", "GradeCode in (" + dtServFuncExt.Rows[i]["NapeCodes"].ToString() + ")").Tables[0]; dtServFuncExt.Rows[i]["Title"] = "年级"; string prdtxt = "grd_" + dtServFuncExt.Rows[i]["FuncId"].ToString(); // if (dtSysGrade.Rows.Count > 0) { for (int y = 0; y < dtSysGrade.Rows.Count; y++) { if (dtsufe.Rows.Count > 0) { for (int z = 0; z < dtsufe.Rows.Count; z++) { if (dtsufe.Rows[z]["Fcode"].ToString() == dtServFunc.Rows[j]["FuncCode"].ToString() && dtServFuncExt.Rows[i]["NapeCode"].ToString() == dtsufe.Rows[z]["NapeCode"].ToString()) { if (!string.IsNullOrEmpty(dtsufe.Rows[z]["NapeCodes"].ToString())) { string[] ncarr = dtsufe.Rows[z]["NapeCodes"].ToString().Split(','); for (int x = 0; x < ncarr.Length; x++) { if (ncarr[x].ToString() == dtSysGrade.Rows[y]["id"].ToString()) { dtSysGrade.Rows[y]["checked"] = true; } } } } } } } } // listDic.Add(prdtxt, dtSysGrade); } if (dtServFuncExt.Rows[i]["NapeCode"].ToString() == "utp") { SchSystem.BLL.SysUType sutBll = new SchSystem.BLL.SysUType(); DataTable dtSysUType = sutBll.GetList("'0' pId,UTypeName name,UTypeCode id,'false' checked,'true' chkDisabled", "Stat=1 and UTypeCode in (" + dtServFuncExt.Rows[i]["NapeCodes"].ToString() + ")").Tables[0]; dtServFuncExt.Rows[i]["Title"] = "角色"; string prdtxt = "utp_" + dtServFuncExt.Rows[i]["FuncId"].ToString(); // if (dtSysUType.Rows.Count > 0) { for (int y = 0; y < dtSysUType.Rows.Count; y++) { if (dtsufe.Rows.Count > 0) { for (int z = 0; z < dtsufe.Rows.Count; z++) { if (dtsufe.Rows[z]["Fcode"].ToString() == dtServFunc.Rows[j]["FuncCode"].ToString() && dtServFuncExt.Rows[i]["NapeCode"].ToString() == dtsufe.Rows[z]["NapeCode"].ToString()) { if (!string.IsNullOrEmpty(dtsufe.Rows[z]["NapeCodes"].ToString())) { string[] ncarr = dtsufe.Rows[z]["NapeCodes"].ToString().Split(','); for (int x = 0; x < ncarr.Length; x++) { if (ncarr[x].ToString() == dtSysUType.Rows[y]["id"].ToString()) { dtSysUType.Rows[y]["checked"] = true; } } } } } } } } // listDic.Add(prdtxt, dtSysUType); } } } } retobj.sysext = listDic; } ret = Newtonsoft.Json.JsonConvert.SerializeObject(retobj); } return(ret); }
public static Com.DataPack.DataRsp <string> save(string Name, string GradeNames, string Year, string Code, string stat, string AutoId) { Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>(); if (Com.Session.userid == null) { rsp.code = "expire"; rsp.msg = "页面已经过期,请重新登录"; } else { try { SchSystem.BLL.SysPer SysPer_bll = new SchSystem.BLL.SysPer(); SchSystem.Model.SysPer SysPer_model = new SchSystem.Model.SysPer(); SysPer_model.PerName = Com.Public.SqlEncStr(Name).ToString(); SysPer_model.Stat = Convert.ToInt32(Com.Public.SqlEncStr(stat)); SysPer_model.PerYear = int.Parse(Year); SchSystem.BLL.SysGrade bll = new SchSystem.BLL.SysGrade(); SchSystem.Model.SysGrade model = new SchSystem.Model.SysGrade(); if (AutoId != "") { SysPer_model.AutoId = int.Parse(AutoId); if (SysPer_bll.Update(SysPer_model)) { //删除对应年级,再重新建 bll.DeleteList(Com.Public.SqlEncStr(Code)); //修改年级 string[] grades = GradeNames.Split('|'); if (grades.Length > 0) { for (int i = 0; i < grades.Length; i++) { model.GradeName = Com.Public.SqlEncStr(grades[i]).ToString(); model.GradeType = int.Parse(Code); model.GradeCode = Code + (i + 1).ToString("000"); bll.Add(model); } } rsp.code = "success"; rsp.msg = "修改成功"; } } else { DataTable dt = SysPer_bll.GetList(" top 1 PerCode", " 1=1 order by convert(int,PerCode) desc").Tables[0]; if (dt != null && dt.Rows.Count > 0) { string iCode = dt.Rows[0]["PerCode"].ToString(); SysPer_model.PerCode = (int.Parse(iCode) + 1).ToString("0"); } else { SysPer_model.PerCode = "1"; } int perid = SysPer_bll.Add(SysPer_model); if (perid > 0) { //添加年级 string[] grades = GradeNames.Split('|'); if (grades.Length > 0) { for (int i = 0; i < grades.Length; i++) { model.GradeName = Com.Public.SqlEncStr(grades[i]).ToString(); model.GradeType = int.Parse(SysPer_model.PerCode); model.GradeCode = SysPer_model.PerCode + (i + 1).ToString("000"); bll.Add(model); } } rsp.code = "success"; rsp.msg = "添加成功"; } } } 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); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { usertname = Com.Session.uname; //先得到操作类型 SchSystem.BLL.SchInfo schbll = new SchSystem.BLL.SchInfo(); SchSystem.Model.SchInfo usermodel = new SchSystem.Model.SchInfo(); SchSystem.BLL.SysSub syssubbll = new SchSystem.BLL.SysSub(); DataTable dtsub = syssubbll.GetList("'0' pId,SubCode id,SubName name,'false' checked", "Stat=1 Order by SubCode").Tables[0];//Stat=1 DataTable dtsubmat = dtsub.Copy(); //获取学校的sub SchSystem.BLL.SchSub schsubbll = new SchSystem.BLL.SchSub(); DataTable dtschsub = schsubbll.GetList("'0' pId,SubCode id,SubName name,'false' checked", "Stat=1 and SchId='" + schid + "' Order by SubCode").Tables[0]; subs = Newtonsoft.Json.JsonConvert.SerializeObject(dtsub); subsmat = Newtonsoft.Json.JsonConvert.SerializeObject(dtsubmat); treeNodekinderstr = Newtonsoft.Json.JsonConvert.SerializeObject(dtschsub); //获取子系统:AutoId,AppCode,AppName,Stat,RecTime,RecUser,LastRecTime,LastRecUser SchSystem.BLL.SchApp schappBll = new SchSystem.BLL.SchApp(); DataTable dtschapp = schappBll.GetList("'0' pId,AppCode id,AppName name,'false' checked,AppCode", "Stat=1 and AppCode not in (1,2)").Tables[0]; sonsys = Newtonsoft.Json.JsonConvert.SerializeObject(dtschapp); //获取整个系统的年级 SchSystem.BLL.SysGrade sysgradebll = new SchSystem.BLL.SysGrade(); DataTable dtgrade = sysgradebll.GetList("GradeType pId,GradeCode id,GradeName name,'false' checked,'false' nochecks,'0' IsFinish", " GradeCode<>'3004' and GradeCode<>'4004' Order by GradeType,GradeLv").Tables[0]; //获取学校类型 SchSystem.BLL.SysPer sysperbll = new SchSystem.BLL.SysPer(); DataTable dtper = sysperbll.GetList("PerName Name,PerCode ID", " Stat=1 Order by convert(int,PerCode)").Tables[0]; if (dtper.Rows.Count > 0) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < dtper.Rows.Count; i++) { if (dtper.Rows[i]["ID"].ToString() == percode) { sb.Append("<option value=\"" + dtper.Rows[i]["ID"].ToString() + "\" selected=\"selected\">" + dtper.Rows[i]["Name"].ToString() + "</option>"); } else { sb.Append("<option value=\"" + dtper.Rows[i]["ID"].ToString() + "\">" + dtper.Rows[i]["Name"].ToString() + "</option>"); } //} } percodes = sb.ToString(); } dtgrade.Columns["nochecks"].ColumnName = "nocheck"; DataRow dry = dtgrade.NewRow(); dry["pId"] = "0"; dry["id"] = "1"; dry["name"] = "幼儿园"; dry["nocheck"] = "false"; dry["IsFinish"] = "0"; dtgrade.Rows.Add(dry); dry = dtgrade.NewRow(); dry["pId"] = "0"; dry["id"] = "2"; dry["name"] = "小学"; dry["nocheck"] = "false"; dry["IsFinish"] = "0"; dtgrade.Rows.Add(dry); dry = dtgrade.NewRow(); dry["pId"] = "0"; dry["id"] = "3"; dry["name"] = "初中"; dry["nocheck"] = "false"; dry["IsFinish"] = "0"; dtgrade.Rows.Add(dry); dry = dtgrade.NewRow(); dry["pId"] = "0"; dry["id"] = "4"; dry["name"] = "高中"; dry["nocheck"] = "false"; dry["IsFinish"] = "0"; dtgrade.Rows.Add(dry); //if (dtgrade != null && dtschgrade != null && dtgrade.Rows.Count > 0 && dtschgrade.Rows.Count > 0)//系统年级和学校年级不等于null //{ // for (int i = 0; i < dtgrade.Rows.Count; i++)//遍历实体年级行数 // { // DataRow[] drs = dtschgrade.Select("id='" + dtgrade.Rows[i]["id"].ToString() + "'");//根据系统年级id查询学校年级 // if (drs.Length > 0) // { // //string ss = drs[0]["id"].ToString(); // //dtgrade.Rows[i]["checked"] = "true"; // //DataRow[] drss = dtgrade.Select("id='"+ss+"'"); // //int ss = int.Parse(drss["pId"].ToString()); // } // } //} grades = Newtonsoft.Json.JsonConvert.SerializeObject(dtgrade); //获取资源平台服务资源:AutoId,AppCode,AppName,Stat,RecTime,RecUser,LastRecTime,LastRecUser SchSystem.BLL.SchAppSoure schappsoureBll = new SchSystem.BLL.SchAppSoure(); DataTable dtschappsoure = schappsoureBll.GetList("'0' pId,AppCode id,AppName name,'false' checked,AppCode", "Stat=1").Tables[0]; if (dtschappsoure.Rows.Count > 0) { for (int i = 0; i < dtschappsoure.Rows.Count; i++) { dtschappsoure.Rows[i]["name"] = dtschappsoure.Rows[i]["name"] + "【不共享】"; } } souretree = Newtonsoft.Json.JsonConvert.SerializeObject(dtschappsoure); //获取教版 SchSystem.BLL.SysMater smaterBll = new SchSystem.BLL.SysMater(); DataTable dtsmater = smaterBll.GetList("'0' pId,AutoId id,MaterName name,'false' checked,MaterCode", "Stat=1").Tables[0]; sysmatertree = Newtonsoft.Json.JsonConvert.SerializeObject(dtsmater); //获取家校互通服务资源:AutoId,AppCode,AppName,Stat,RecTime,RecUser,LastRecTime,LastRecUser SchSystem.BLL.SchAppXXT schappxxtBll = new SchSystem.BLL.SchAppXXT(); DataTable dtschappxxt = schappxxtBll.GetList("'0' pId,AppCode id,AppName name,'false' checked,AppCode", "Stat=1").Tables[0]; //if (dtschappsoure.Rows.Count > 0) //{ // for (int i = 0; i < dtschappsoure.Rows.Count; i++) // { // dtschappsoure.Rows[i]["name"] = dtschappsoure.Rows[i]["name"] + "【不共享】"; // } //} homeschtree = Newtonsoft.Json.JsonConvert.SerializeObject(dtschappxxt); //获取下拉列表 StringBuilder sbarea = new StringBuilder(); //获取省份 sbarea.Append("<select id=\"aprov\">"); string sareacode = ""; if (usermodel != null && usermodel.SchId > 0 && usermodel.AreaNo.Length == 6) { sareacode = usermodel.AreaNo.Substring(0, 2) + "0000"; } sbarea.Append(SchWebAdmin.Com.Public.GetDrpArea("0", "", ref sareacode, false)); sbarea.Append("</select>"); //获取城市 sbarea.Append("<select id=\"acity\">"); string sareacitycode = ""; if (usermodel != null && usermodel.SchId > 0 && usermodel.AreaNo.Length == 6) { sareacitycode = usermodel.AreaNo.Substring(0, 4) + "00"; } sbarea.Append(SchWebAdmin.Com.Public.GetDrpArea("1", sareacode, ref sareacitycode, false)); sbarea.Append("</select>"); //获取区县 sbarea.Append("<select id=\"acoty\">"); string sareacotycode = ""; if (usermodel != null && usermodel.SchId > 0 && usermodel.AreaNo.Length == 6) { sareacotycode = usermodel.AreaNo; } sbarea.Append(SchWebAdmin.Com.Public.GetDrpArea("2", sareacitycode, ref sareacotycode, false)); sbarea.Append("</select>"); areastr = sbarea.ToString(); //根据部门分类查询人员信息 //当前学校老师 SchSystem.BLL.SchUserDeptV userbll = new SchSystem.BLL.SchUserDeptV(); DataTable dtuser = userbll.GetList("DeptId,DepartName,UserId,UserTname", "Stat=1 and Ustat=1 and SchId=" + Com.Public.SqlEncStr(schid)).Tables[0]; SchSystem.BLL.SchDepartInfo dptbll = new SchSystem.BLL.SchDepartInfo(); DataTable dt = dptbll.GetList("Pid pId,convert(varchar(20),DepartId) id,DepartName name,'0' isms,'' subcode,'false' checked,'true' nochecks", "SchId=" + schid + " and Stat=1 Order by OrderId,DepartName").Tables[0]; DataTable dtdptuser = dt.Clone(); dtdptuser.Columns["nochecks"].ColumnName = "nocheck"; if (dt.Rows.Count > 0) { //合并人员到部门表 for (int i = 0; i < dt.Rows.Count; i++) { dtdptuser.Rows.Add(dt.Rows[i].ItemArray); //获取该部门下的人员 DataRow[] drss = dtuser.Select("DeptId='" + dt.Rows[i]["id"].ToString() + "'"); if (drss.Length > 0) { foreach (DataRow item in drss) { DataRow dr = dtdptuser.NewRow(); dr["id"] = item["UserId"].ToString(); dr["name"] = item["UserTname"].ToString(); dr["pId"] = item["DeptId"].ToString(); if (dr["name"].ToString() == usermodel.Artisan.ToString()) { dr["checked"] = true; } dtdptuser.Rows.Add(dr); } } } } deptsuser = Newtonsoft.Json.JsonConvert.SerializeObject(dtdptuser); } }
protected void Page_Load(object sender, EventArgs e) { dotype = Request.Params["dotype"].ToString(); string AutoId = Request.Params["id"].ToString(); funcid = AutoId; schid = Com.Session.schid; SchSystem.BLL.ServFunc sfcBll = new SchSystem.BLL.ServFunc(); SchSystem.Model.ServFunc sfcModel = new SchSystem.Model.ServFunc(); string FuncSyss = ""; if (!string.IsNullOrEmpty(AutoId)) { sfcModel = sfcBll.GetServFuncModel(AutoId); FuncSyss = sfcModel.FuncSyss; servfuncModel = Newtonsoft.Json.JsonConvert.SerializeObject(sfcModel); } //业务类型 SchSystem.BLL.ServType stBll = new SchSystem.BLL.ServType(); DataTable stdt = stBll.GetList("TypeName,TypeCode", "").Tables[0]; businessType = Newtonsoft.Json.JsonConvert.SerializeObject(stdt); //业务平台 SchSystem.BLL.ServSys ssBll = new SchSystem.BLL.ServSys(); DataTable ssdt = ssBll.GetList("'0' pId,SysName name,SysCode id,SysUrl,'false' checked", "").Tables[0]; if (ssdt.Rows.Count > 0) { if (FuncSyss != "") { string[] FuncSyssArr = FuncSyss.Split(','); foreach (string s in FuncSyssArr) { for (int i = 0; i < ssdt.Rows.Count; i++) { if (ssdt.Rows[i]["id"].ToString() == s) { ssdt.Rows[i]["checked"] = "true"; } } } } } businessPlatfrom = Newtonsoft.Json.JsonConvert.SerializeObject(ssdt); //附加設置信息 SchSystem.BLL.ServSysNape ssnBll = new SchSystem.BLL.ServSysNape(); DataTable ssndt = ssnBll.GetList("Stat=1").Tables[0]; editServSysNape = Newtonsoft.Json.JsonConvert.SerializeObject(ssndt); //获取ServFuncExt表中相应FunId的数据记录 SchSystem.BLL.ServFuncExt sfeBll = new SchSystem.BLL.ServFuncExt(); DataTable dtServFuncExt = sfeBll.GetList("FuncId,NapeCode,NapeCodes,NapeC", "FuncId='" + AutoId + "'").Tables[0]; servfuncextjson = Newtonsoft.Json.JsonConvert.SerializeObject(dtServFuncExt); //附加設置信息之附加信息聯動內容默認下拉列表 SchSystem.BLL.SysPer spBll = new SchSystem.BLL.SysPer(); DataTable dtsp = spBll.GetList("'0' pId,PerName name,PerCode id,'false' checked", "Stat=1 order by convert(int,PerCode)").Tables[0]; if (dtsp.Rows.Count > 0) { for (int i = 0; i < dtsp.Rows.Count; i++) { if (dtServFuncExt.Rows.Count > 0) { if (dtServFuncExt.Rows[0]["NapeCodes"].ToString() != "") { string[] NapeCodesArr = dtServFuncExt.Rows[0]["NapeCodes"].ToString().Split(','); for (int j = 0; j < NapeCodesArr.Length; j++) { if (dtsp.Rows[i]["id"].ToString() == NapeCodesArr[j].ToString()) { dtsp.Rows[i]["checked"] = "true"; } } } } } } selectprdcontent = Newtonsoft.Json.JsonConvert.SerializeObject(dtsp); }
public static string getaddcont(string napecode) { string ret = ""; if (Com.Session.userid == null) { ret = "expire"; } else { SchSystem.BLL.ServFuncExt sfeBll = new SchSystem.BLL.ServFuncExt(); DataTable dtServFuncExt = sfeBll.GetList("FuncId,NapeCode,NapeCodes,NapeC", "FuncId='" + funcid + "' and NapeCode='" + napecode + "'").Tables[0]; retprompt retobj = new retprompt(); if (napecode == "prd")//學段 { SchSystem.BLL.SysPer spBll = new SchSystem.BLL.SysPer(); DataTable dt = spBll.GetList("'0' pId,PerName name,PerCode id,'false' checked", "Stat=1 order by convert(int,PerCode)").Tables[0]; if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { if (dtServFuncExt.Rows.Count > 0) { if (dtServFuncExt.Rows[0]["NapeCodes"].ToString() != "") { string[] NapeCodesArr = dtServFuncExt.Rows[0]["NapeCodes"].ToString().Split(','); for (int j = 0; j < NapeCodesArr.Length; j++) { if (dt.Rows[i]["id"].ToString() == NapeCodesArr[j].ToString()) { dt.Rows[i]["checked"] = "true"; } } } } } } retobj.retxt = napecode; retobj.retobj = dt; ret = Newtonsoft.Json.JsonConvert.SerializeObject(retobj); } else if (napecode == "grd")//年級 { SchSystem.BLL.SysGrade spBll = new SchSystem.BLL.SysGrade(); DataTable dt = spBll.GetList("'0' pId,GradeName name,GradeCode id,'false' checked", "").Tables[0]; if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { if (dtServFuncExt.Rows.Count > 0) { if (dtServFuncExt.Rows[0]["NapeCodes"].ToString() != "") { string[] NapeCodesArr = dtServFuncExt.Rows[0]["NapeCodes"].ToString().Split(','); for (int j = 0; j < NapeCodesArr.Length; j++) { if (dt.Rows[i]["id"].ToString() == NapeCodesArr[j].ToString()) { dt.Rows[i]["checked"] = "true"; } } } } } } retobj.retxt = napecode; retobj.retobj = dt; ret = Newtonsoft.Json.JsonConvert.SerializeObject(retobj); } else if (napecode == "sub")//科目 { SchSystem.BLL.SysSub spBll = new SchSystem.BLL.SysSub(); DataTable dt = spBll.GetList("'0' pId,SubName name,SubCode id,'false' checked", "Stat=1 Order by SubCode").Tables[0]; if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { if (dtServFuncExt.Rows.Count > 0) { if (dtServFuncExt.Rows[0]["NapeCodes"].ToString() != "") { string[] NapeCodesArr = dtServFuncExt.Rows[0]["NapeCodes"].ToString().Split(','); for (int j = 0; j < NapeCodesArr.Length; j++) { if (dt.Rows[i]["id"].ToString() == NapeCodesArr[j].ToString()) { dt.Rows[i]["checked"] = "true"; } } } } } } retobj.retxt = napecode; retobj.retobj = dt; ret = Newtonsoft.Json.JsonConvert.SerializeObject(retobj); } else if (napecode == "utp")//角色 { SchSystem.BLL.SysUType spBll = new SchSystem.BLL.SysUType(); DataTable dt = spBll.GetList("'0' pId,UTypeName name,UTypeCOde id,'false' checked", "Stat=1").Tables[0]; if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { if (dtServFuncExt.Rows.Count > 0) { if (dtServFuncExt.Rows[0]["NapeCodes"].ToString() != "") { string[] NapeCodesArr = dtServFuncExt.Rows[0]["NapeCodes"].ToString().Split(','); for (int j = 0; j < NapeCodesArr.Length; j++) { if (dt.Rows[i]["id"].ToString() == NapeCodesArr[j].ToString()) { dt.Rows[i]["checked"] = "true"; } } } } } } retobj.retxt = napecode; retobj.retobj = dt; ret = Newtonsoft.Json.JsonConvert.SerializeObject(retobj); } else if (napecode == "mat")//教版 { SchSystem.BLL.SysMater spBll = new SchSystem.BLL.SysMater(); DataTable dt = spBll.GetList("'0' pId,MaterName name,MaterCode id,'false' checked", "Stat=1").Tables[0]; if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { if (dtServFuncExt.Rows.Count > 0) { if (dtServFuncExt.Rows[0]["NapeCodes"].ToString() != "") { string[] NapeCodesArr = dtServFuncExt.Rows[0]["NapeCodes"].ToString().Split(','); for (int j = 0; j < NapeCodesArr.Length; j++) { if (dt.Rows[i]["id"].ToString() == NapeCodesArr[j].ToString()) { dt.Rows[i]["checked"] = "true"; } } } } } } retobj.retxt = napecode; retobj.retobj = dt; ret = Newtonsoft.Json.JsonConvert.SerializeObject(retobj); } else { retobj.retxt = napecode; retobj.retobj = ""; ret = Newtonsoft.Json.JsonConvert.SerializeObject(retobj); } } return(ret); }