public string umodelstr = "1"; //学校model protected void Page_Load(object sender, EventArgs e) { //先得到操作类型 SchSystem.BLL.SchInfo schbll = new SchSystem.BLL.SchInfo(); SchSystem.Model.SchInfo usermodel = new SchSystem.Model.SchInfo(); dotype = Request.Params["dotype"].ToString(); if (dotype == "e")//修改,不能修改用户的类型及学校参数 { schid = Request.Params["schid"].ToString(); if (string.IsNullOrEmpty(schid)) { Response.Write("无对应修改的记录!"); Response.End(); } //获取修改的对应用户的 usermodel = schbll.GetSupportModel(int.Parse(schid)); if (usermodel != null && usermodel.SchId > 0) { umodelstr = Newtonsoft.Json.JsonConvert.SerializeObject(usermodel); } else { Response.Write("无该学校!"); Response.End(); } } else//不在添加及修改之内,则返回 { Response.Write("没有可供确认的操作类型!"); Response.End(); } }
protected void Page_Load(object sender, EventArgs e) { schid = Com.Public.SqlEncStr(Request.Params["schid"].ToString()); SchSystem.Model.SchInfo usermodel = new SchSystem.Model.SchInfo(); SchSystem.BLL.SchInfo schbll = new SchSystem.BLL.SchInfo(); usermodel = schbll.GetSupportModel(int.Parse(schid)); //获取下拉列表 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(Com.Public.GetDrpArea("0", "", ref sareacode, false, "0")); 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(Com.Public.GetDrpArea("1", sareacode, ref sareacitycode, false, "0")); 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(Com.Public.GetDrpArea("2", sareacitycode, ref sareacotycode, false, "0")); sbarea.Append("</select> "); //获取学校 sbarea.Append("学校:<select id=\"asch\">"); string sareaschid = ""; if (usermodel != null && usermodel.SchId > 0 && usermodel.AreaNo.Length == 6) { sareaschid = usermodel.SchId.ToString(); } sbarea.Append(Com.Public.GetDrpArea("3", sareacotycode, ref sareaschid, false, "0")); sbarea.Append("</select> "); areastr = sbarea.ToString(); sessionid = Session.SessionID; //OAnoticestr = string.Format(Com.Public.getKey("OAnotice"), Session.SessionID, schid);//通知公告 OAnoticestr = Com.Public.getKey("OAnotice"); //OAapplystr = string.Format(Com.Public.getKey("OAapply"), Session.SessionID, schid);//审批文件 OAapplystr = Com.Public.getKey("OAapply"); }
protected void Page_Load(object sender, EventArgs e) { if (Request.Params["schid"] != null && Request.Params["schid"].ToString() != "") { string schid = Com.Public.SqlEncStr(Request.Params["schid"].ToString()); //先得到操作类型 SchSystem.BLL.SchInfo schbll = new SchSystem.BLL.SchInfo(); SchSystem.Model.SchInfo usermodel = new SchSystem.Model.SchInfo(); if (string.IsNullOrEmpty(schid)) { Response.Write("无对应修改的记录!"); Response.End(); } //获取修改的对应用户的 usermodel = schbll.GetSupportModel(int.Parse(schid)); if (usermodel != null && usermodel.SchId > 0) { umodelstr = Newtonsoft.Json.JsonConvert.SerializeObject(usermodel); } else { Response.Write("无该学校!"); Response.End(); } if (!string.IsNullOrEmpty(schid)) { //获取管理员账号密码信息 SchSystem.BLL.SchUserInfo suiBll = new SchSystem.BLL.SchUserInfo(); SchSystem.Model.SchUserInfo modeluserinfo = suiBll.GetSupportModel(int.Parse(schid), 1); if (modeluserinfo != null) { if (modeluserinfo.PassWord == Com.Public.StrToMD5("123456")) { modeluserinfo.PassWord = "******"; } } usermanagerstr = Newtonsoft.Json.JsonConvert.SerializeObject(modeluserinfo); //系统科目 SchSystem.BLL.SysSub syssubbll = new SchSystem.BLL.SysSub(); DataTable dtsub = syssubbll.GetList("'0' pId,SubCode id,SubName name,'false' checked", "1=1 Order by SubCode").Tables[0];//Stat=1 //获取学校的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]; DataTable dtsubmat = dtsub.Copy(); if (dtsub != null && dtschsub != null && dtsub.Rows.Count > 0 && dtschsub.Rows.Count > 0) { for (int i = 0; i < dtsub.Rows.Count; i++) { DataRow[] drs = dtschsub.Select("id='" + dtsub.Rows[i]["id"].ToString() + "'"); if (drs.Length > 0) { dtsub.Rows[i]["checked"] = "true"; } } } subs = Newtonsoft.Json.JsonConvert.SerializeObject(dtsub); subsmat = Newtonsoft.Json.JsonConvert.SerializeObject(dtsubmat); //获取子系统:AutoId,AppCode,AppName,Stat,RecTime,RecUser,LastRecTime,LastRecUser SchSystem.BLL.SchApp schappBll = new SchSystem.BLL.SchApp(); DataTable dtschapp = schappBll.GetList("'0' pId,AutoId id,AppName name,'false' checked,AppCode", "").Tables[0]; SchSystem.BLL.SchAppRole schapproleBll = new SchSystem.BLL.SchAppRole(); DataTable dtschapprole = schapproleBll.GetList("SchId='" + schid + "'").Tables[0]; if (dtschapp.Rows.Count > 0) { for (int i = 0; i < dtschapp.Rows.Count; i++) { DataRow[] drstr = dtschapprole.Select(); if (drstr.Length > 0) { string approlestr = drstr[0]["AppStr"].ToString(); string[] approlearr = approlestr.Split(','); int approlearrlen = approlearr.Length; for (int j = 0; j < approlearrlen; j++) { if (dtschapp.Rows[i]["AppCode"].ToString() == approlearr[j]) { dtschapp.Rows[i]["checked"] = "true"; } } } } } 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,'' GradeYear,'' GradeId", " GradeCode<>'3004' and GradeCode<>'4004' Order by GradeType,GradeLv").Tables[0]; #region 家校互通平台子模块 SchSystem.BLL.SchAppXXT saxxtBll = new SchSystem.BLL.SchAppXXT(); DataTable dtsaxxt = saxxtBll.GetList("'0' pId,AppCode id,AppName name,'false' checked,'false' isShar", "Stat=1").Tables[0]; SchSystem.BLL.SchAppRoleXXT sarxxtBll = new SchSystem.BLL.SchAppRoleXXT(); DataTable dtsarxxt = sarxxtBll.GetList("SchId='" + schid + "'").Tables[0]; DataRow[] drsarxxt = dtsarxxt.Select(); string[] approlexxtarr = { }; if (drsarxxt.Length > 0) { approlexxtarr = drsarxxt[0]["AppStr"].ToString().Split(','); if (dtsaxxt.Rows.Count > 0) { for (int i = 0; i < dtsaxxt.Rows.Count; i++) { for (int j = 0; j < approlexxtarr.Length; j++) { if (dtsaxxt.Rows[i]["id"].ToString() == approlexxtarr[j].ToString()) { dtsaxxt.Rows[i]["checked"] = "true"; } } } } } sarxxttree = Newtonsoft.Json.JsonConvert.SerializeObject(dtsaxxt); #endregion //家校互通平台学段、科目教版 SchSystem.BLL.SchPerSubMatXXT spsmxxtBll = new SchSystem.BLL.SchPerSubMatXXT(); DataTable dtspsmxxt = spsmxxtBll.SchPerSubMatXXTV("SchId='" + schid + "' Order by convert(int,PerCode) asc").Tables[0]; showmaterxxttree = Newtonsoft.Json.JsonConvert.SerializeObject(dtspsmxxt); //获取学校的年级 SchSystem.BLL.SchGradeInfo schgradebll = new SchSystem.BLL.SchGradeInfo(); DataTable dtschgrade = schgradebll.GetList("GradeCode id,GradeYear,GradeId", "isfinish='0' and SchId='" + schid + "'").Tables[0]; 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) { dtgrade.Rows[i]["checked"] = "true"; dtgrade.Rows[i]["GradeYear"] = drs[0]["GradeYear"]; dtgrade.Rows[i]["GradeId"] = drs[0]["GradeId"]; } } } //獲取畢業年級的年級名稱和入學年份 //DataTable dtres = schgradebll.GetListGradeFinish("GradeCode,GradeName,GradeYear", int.Parse(schid), int.Parse(CurrentYear)).Tables[0]; DataTable dtres = schgradebll.Graduated(int.Parse(schid)).Tables[0]; updateGrade = Newtonsoft.Json.JsonConvert.SerializeObject(dtres); //获取服务资源:AutoId,AppCode,AppName,Stat,RecTime,RecUser,LastRecTime,LastRecUser #region 获取服务资源 SchSystem.BLL.SchAppSoure schappsoureBll = new SchSystem.BLL.SchAppSoure(); DataTable dtschappsoure = schappsoureBll.GetList("'0' pId,AppCode id,AppName name,'false' checked,'false' isShar", "Stat=1").Tables[0]; SchSystem.BLL.SchAppRoleSoure sarsBll = new SchSystem.BLL.SchAppRoleSoure(); DataTable dtsars = sarsBll.GetList("SchId='" + schid + "'").Tables[0]; DataRow[] drsarsstr = dtsars.Select(); string[] approlesourearr = { }; if (drsarsstr.Length > 0) { approlesourearr = drsarsstr[0]["AppCode"].ToString().Split('|'); } if (dtschappsoure.Rows.Count > 0) { for (int i = 0; i < dtschappsoure.Rows.Count; i++) { //dtschappsoure.Rows[i]["name"] = dtschappsoure.Rows[i]["name"] + "【不共享】"; for (int j = 0; j < approlesourearr.Length; j++) { if (approlesourearr[j].Split(',').Length > 1) { string appsourestr = approlesourearr[j].Split(',')[0]; string appsourestat = approlesourearr[j].Split(',')[1]; if (dtschappsoure.Rows[i]["id"].ToString() == appsourestr) { if (appsourestat == "1") { dtschappsoure.Rows[i]["name"] = dtschappsoure.Rows[i]["name"] + "【共享】"; //dtschappsoure.Rows[i]["isShar"] = "true"; } else if (appsourestat == "0") { dtschappsoure.Rows[i]["name"] = dtschappsoure.Rows[i]["name"] + "【不共享】"; //dtschappsoure.Rows[i]["isShar"] = "false"; } dtschappsoure.Rows[i]["checked"] = "true"; } } } if (dtschappsoure.Rows[i]["checked"].ToString() == "false") { dtschappsoure.Rows[i]["name"] = dtschappsoure.Rows[i]["name"] + "【不共享】"; //dtschappsoure.Rows[i]["isShar"] = "false"; } } } souretree = Newtonsoft.Json.JsonConvert.SerializeObject(dtschappsoure); #endregion //获取教版 SchSystem.BLL.SysMater smaterBll = new SchSystem.BLL.SysMater(); DataTable dtsmater = smaterBll.GetList("'0' pId,MaterCode id,MaterName name,'false' checked,'' subcodechk,MaterCode,'' PerCode,'' SubCode,'' SubName", "Stat=1").Tables[0]; SchSystem.BLL.SchPerSubMat spsmBll = new SchSystem.BLL.SchPerSubMat(); DataTable dtspsm = spsmBll.SchPerSubMatVMatSub("SchId='" + schid + "' Order by convert(int,PerCode) asc").Tables[0]; //if (dtsmater.Rows.Count > 0) //{ // for (int i = 0; i < dtsmater.Rows.Count; i++) // { // foreach (DataRow dr in dtspsm.Rows) // { // string ss = dtsmater.Rows[i]["MaterCode"].ToString(); // string sss = dr["MaterCode"].ToString(); // if (dtsmater.Rows[i]["MaterCode"].ToString() == dr["MaterCode"].ToString()) // { // dtsmater.Rows[i]["checked"] = "true"; // dtsmater.Rows[i]["PerCode"] = dr["PerCode"]; // dtsmater.Rows[i]["SubCode"] = dr["SubCode"]; // dtsmater.Rows[i]["SubName"] = dr["SubName"]; // } // } // } //} sysmatertree = Newtonsoft.Json.JsonConvert.SerializeObject(dtsmater); showmatertree = Newtonsoft.Json.JsonConvert.SerializeObject(dtspsm); grades = Newtonsoft.Json.JsonConvert.SerializeObject(dtgrade); //获取下拉列表 StringBuilder sbarea = new StringBuilder(); string[] areanames = Com.Public.GetArea(usermodel.AreaNo.ToString()).Split('|'); sbarea.Append(areanames[0]); sbarea.Append(areanames[1]); sbarea.Append(areanames[2]); areastr = sbarea.ToString(); } } }
public string umodelsarstr = "1"; //学校资源模块 protected void Page_Load(object sender, EventArgs e) { //先得到操作类型 SchSystem.BLL.SchInfo schbll = new SchSystem.BLL.SchInfo(); SchSystem.Model.SchInfo usermodel = new SchSystem.Model.SchInfo(); dotype = Request.Params["dotype"].ToString(); if (dotype == "e")//修改,不能修改用户的类型及学校参数 { schid = Request.Params["schid"].ToString(); if (string.IsNullOrEmpty(schid)) { Response.Write("无对应修改的记录!"); Response.End(); } //获取修改的对应用户的 usermodel = schbll.GetSupportModel(int.Parse(schid)); if (usermodel != null && usermodel.SchId > 0) { umodelstr = Newtonsoft.Json.JsonConvert.SerializeObject(usermodel); // SchSystem.BLL.SchAppSoure sasBll = new SchSystem.BLL.SchAppSoure(); DataTable dtsar = sasBll.GetList("AppCode,AppName,'false' checked", "Stat=1").Tables[0]; if (dtsar.Rows.Count > 0) { dtsar.Columns.Add("UsharStat"); for (int j = 0; j < dtsar.Rows.Count; j++) { SchSystem.BLL.SchAppRoleSoure sarsBll = new SchSystem.BLL.SchAppRoleSoure(); DataTable dtsars = sarsBll.GetList("SchId='" + schid + "'").Tables[0]; if (dtsars.Rows.Count > 0) { string[] sarsarr = dtsars.Rows[0]["AppCode"].ToString().Split('|'); for (int i = 0; i < sarsarr.Length; i++) { int len = sarsarr[i].Split(',').Length; if (len > 1) { string issharstr = sarsarr[i].Split(',')[0]; string isshar = sarsarr[i].Split(',')[1]; //string sss = dtsar.Rows[j]["AppCode"].ToString(); if (isshar == "1" && issharstr == dtsar.Rows[j]["AppCode"].ToString()) { dtsar.Rows[j]["UsharStat"] = isshar; dtsar.Rows[j]["checked"] = "true"; } else if (dtsar.Rows[j]["AppCode"].ToString() == issharstr) { dtsar.Rows[j]["checked"] = "true"; } } } } } } umodelsarstr = Newtonsoft.Json.JsonConvert.SerializeObject(dtsar); // } else { Response.Write("无该学校!"); Response.End(); } } else//不在添加及修改之内,则返回 { Response.Write("没有可供确认的操作类型!"); Response.End(); } }