protected void Page_Load(object sender, EventArgs e) { if (Com.Session.userid == null) { Response.Redirect("../../Login.aspx"); Response.End(); } else { //业务功能 SchSystem.BLL.ServFunc servfuncbll = new SchSystem.BLL.ServFunc(); DataTable servfuncdt = servfuncbll.GetList("'0' pId,FuncName name,FuncCode id,TypeCode,'false' checked", "").Tables[0]; businessPlatfrom = Newtonsoft.Json.JsonConvert.SerializeObject(servfuncdt); #region 獲取省市區 //获取省份 StringBuilder areaProvince = new StringBuilder(); string sareacode = ""; areaProvince.Append(Com.Public.GetDrpArea("0", "", ref sareacode, true, "1")); province = areaProvince.ToString(); //获取城市 StringBuilder areaCity = new StringBuilder(); string sareacitycode = ""; areaCity.Append(Com.Public.GetDrpArea("1", sareacode, ref sareacitycode, true, "1")); city = areaCity.ToString(); #endregion } }
protected void Page_Load(object sender, EventArgs e) { SchSystem.BLL.ServBus servbusbll = new SchSystem.BLL.ServBus(); SchSystem.Model.ServBus servbusmodel = new SchSystem.Model.ServBus(); BusId = Request.Params["BusId"].ToString(); servbusmodel = servbusbll.GetModel(int.Parse(BusId)); string FuncStr = ""; string sareacode = ""; string sareacitycode = ""; if (servbusmodel != null && servbusmodel.BusId > 0) { FuncStr = servbusmodel.FuncStr; if (!string.IsNullOrEmpty(servbusmodel.BusArea)) { sareacode = servbusmodel.BusArea.Substring(0, 2) + "0000"; sareacitycode = servbusmodel.BusArea; } umodelstr = Newtonsoft.Json.JsonConvert.SerializeObject(servbusmodel); } else { Response.Write("无该套餐!"); Response.End(); } //业务功能 SchSystem.BLL.ServFunc servfuncBll = new SchSystem.BLL.ServFunc(); DataTable servfuncdt = servfuncBll.GetList("'0' pId,FuncName name,FuncCode id,TypeCode,'false' checked", "").Tables[0]; if (servfuncdt.Rows.Count > 0) { if (FuncStr != "") { string[] ServFuncArr = FuncStr.Split(','); foreach (string s in ServFuncArr) { for (int i = 0; i < servfuncdt.Rows.Count; i++) { if (servfuncdt.Rows[i]["id"].ToString() == s) { servfuncdt.Rows[i]["checked"] = "true"; } } } } } businessPlatfrom = Newtonsoft.Json.JsonConvert.SerializeObject(servfuncdt); #region 獲取省市區 //获取省份 StringBuilder areaProvince = new StringBuilder(); areaProvince.Append(Com.Public.GetDrpArea("0", "", ref sareacode, true, "0")); province = areaProvince.ToString(); //获取城市 StringBuilder areaCity = new StringBuilder(); areaCity.Append(Com.Public.GetDrpArea("1", sareacode, ref sareacitycode, true, "0")); city = areaCity.ToString(); #endregion }
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 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); }
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 Com.DataPack.DataRsp <string> FuncEditSave(List <string> arr) { Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>(); string oldFuncCode = ""; if (Com.Session.userid == null) { rsp.code = "expire"; rsp.msg = "你现在登录已过期,请重新登录!"; } else { try { SchSystem.BLL.ServFunc sfcBll = new SchSystem.BLL.ServFunc(); SchSystem.Model.ServFunc sfcModel = new SchSystem.Model.ServFunc(); foreach (string str in arr) { string[] strarr = str.Split('#'); if (strarr[0] == "autoid") { sfcModel.AutoId = int.Parse(strarr[1]); } else if (strarr[0] == "businesstype") { sfcModel.TypeCode = strarr[1].Trim(); } else if (strarr[0] == "businesscode") { sfcModel.FuncCode = strarr[1].Trim(); } else if (strarr[0] == "oldbusinesscode") { oldFuncCode = strarr[1].Trim(); } else if (strarr[0] == "funcname") { sfcModel.FuncName = strarr[1].Trim(); } else if (strarr[0] == "userange") { sfcModel.FuncRange = strarr[1].Trim(); } else if (strarr[0] == "addsetinfo") { sfcModel.FuncSet = strarr[1].Trim(); } else if (strarr[0] == "businessdesc") { sfcModel.FuncDes = strarr[1].Trim(); } else if (strarr[0] == "tagsbusplatfrom") { sfcModel.FuncSyss = strarr[1].Trim(); } else if (strarr[0] == "note") { sfcModel.FuncNote = strarr[1].Trim(); } } if (sfcModel.TypeCode == "" || sfcModel.FuncCode == "" || sfcModel.FuncName == "" || sfcModel.FuncRange == "" || sfcModel.FuncSet == "" || sfcModel.FuncSyss == "") { rsp.code = "error"; rsp.msg = "操作失败!不允许输入空格"; } else { bool resbool = false; if (sfcModel.FuncCode != oldFuncCode) { resbool = sfcBll.Exists(sfcModel.FuncCode); } if (resbool == false) { bool result = sfcBll.Update(sfcModel); if (result) { SchSystem.BLL.ServFuncExt sfeBll = new SchSystem.BLL.ServFuncExt(); SchSystem.Model.ServFuncExt sfeModel = new SchSystem.Model.ServFuncExt(); sfeBll.Delete(sfcModel.AutoId); string FuncSet = sfcModel.FuncSet; string[] FuncSetRecArr = FuncSet.Split('|');//英文半角“|” for (int i = 0; i < FuncSetRecArr.Length; i++) { string[] FuncSetItemArr = FuncSetRecArr[i].Split('!');//英文半角“!” sfeModel.FuncId = sfcModel.AutoId; sfeModel.NapeCode = FuncSetItemArr[0]; sfeModel.NapeCodes = FuncSetItemArr[1]; sfeModel.NapeC = int.Parse(FuncSetItemArr[2]); sfeBll.Add(sfeModel); } rsp.code = "success"; rsp.msg = "操作成功"; } else { rsp.code = "error"; rsp.msg = "操作失败"; } } else { rsp.code = "codeRepeat"; rsp.msg = "功能代码不允许重复"; } } } catch (Exception ex) { rsp.code = "excepError"; rsp.msg = ex.Message; } } return(rsp); }
public static Com.DataPack.DataRsp <string> FuncAddSave(List <string> arr) { Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>(); if (Com.Session.userid == null) { rsp.code = "expire"; rsp.msg = "你现在登录已过期,请重新登录!"; } else { try { SchSystem.BLL.ServFunc sfcBll = new SchSystem.BLL.ServFunc(); SchSystem.Model.ServFunc sfcModel = new SchSystem.Model.ServFunc(); foreach (string str in arr) { string[] strarr = str.Split('#'); if (strarr[0] == "businesstype") { sfcModel.TypeCode = strarr[1].Trim(); } else if (strarr[0] == "businesscode") { sfcModel.FuncCode = strarr[1].Trim(); } else if (strarr[0] == "funcname") { sfcModel.FuncName = strarr[1].Trim(); } else if (strarr[0] == "userange") { sfcModel.FuncRange = strarr[1].Trim(); } else if (strarr[0] == "addsetinfo") { sfcModel.FuncSet = strarr[1].Trim(); } else if (strarr[0] == "businessdesc") { sfcModel.FuncDes = strarr[1].Trim(); } else if (strarr[0] == "tagsbusplatfrom") { sfcModel.FuncSyss = strarr[1].Trim(); } else if (strarr[0] == "note") { sfcModel.FuncNote = strarr[1].Trim(); } } if (sfcModel.TypeCode == "" || sfcModel.FuncCode == "" || sfcModel.FuncName == "" || sfcModel.FuncRange == "" || sfcModel.FuncSet == "" || sfcModel.FuncSyss == "") { rsp.code = "error"; rsp.msg = "操作失败!不允许输入空格"; } else { bool resbool = sfcBll.Exists(sfcModel.FuncCode); if (!resbool) { int result = sfcBll.Add(sfcModel); if (result > 0) { string FuncSet = sfcModel.FuncSet; string[] FuncSetRecArr = FuncSet.Split('|');//英文半角“|” DataTable dt = new DataTable(); dt.Columns.Add("FuncId"); dt.Columns.Add("NapeCode"); dt.Columns.Add("NapeCodes"); dt.Columns.Add("NapeC"); SchSystem.BLL.ServFuncExt sfeBll = new SchSystem.BLL.ServFuncExt(); for (int i = 0; i < FuncSetRecArr.Length; i++) { string[] FuncSetItemArr = FuncSetRecArr[i].Split('!');//英文半角“!” //SchSystem.BLL.ServFuncExt sfeBll = new SchSystem.BLL.ServFuncExt(); //SchSystem.Model.ServFuncExt sfeModel = new SchSystem.Model.ServFuncExt(); //sfeModel.FuncId = result; //sfeModel.NapeCode = FuncSetItemArr[0]; //sfeModel.NapeCodes = FuncSetItemArr[1]; //sfeModel.NapeC = int.Parse(FuncSetItemArr[2]); //sfeBll.Add(sfeModel); DataRow dry = dt.NewRow(); dry["FuncId"] = result; dry["NapeCode"] = Com.Public.SqlEncStr(FuncSetItemArr[0]); dry["NapeCodes"] = Com.Public.SqlEncStr(FuncSetItemArr[1]); dry["NapeC"] = int.Parse(Com.Public.SqlEncStr(FuncSetItemArr[2])); dt.Rows.Add(dry); } rsp.code = "success"; rsp.msg = sfeBll.ExecuteSqlBulkCopy(dt, "ServFuncExt"); } else { rsp.code = "error"; rsp.msg = "操作失败"; } } else { rsp.code = "codeRepeat"; rsp.msg = "功能代码不允许重复"; } } } catch (Exception ex) { rsp.code = "excepError"; rsp.msg = ex.Message; } } return(rsp); }