public string Query() { string text = base.Request.Form["Title"]; string text2 = base.Request.Form["Address"]; string text3 = base.Request.Form["typeid"]; string text4 = base.Request.Form["sidx"]; string text5 = base.Request.Form["sord"]; RoadFlow.Platform.Dictionary dictionary = new RoadFlow.Platform.Dictionary(); RoadFlow.Platform.AppLibrary appLibrary = new RoadFlow.Platform.AppLibrary(); string type = MyExtensions.IsGuid(text3) ? appLibrary.GetAllChildsIDString(MyExtensions.ToGuid(text3)) : ""; int pageSize = Tools.GetPageSize(); int pageNumber = Tools.GetPageNumber(); string order = (MyExtensions.IsNullOrEmpty(text4) ? "Title" : text4) + " " + (MyExtensions.IsNullOrEmpty(text5) ? "asc" : text5); long count; List <RoadFlow.Data.Model.AppLibrary> pagerData = appLibrary.GetPagerData(out count, pageSize, pageNumber, MyExtensions.Trim1(text), type, MyExtensions.Trim1(text2), order); JsonData jsonData = new JsonData(); foreach (RoadFlow.Data.Model.AppLibrary item in pagerData) { string empty = string.Empty; empty = ((!MyExtensions.IsFontIco(item.Ico)) ? ("<img src=\"" + MyExtensions.Trim1(item.Ico) + "\" style=\"vertical-align:middle;\" />") : ("<i class=\"fa " + MyExtensions.Trim1(item.Ico) + "\" style=\"font-size:14px;vertical-align:middle;" + (MyExtensions.IsNullOrEmpty(item.Color) ? "" : ("color:" + item.Color + ";")) + "\"></i>")); JsonData jsonData2 = new JsonData(); jsonData2["id"] = item.ID.ToString(); jsonData2["Title"] = empty + "<span style=\"vertical-align:middle;margin-left:4px;\">" + item.Title + "</span>"; jsonData2["Address"] = item.Address; jsonData2["TypeTitle"] = dictionary.GetTitle(item.Type); jsonData2["Opation"] = "<a class=\"editlink\" href=\"javascript:void(0);\" onclick=\"edit('" + item.ID.ToString() + "');return false;\" style=\"margin-right:6px;\">编辑</a><a class=\"editlink\" href=\"javascript:void(0);\" onclick=\"editsubpage('" + item.ID.ToString() + "');return false;\">子页面</a>"; jsonData.Add(jsonData2); } return("{\"userdata\":{\"total\":" + count + ",\"pagesize\":" + pageSize + ",\"pagenumber\":" + pageNumber + "},\"rows\":" + jsonData.ToJson() + "}"); }
private ActionResult query(string title1, string address) { string pager; string appid = Request.QueryString["appid"]; string tabid = Request.QueryString["tabid"]; string typeid = Request.QueryString["typeid"]; RoadFlow.Platform.Dictionary bdict = new RoadFlow.Platform.Dictionary(); RoadFlow.Platform.AppLibrary bapp = new RoadFlow.Platform.AppLibrary(); string typeidstring = typeid.IsGuid() ? bapp.GetAllChildsIDString(typeid.ToGuid()) : ""; string query = string.Format("&appid={0}&tabid={1}&title1={2}&typeid={3}&address={4}", Request.QueryString["appid"], Request.QueryString["tabid"], title1.UrlEncode(), typeid, address.UrlEncode() ); string query1 = string.Format("{0}&pagesize={1}&pagenumber={2}", query, Request.QueryString["pagesize"], Request.QueryString["pagenumber"]); List <RoadFlow.Data.Model.AppLibrary> appList = bapp.GetPagerData(out pager, query, title1, typeidstring, address); ViewBag.Pager = pager; ViewBag.AppID = appid; ViewBag.TabID = tabid; ViewBag.TypeID = typeid; ViewBag.Title1 = title1; ViewBag.Address = address; ViewBag.Query1 = query1; return(View(appList)); }
public string Tree1() { string msg; if (!Tools.CheckLogin(out msg) && !RoadFlow.Platform.WeiXin.Organize.CheckLogin()) { return(""); } RoadFlow.Platform.Dictionary dictionary1 = new RoadFlow.Platform.Dictionary(); string str = this.Request.QueryString["root"]; int num1 = "1" == this.Request.QueryString["ischild"] ? 1 : 0; Guid test = Guid.Empty; if (!str.IsNullOrEmpty() && !str.IsGuid(out test)) { RoadFlow.Data.Model.Dictionary byCode = dictionary1.GetByCode(str, false); if (byCode != null) { test = byCode.ID; } } RoadFlow.Data.Model.Dictionary dictionary2 = test != Guid.Empty ? dictionary1.Get(test, false) : dictionary1.GetRoot(); bool flag = dictionary1.HasChilds(dictionary2.ID); StringBuilder stringBuilder = new StringBuilder("[", 1000); stringBuilder.Append("{"); stringBuilder.AppendFormat("\"id\":\"{0}\",", (object)dictionary2.ID); stringBuilder.AppendFormat("\"parentID\":\"{0}\",", (object)dictionary2.ParentID); stringBuilder.AppendFormat("\"title\":\"{0}\",", (object)dictionary2.Title); stringBuilder.AppendFormat("\"type\":\"{0}\",", flag ? (object)"0" : (object)"2"); stringBuilder.AppendFormat("\"ico\":\"{0}\",", (object)this.Url.Content("~/images/ico/role.gif")); stringBuilder.AppendFormat("\"hasChilds\":\"{0}\",", flag ? (object)"1" : (object)"0"); stringBuilder.Append("\"childs\":["); List <RoadFlow.Data.Model.Dictionary> childs = dictionary1.GetChilds(dictionary2.ID, false); int num2 = 0; int count = childs.Count; foreach (RoadFlow.Data.Model.Dictionary dictionary3 in childs) { stringBuilder.Append("{"); stringBuilder.AppendFormat("\"id\":\"{0}\",", (object)dictionary3.ID); stringBuilder.AppendFormat("\"parentID\":\"{0}\",", (object)dictionary3.ParentID); stringBuilder.AppendFormat("\"title\":\"{0}\",", (object)dictionary3.Title); stringBuilder.AppendFormat("\"ico\":\"{0}\",", (object)""); stringBuilder.AppendFormat("\"hasChilds\":\"{0}\",", dictionary1.HasChilds(dictionary3.ID) ? (object)"1" : (object)"0"); stringBuilder.Append("\"childs\":["); stringBuilder.Append("]"); stringBuilder.Append("}"); if (num2++ < count - 1) { stringBuilder.Append(","); } } stringBuilder.Append("]"); stringBuilder.Append("}"); stringBuilder.Append("]"); return(stringBuilder.ToString()); }
public int GetAgentIDByCode(string code) { RoadFlow.Data.Model.Dictionary byCode = new RoadFlow.Platform.Dictionary().GetByCode(code, true); if (byCode != null) { return(byCode.Value.ToInt(-1)); } return(-1); }
public static string GetSecret(int agentId) { RoadFlow.Data.Model.Dictionary dictionary = new RoadFlow.Platform.Dictionary().GetChilds("weixinagents", true).Find((Predicate <RoadFlow.Data.Model.Dictionary>)(p => p.Value.ToInt(-1) == agentId)); if (dictionary != null) { return(dictionary.Note.Trim1()); } return(""); }
public static string GetSecret(string code) { RoadFlow.Data.Model.Dictionary byCode = new RoadFlow.Platform.Dictionary().GetByCode(code, true); if (byCode != null) { return(byCode.Note.Trim1()); } return(""); }
public ActionResult Sort(FormCollection collection) { RoadFlow.Platform.Dictionary dictionary1 = new RoadFlow.Platform.Dictionary(); string str1 = this.Request.QueryString["id"]; string str2 = ""; List <RoadFlow.Data.Model.Dictionary> dictionaryList = new List <RoadFlow.Data.Model.Dictionary>(); Guid test1; if (str1.IsGuid(out test1)) { RoadFlow.Data.Model.Dictionary dictionary2 = dictionary1.Get(test1, false); if (dictionary2 != null) { dictionaryList = dictionary1.GetChilds(dictionary2.ParentID, false); str2 = dictionary2.ParentID.ToString(); } } if (collection != null) { string str3 = this.Request.Form["sort"]; if (str3.IsNullOrEmpty()) { return((ActionResult)this.View((object)dictionaryList)); } string[] strArray = str3.Split(','); int num = 1; foreach (string str4 in strArray) { Guid test2; if (str4.IsGuid(out test2)) { dictionary1.UpdateSort(test2, num++); } } dictionary1.RefreshCache(); RoadFlow.Platform.Log.Add("保存了数据字典排序", "保存了ID为:" + str1 + "的同级排序", RoadFlow.Platform.Log.Types.数据字典, "", "", (RoadFlow.Data.Model.Users)null); // ISSUE: reference to a compiler-generated field if (DictController.\u003C\u003Eo__11.\u003C\u003Ep__0 == null) { // ISSUE: reference to a compiler-generated field DictController.\u003C\u003Eo__11.\u003C\u003Ep__0 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "Script", typeof(DictController), (IEnumerable <CSharpArgumentInfo>) new CSharpArgumentInfo[2] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, (string)null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, (string)null) })); } // ISSUE: reference to a compiler-generated field // ISSUE: reference to a compiler-generated field object obj = DictController.\u003C\u003Eo__11.\u003C\u003Ep__0.Target((CallSite)DictController.\u003C\u003Eo__11.\u003C\u003Ep__0, this.ViewBag, "parent.frames[0].reLoad('" + str2 + "');"); dictionaryList = dictionary1.GetChilds(str2.ToGuid(), false); } return((ActionResult)this.View((object)dictionaryList)); }
protected void Page_Load(object sender, EventArgs e) { string pager; string appid = Request.QueryString["appid"]; string tabid = Request.QueryString["tabid"]; string typeid = Request.QueryString["typeid"]; string title1 = Request.QueryString["title1"]; string address = Request.QueryString["address"]; RoadFlow.Platform.AppLibrary bapp = new RoadFlow.Platform.AppLibrary(); if (IsPostBack) { title1 = Request.Form["Title1"]; address = Request.Form["Address"]; //删除 if (!Request.Form["Button1"].IsNullOrEmpty()) { string deleteID = Request.Form["checkbox_app"]; System.Text.StringBuilder delxml = new System.Text.StringBuilder(); foreach (string id in deleteID.Split(',')) { Guid gid; if (id.IsGuid(out gid)) { var app = bapp.Get(gid); if (app != null) { delxml.Append(app.Serialize()); bapp.Delete(gid); } } } RoadFlow.Platform.Log.Add("删除了一批应用程序库", delxml.ToString(), RoadFlow.Platform.Log.Types.角色应用); } } RoadFlow.Platform.Dictionary bdict = new RoadFlow.Platform.Dictionary(); string typeidstring = typeid.IsGuid() ? bapp.GetAllChildsIDString(typeid.ToGuid()) : ""; Query = string.Format("&appid={0}&tabid={1}&title1={2}&typeid={3}&address={4}", Request.QueryString["appid"], Request.QueryString["tabid"], title1.UrlEncode(), typeid, address.UrlEncode() ); Query1 = string.Format("{0}&pagesize={1}&pagenumber={2}", Query, Request.QueryString["pagesize"], Request.QueryString["pagenumber"]); AppList = bapp.GetPagerData(out pager, Query, title1, typeidstring, address); this.Pager.Text = pager; }
public ActionResult add1(FormCollection collection) { RoadFlow.Data.Model.Dictionary model = new RoadFlow.Data.Model.Dictionary(); RoadFlow.Platform.Dictionary dictionary = new RoadFlow.Platform.Dictionary(); string str1 = this.Request.QueryString["id"]; if (!str1.IsGuid()) { RoadFlow.Data.Model.Dictionary root = dictionary.GetRoot(); str1 = root != null?root.ID.ToString() : ""; } if (!str1.IsGuid()) { throw new Exception("未找到父级"); } if (collection != null) { string str2 = this.Request.Form["Title"]; string str3 = this.Request.Form["Code"]; string str4 = this.Request.Form["Values"]; string str5 = this.Request.Form["Note"]; string str6 = this.Request.Form["Other"]; model.ID = Guid.NewGuid(); model.Code = str3.IsNullOrEmpty() ? (string)null : str3.Trim(); model.Note = str5.IsNullOrEmpty() ? (string)null : str5.Trim(); model.Other = str6.IsNullOrEmpty() ? (string)null : str6.Trim(); model.ParentID = str1.ToGuid(); model.Sort = dictionary.GetMaxSort(str1.ToGuid()); model.Title = str2.Trim(); model.Value = str4.IsNullOrEmpty() ? (string)null : str4.Trim(); dictionary.Add(model); dictionary.RefreshCache(); RoadFlow.Platform.Log.Add("添加了数据字典项", model.Serialize(), RoadFlow.Platform.Log.Types.数据字典, "", "", (RoadFlow.Data.Model.Users)null); // ISSUE: reference to a compiler-generated field if (DictController.\u003C\u003Eo__9.\u003C\u003Ep__0 == null) { // ISSUE: reference to a compiler-generated field DictController.\u003C\u003Eo__9.\u003C\u003Ep__0 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "Script", typeof(DictController), (IEnumerable <CSharpArgumentInfo>) new CSharpArgumentInfo[2] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, (string)null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, (string)null) })); } // ISSUE: reference to a compiler-generated field // ISSUE: reference to a compiler-generated field object obj = DictController.\u003C\u003Eo__9.\u003C\u003Ep__0.Target((CallSite)DictController.\u003C\u003Eo__9.\u003C\u003Ep__0, this.ViewBag, "alert('添加成功!');parent.frames[0].reLoad('" + str1 + "');"); } return((ActionResult)this.View((object)model)); }
public ActionResult Body(FormCollection collection) { RoadFlow.Platform.Dictionary bdict = new RoadFlow.Platform.Dictionary(); RoadFlow.Data.Model.Dictionary dict = null; string id = Request.QueryString["id"]; if (id.IsGuid()) { dict = bdict.Get(id.ToGuid()); } if (dict == null) { dict = bdict.GetRoot(); } if (collection != null) { string refreshID = dict.ParentID == Guid.Empty ? dict.ID.ToString() : dict.ParentID.ToString(); //删除 if (!Request.Form["Delete"].IsNullOrEmpty()) { int i = bdict.DeleteAndAllChilds(dict.ID); bdict.RefreshCache(); RoadFlow.Platform.Log.Add("删除了数据字典及其下级共" + i.ToString() + "项", dict.Serialize(), RoadFlow.Platform.Log.Types.数据字典); ViewBag.Script = "alert('删除成功!');parent.frames[0].reLoad('" + refreshID + "');window.location='Body?id=" + dict.ParentID.ToString() + "&appid=" + Request.QueryString["appid"] + "';"; return(View(dict)); } string title = Request.Form["Title"]; string code = Request.Form["Code"]; string values = Request.Form["Values"]; string note = Request.Form["Note"]; string other = Request.Form["Other"]; string oldXML = dict.Serialize(); dict.Code = code.IsNullOrEmpty() ? null : code.Trim(); dict.Note = note.IsNullOrEmpty() ? null : note.Trim(); dict.Other = other.IsNullOrEmpty() ? null : other.Trim(); dict.Title = title.Trim(); dict.Value = values.IsNullOrEmpty() ? null : values.Trim(); bdict.Update(dict); bdict.RefreshCache(); RoadFlow.Platform.Log.Add("修改了数据字典项", "", RoadFlow.Platform.Log.Types.数据字典, oldXML, dict.Serialize()); ViewBag.Script = "alert('保存成功!');parent.frames[0].reLoad('" + refreshID + "');"; } return(View(dict)); }
public string GetNote() { string text = base.Request.QueryString["id"]; string result = ""; Guid id = default(Guid); if (MyExtensions.IsGuid(text, out id)) { RoadFlow.Data.Model.Dictionary dictionary = new RoadFlow.Platform.Dictionary().Get(id, fromCache: true); if (dictionary != null) { result = dictionary.Note; } } return(result); }
public string GetNote() { string id = Request.QueryString["id"]; Guid gid; string note = ""; if (id.IsGuid(out gid)) { var dict = new RoadFlow.Platform.Dictionary().Get(gid, true); if (dict != null) { note = dict.Note; } } return(note); }
protected void Page_Load(object sender, EventArgs e) { string values = Request.QueryString["values"]; RoadFlow.Platform.Dictionary Dict = new RoadFlow.Platform.Dictionary(); System.Text.StringBuilder sb = new System.Text.StringBuilder(); foreach (string value in values.Split(',')) { var dict = Dict.Get(value.ToGuid(), true); if (dict != null) { sb.Append(dict.Title); sb.Append(','); } } Response.Write(sb.ToString().TrimEnd(',')); }
public string GetNames() { string values = Request.QueryString["values"] ?? ""; RoadFlow.Platform.Dictionary Dict = new RoadFlow.Platform.Dictionary(); System.Text.StringBuilder sb = new System.Text.StringBuilder(); foreach (string value in values.Split(',')) { var dict = Dict.Get(value.ToGuid(), true); if (dict != null) { sb.Append(dict.Title); sb.Append(','); } } return(sb.ToString().TrimEnd(',')); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; string id = context.Request.QueryString["id"]; Guid gid; string note = ""; if (id.IsGuid(out gid)) { var dict = new RoadFlow.Platform.Dictionary().Get(gid, true); if (dict != null) { note = dict.Note; } } context.Response.Write(note); }
public ActionResult Sort(FormCollection collection) { RoadFlow.Platform.Dictionary BDict = new RoadFlow.Platform.Dictionary(); string id = Request.QueryString["id"]; string refreshID = ""; Guid dictid; List <RoadFlow.Data.Model.Dictionary> dicts = new List <RoadFlow.Data.Model.Dictionary>(); if (id.IsGuid(out dictid)) { var dict = BDict.Get(dictid); if (dict != null) { dicts = BDict.GetChilds(dict.ParentID); refreshID = dict.ParentID.ToString(); } } if (collection != null) { string sortdict = Request.Form["sort"]; if (sortdict.IsNullOrEmpty()) { return(View(dicts)); } string[] sortArray = sortdict.Split(','); int i = 1; foreach (string id1 in sortArray) { Guid gid; if (id1.IsGuid(out gid)) { BDict.UpdateSort(gid, i++); } } BDict.RefreshCache(); RoadFlow.Platform.Log.Add("保存了数据字典排序", "保存了ID为:" + id + "的同级排序", RoadFlow.Platform.Log.Types.数据字典); ViewBag.Script = "parent.frames[0].reLoad('" + refreshID + "');"; dicts = BDict.GetChilds(refreshID.ToGuid()); } return(View(dicts)); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; string values = context.Request.QueryString["values"] ?? ""; RoadFlow.Platform.Dictionary Dict = new RoadFlow.Platform.Dictionary(); System.Text.StringBuilder sb = new System.Text.StringBuilder(); foreach (string value in values.Split(',')) { var dict = Dict.Get(value.ToGuid(), true); if (dict != null) { sb.Append(dict.Title); sb.Append(','); } } context.Response.Write(sb.ToString().TrimEnd(',')); }
public string Query() { List <RoadFlow.Data.Model.WorkFlow> workFlowList = new List <RoadFlow.Data.Model.WorkFlow>(); RoadFlow.Platform.Users users = new RoadFlow.Platform.Users(); RoadFlow.Platform.WorkFlow workFlow1 = new RoadFlow.Platform.WorkFlow(); string name = this.Request.Form["flow_name"]; string str1 = this.Request.Form["typeid"]; string str2 = this.Request.Form["sidx"]; string str3 = this.Request.Form["sord"]; bool flag = "1" == this.Request.Form["openlist"]; string typeid = ""; if (str1.IsGuid()) { typeid = new RoadFlow.Platform.Dictionary().GetAllChildsIDString(str1.ToGuid(), true); } int pageSize = flag ? 10 : RoadFlow.Utility.Tools.GetPageSize(); int pageNumber = RoadFlow.Utility.Tools.GetPageNumber(); string order = (str2.IsNullOrEmpty() ? "CreateDate" : str2) + " " + (str3.IsNullOrEmpty() ? "asc" : str3); long count; List <RoadFlow.Data.Model.WorkFlow> pagerData = workFlow1.GetPagerData(out count, pageSize, pageNumber, RoadFlow.Platform.Users.CurrentUserID.ToString(), typeid, name, order); JsonData jsonData1 = new JsonData(); foreach (RoadFlow.Data.Model.WorkFlow workFlow2 in pagerData) { JsonData jsonData2 = new JsonData(); jsonData2["id"] = (JsonData)workFlow2.ID.ToString(); jsonData2["Name"] = (JsonData)workFlow2.Name; jsonData2["CreateDate"] = (JsonData)workFlow2.CreateDate.ToDateTimeString(); jsonData2["CreateUserID"] = (JsonData)users.GetName(workFlow2.CreateUserID); jsonData2["Status"] = (JsonData)workFlow1.GetStatusTitle(workFlow2.Status); if (flag) { jsonData2["Edit"] = (JsonData)("<a href=\"javascript:void(0);\" onclick=\"openflow('" + (object)workFlow2.ID + "');return false;\"><img src=\"" + this.Url.Content("~/Images/ico/topic_edit.gif") + "\" alt=\"\" style=\"vertical-align:middle; border:0;\" /><span style=\"vertical-align:middle; margin-left:3px;\">编辑</span></a>"); } else { jsonData2["Edit"] = (JsonData)("<a class=\"editlink\" href=\"javascript:void(0);\" onclick=\"openflow('" + (object)workFlow2.ID + "','" + workFlow2.Name + "');return false;\"><span style=\"vertical-align:middle;\">编辑</span></a><a class=\"deletelink\" href=\"javascript:void(0);\" style=\"margin-left:5px\" onclick=\"delflow('" + (object)workFlow2.ID + "'); return false;\"><span style=\"vertical-align:middle;\">删除</span></a><a href=\"javascript:void(0);\" style=\"margin-left:5px\" onclick=\"ExportFlow('" + (object)workFlow2.ID + "'); return false;\"><span style=\"vertical-align:middle; background:url(../Images/ico/arrow_medium_right.png) no-repeat;padding-left:18px;\">导出</span></a>"); } jsonData1.Add((object)jsonData2); } return("{\"userdata\":{\"total\":" + (object)count + ",\"pagesize\":" + (object)pageSize + ",\"pagenumber\":" + (object)pageNumber + "},\"rows\":" + jsonData1.ToJson(true) + "}"); }
public string GetNames() { string obj = base.Request.QueryString["values"] ?? ""; RoadFlow.Platform.Dictionary dictionary = new RoadFlow.Platform.Dictionary(); StringBuilder stringBuilder = new StringBuilder(); string[] array = obj.Split(','); foreach (string text in array) { RoadFlow.Data.Model.Dictionary dictionary2 = dictionary.Get(MyExtensions.ToGuid(text), fromCache: true); if (dictionary2 != null) { stringBuilder.Append(dictionary2.Title); stringBuilder.Append(','); } } return(stringBuilder.ToString().TrimEnd(',')); }
public string TreeRefresh() { string msg; if (!Tools.CheckLogin(out msg) && !RoadFlow.Platform.WeiXin.Organize.CheckLogin()) { return(""); } Guid test; if (!this.Request.QueryString["refreshid"].IsGuid(out test)) { this.Response.Write("[]"); } StringBuilder stringBuilder = new StringBuilder("[", 1000); RoadFlow.Platform.Dictionary dictionary1 = new RoadFlow.Platform.Dictionary(); IOrderedEnumerable <RoadFlow.Data.Model.Dictionary> source = dictionary1.GetChilds(test, false).OrderBy <RoadFlow.Data.Model.Dictionary, int>((Func <RoadFlow.Data.Model.Dictionary, int>)(p => p.Sort)); int num1 = 0; int num2 = source.Count <RoadFlow.Data.Model.Dictionary>(); foreach (RoadFlow.Data.Model.Dictionary dictionary2 in (IEnumerable <RoadFlow.Data.Model.Dictionary>)source) { bool flag = dictionary1.HasChilds(dictionary2.ID); stringBuilder.Append("{"); stringBuilder.AppendFormat("\"id\":\"{0}\",", (object)dictionary2.ID); stringBuilder.AppendFormat("\"parentID\":\"{0}\",", (object)dictionary2.ParentID); stringBuilder.AppendFormat("\"title\":\"{0}\",", (object)dictionary2.Title); stringBuilder.AppendFormat("\"type\":\"{0}\",", flag ? (object)"1" : (object)"2"); stringBuilder.AppendFormat("\"ico\":\"{0}\",", (object)""); stringBuilder.AppendFormat("\"hasChilds\":\"{0}\",", flag ? (object)"1" : (object)"0"); stringBuilder.Append("\"childs\":["); stringBuilder.Append("]"); stringBuilder.Append("}"); if (num1++ < num2 - 1) { stringBuilder.Append(","); } } stringBuilder.Append("]"); return(stringBuilder.ToString()); }
public ActionResult add1(FormCollection collection) { RoadFlow.Data.Model.Dictionary dict = new RoadFlow.Data.Model.Dictionary(); RoadFlow.Platform.Dictionary bdict = new RoadFlow.Platform.Dictionary(); string id = Request.QueryString["id"]; if (!id.IsGuid()) { var dictRoot = bdict.GetRoot(); id = dictRoot != null?dictRoot.ID.ToString() : ""; } if (!id.IsGuid()) { throw new Exception("未找到父级"); } if (collection != null) { string title = Request.Form["Title"]; string code = Request.Form["Code"]; string values = Request.Form["Values"]; string note = Request.Form["Note"]; string other = Request.Form["Other"]; dict.ID = Guid.NewGuid(); dict.Code = code.IsNullOrEmpty() ? null : code.Trim(); dict.Note = note.IsNullOrEmpty() ? null : note.Trim(); dict.Other = other.IsNullOrEmpty() ? null : other.Trim(); dict.ParentID = id.ToGuid(); dict.Sort = bdict.GetMaxSort(id.ToGuid()); dict.Title = title.Trim(); dict.Value = values.IsNullOrEmpty() ? null : values.Trim(); bdict.Add(dict); bdict.RefreshCache(); RoadFlow.Platform.Log.Add("添加了数据字典项", dict.Serialize(), RoadFlow.Platform.Log.Types.数据字典); ViewBag.Script = "alert('添加成功!');parent.frames[0].reLoad('" + id + "');"; } return(View(dict)); }
public string Query() { string str1 = this.Request.Form["Title"]; string str2 = this.Request.Form["Address"]; string str3 = this.Request.Form["typeid"]; string str4 = this.Request.Form["sidx"]; string str5 = this.Request.Form["sord"]; RoadFlow.Platform.Dictionary dictionary = new RoadFlow.Platform.Dictionary(); RoadFlow.Platform.AppLibrary appLibrary1 = new RoadFlow.Platform.AppLibrary(); string type = str3.IsGuid() ? appLibrary1.GetAllChildsIDString(str3.ToGuid(), true) : ""; int pageSize = Tools.GetPageSize(); int pageNumber = Tools.GetPageNumber(); string order = (str4.IsNullOrEmpty() ? "Title" : str4) + " " + (str5.IsNullOrEmpty() ? "asc" : str5); long count; List <RoadFlow.Data.Model.AppLibrary> pagerData = appLibrary1.GetPagerData(out count, pageSize, pageNumber, str1.Trim1(), type, str2.Trim1(), order); JsonData jsonData = new JsonData(); foreach (RoadFlow.Data.Model.AppLibrary appLibrary2 in pagerData) { string empty = string.Empty; string str6; if (appLibrary2.Ico.IsFontIco()) { str6 = "<i class=\"fa " + appLibrary2.Ico.Trim1() + "\" style=\"font-size:14px;vertical-align:middle;" + (appLibrary2.Color.IsNullOrEmpty() ? "" : "color:" + appLibrary2.Color + ";") + "\"></i>"; } else { str6 = "<img src=\"" + appLibrary2.Ico.Trim1() + "\" style=\"vertical-align:middle;\" />"; } jsonData.Add((object)new JsonData() { ["id"] = (JsonData)appLibrary2.ID.ToString(), ["Title"] = (JsonData)(str6 + "<span style=\"vertical-align:middle;margin-left:4px;\">" + appLibrary2.Title + "</span>"), ["Address"] = (JsonData)appLibrary2.Address, ["TypeTitle"] = (JsonData)dictionary.GetTitle(appLibrary2.Type), ["Opation"] = (JsonData)("<a class=\"editlink\" href=\"javascript:void(0);\" onclick=\"edit('" + appLibrary2.ID.ToString() + "');return false;\" style=\"margin-right:6px;\">编辑</a><a class=\"editlink\" href=\"javascript:void(0);\" onclick=\"editsubpage('" + appLibrary2.ID.ToString() + "');return false;\">子页面</a>") }); } return("{\"userdata\":{\"total\":" + (object)count + ",\"pagesize\":" + (object)pageSize + ",\"pagenumber\":" + (object)pageNumber + "},\"rows\":" + jsonData.ToJson(true) + "}"); }
public string GetNames() { string str1 = this.Request.QueryString["values"] ?? ""; RoadFlow.Platform.Dictionary dictionary1 = new RoadFlow.Platform.Dictionary(); StringBuilder stringBuilder = new StringBuilder(); char[] chArray = new char[1] { ',' }; foreach (string str2 in str1.Split(chArray)) { RoadFlow.Data.Model.Dictionary dictionary2 = dictionary1.Get(str2.ToGuid(), true); if (dictionary2 != null) { stringBuilder.Append(dictionary2.Title); stringBuilder.Append(','); } } return(stringBuilder.ToString().TrimEnd(',')); }
protected void Page_Load(object sender, EventArgs e) { RoadFlow.Platform.Dictionary BDict = new RoadFlow.Platform.Dictionary(); string id = Request.QueryString["id"]; string refreshID = ""; Guid dictid; if (id.IsGuid(out dictid)) { var dict = BDict.Get(dictid); if (dict != null) { DictList = BDict.GetChilds(dict.ParentID); refreshID = dict.ParentID.ToString(); } } if (IsPostBack) { string sortdict = Request.Form["sort"]; if (sortdict.IsNullOrEmpty()) { return; } string[] sortArray = sortdict.Split(','); int i = 1; foreach (string id1 in sortArray) { Guid gid; if (id1.IsGuid(out gid)) { BDict.UpdateSort(gid, i++); } } BDict.RefreshCache(); RoadFlow.Platform.Log.Add("保存了数据字典排序", "保存了ID为:" + id + "的同级排序", RoadFlow.Platform.Log.Types.数据字典); Page.ClientScript.RegisterStartupScript(Page.GetType(), "ok", "parent.frames[0].reLoad('" + refreshID + "');", true); DictList = BDict.GetChilds(refreshID.ToGuid()); } }
protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) { RoadFlow.Data.Model.Dictionary dict = new RoadFlow.Data.Model.Dictionary(); RoadFlow.Platform.Dictionary bdict = new RoadFlow.Platform.Dictionary(); string id = Request.QueryString["id"]; if (!id.IsGuid()) { var dictRoot = bdict.GetRoot(); id = dictRoot != null?dictRoot.ID.ToString() : ""; } if (!id.IsGuid()) { throw new Exception("未找到父级"); } string title = Request.Form["Title1"]; string code = Request.Form["Code"]; string values = Request.Form["Values"]; string note = Request.Form["Note"]; string other = Request.Form["Other"]; dict.ID = Guid.NewGuid(); dict.Code = code.IsNullOrEmpty() ? null : code.Trim(); dict.Note = note.IsNullOrEmpty() ? null : note.Trim(); dict.Other = other.IsNullOrEmpty() ? null : other.Trim(); dict.ParentID = id.ToGuid(); dict.Sort = bdict.GetMaxSort(id.ToGuid()); dict.Title = title.Trim(); dict.Value = values.IsNullOrEmpty() ? null : values.Trim(); bdict.Add(dict); bdict.RefreshCache(); RoadFlow.Platform.Log.Add("添加了数据字典项", dict.Serialize(), RoadFlow.Platform.Log.Types.数据字典); Page.ClientScript.RegisterStartupScript(Page.GetType(), "ok", "alert('添加成功!');parent.frames[0].reLoad('" + id + "');", true); } }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; string id = context.Request.QueryString["refreshid"]; Guid gid; if (!id.IsGuid(out gid)) { context.Response.Write("[]"); return; } System.Text.StringBuilder json = new System.Text.StringBuilder("[", 1000); RoadFlow.Platform.Dictionary BDict = new RoadFlow.Platform.Dictionary(); var childs = BDict.GetChilds(gid).OrderBy(p => p.Sort); int i = 0; int count = childs.Count(); foreach (var child in childs) { var hasChilds = BDict.HasChilds(child.ID); json.Append("{"); json.AppendFormat("\"id\":\"{0}\",", child.ID); json.AppendFormat("\"parentID\":\"{0}\",", child.ParentID); json.AppendFormat("\"title\":\"{0}\",", child.Title); json.AppendFormat("\"type\":\"{0}\",", hasChilds ? "1" : "2"); json.AppendFormat("\"ico\":\"{0}\",", ""); json.AppendFormat("\"hasChilds\":\"{0}\",", hasChilds ? "1" : "0"); json.Append("\"childs\":["); json.Append("]"); json.Append("}"); if (i++ < count - 1) { json.Append(","); } } json.Append("]"); context.Response.Write(json.ToString()); }
public string GetUserAccountByCode(string code) { if (Config.OrganizeSecret.IsNullOrEmpty()) { List <RoadFlow.Data.Model.Dictionary> childs = new RoadFlow.Platform.Dictionary().GetChilds("weixinagents", false); if (childs.Count == 0) { return(""); } this.secret = childs.OrderBy <RoadFlow.Data.Model.Dictionary, int>((Func <RoadFlow.Data.Model.Dictionary, int>)(p => p.Sort)).First <RoadFlow.Data.Model.Dictionary>().Note.Trim1(); } else { this.secret = Config.OrganizeSecret; } string str1 = "https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo?access_token=" + this.GetAccessToken() + "&code=" + code; string str2 = HttpHelper.SendGet(str1); JsonData jsonData = JsonMapper.ToObject(str2); string str3 = jsonData.ContainsKey("UserId") ? jsonData["UserId"].ToString() : ""; RoadFlow.Platform.Log.Add("调用了微信获取人员帐号", str1, RoadFlow.Platform.Log.Types.微信企业号, str2, "", (RoadFlow.Data.Model.Users)null); return(str3); }
public ActionResult Edit(FormCollection collection) { string str1 = this.Request.QueryString["id"]; string str2 = this.Request.QueryString["typeid"]; RoadFlow.Platform.AppLibrary appLibrary = new RoadFlow.Platform.AppLibrary(); RoadFlow.Data.Model.AppLibrary model1 = (RoadFlow.Data.Model.AppLibrary)null; if (str1.IsGuid()) { model1 = appLibrary.Get(str1.ToGuid(), false); } bool flag1 = !str1.IsGuid(); string oldXML = string.Empty; int index1; if (model1 == null) { model1 = new RoadFlow.Data.Model.AppLibrary(); model1.ID = Guid.NewGuid(); // ISSUE: reference to a compiler-generated field if (AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__0 == null) { // ISSUE: reference to a compiler-generated field AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__0 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "TypeOptions", typeof(AppLibraryController), (IEnumerable <CSharpArgumentInfo>) new CSharpArgumentInfo[2] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, (string)null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, (string)null) })); } // ISSUE: reference to a compiler-generated field // ISSUE: reference to a compiler-generated field object obj1 = AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__0.Target((CallSite)AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__0, this.ViewBag, new RoadFlow.Platform.AppLibrary().GetTypeOptions(str2)); // ISSUE: reference to a compiler-generated field if (AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__1 == null) { // ISSUE: reference to a compiler-generated field AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__1 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "OpenOptions", typeof(AppLibraryController), (IEnumerable <CSharpArgumentInfo>) new CSharpArgumentInfo[2] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, (string)null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, (string)null) })); } // ISSUE: reference to a compiler-generated field // ISSUE: reference to a compiler-generated field object obj2 = AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__1.Target((CallSite)AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__1, this.ViewBag, new RoadFlow.Platform.Dictionary().GetOptionsByCode("appopenmodel", RoadFlow.Platform.Dictionary.OptionValueField.Value, "", "", true)); } else { oldXML = model1.Serialize(); // ISSUE: reference to a compiler-generated field if (AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__2 == null) { // ISSUE: reference to a compiler-generated field AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__2 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "TypeOptions", typeof(AppLibraryController), (IEnumerable <CSharpArgumentInfo>) new CSharpArgumentInfo[2] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, (string)null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, (string)null) })); } // ISSUE: reference to a compiler-generated field // ISSUE: reference to a compiler-generated field object obj1 = AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__2.Target((CallSite)AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__2, this.ViewBag, new RoadFlow.Platform.AppLibrary().GetTypeOptions(model1.Type.ToString())); // ISSUE: reference to a compiler-generated field if (AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__3 == null) { // ISSUE: reference to a compiler-generated field AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__3 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "OpenOptions", typeof(AppLibraryController), (IEnumerable <CSharpArgumentInfo>) new CSharpArgumentInfo[2] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, (string)null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, (string)null) })); } // ISSUE: reference to a compiler-generated field Func <CallSite, object, string, object> target = AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__3.Target; // ISSUE: reference to a compiler-generated field CallSite <Func <CallSite, object, string, object> > p3 = AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__3; object viewBag = this.ViewBag; RoadFlow.Platform.Dictionary dictionary = new RoadFlow.Platform.Dictionary(); string code = "appopenmodel"; int num1 = 3; index1 = model1.OpenMode; string str3 = index1.ToString(); string attr = ""; int num2 = 1; string optionsByCode = dictionary.GetOptionsByCode(code, (RoadFlow.Platform.Dictionary.OptionValueField)num1, str3, attr, num2 != 0); object obj2 = target((CallSite)p3, viewBag, optionsByCode); } if (collection != null) { string str3 = collection["title"]; string str4 = collection["address"]; string str5 = collection["openModel"]; string str6 = collection["width"]; string str7 = collection["height"]; string str8 = collection["Params"]; string str9 = collection["Note"]; string str10 = collection["Ico"]; string str11 = collection["IcoColor"]; string str12 = collection["type"]; model1.Address = str4.Trim(); model1.Height = str7.ToIntOrNull(); model1.Note = str9; model1.OpenMode = str5.ToInt(); model1.Params = str8; model1.Title = str3; model1.Type = str12.ToGuid(); model1.Width = str6.ToIntOrNull(); model1.Ico = str10.IsNullOrEmpty() ? (string)null : str10; model1.Color = str11.IsNullOrEmpty() ? (string)null : str11.Trim(); string str13 = this.Request.QueryString["pagesize"]; string str14 = this.Request.QueryString["pagenumber"]; using (TransactionScope transactionScope = new TransactionScope()) { if (flag1) { appLibrary.Add(model1); RoadFlow.Platform.Log.Add("添加了应用程序库", model1.Serialize(), RoadFlow.Platform.Log.Types.菜单权限, "", "", (RoadFlow.Data.Model.Users)null); // ISSUE: reference to a compiler-generated field if (AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__4 == null) { // ISSUE: reference to a compiler-generated field AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__4 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "Script", typeof(AppLibraryController), (IEnumerable <CSharpArgumentInfo>) new CSharpArgumentInfo[2] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, (string)null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, (string)null) })); } // ISSUE: reference to a compiler-generated field // ISSUE: reference to a compiler-generated field object obj = AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__4.Target((CallSite)AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__4, this.ViewBag, "alert('添加成功!');new RoadUI.Window().reloadOpener(undefined,undefined,\"query('" + str13 + "','" + str14 + "')\");new RoadUI.Window().close();"); } else { appLibrary.Update(model1); RoadFlow.Platform.Log.Add("修改了应用程序库", "", RoadFlow.Platform.Log.Types.菜单权限, oldXML, model1.Serialize(), (RoadFlow.Data.Model.Users)null); // ISSUE: reference to a compiler-generated field if (AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__5 == null) { // ISSUE: reference to a compiler-generated field AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__5 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "Script", typeof(AppLibraryController), (IEnumerable <CSharpArgumentInfo>) new CSharpArgumentInfo[2] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, (string)null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, (string)null) })); } // ISSUE: reference to a compiler-generated field // ISSUE: reference to a compiler-generated field object obj = AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__5.Target((CallSite)AppLibraryController.\u003C\u003Eo__5.\u003C\u003Ep__5, this.ViewBag, "alert('修改成功!');new RoadUI.Window().reloadOpener(undefined,undefined,\"query('" + str13 + "','" + str14 + "')\");new RoadUI.Window().close();"); } RoadFlow.Platform.AppLibraryButtons1 appLibraryButtons1_1 = new RoadFlow.Platform.AppLibraryButtons1(); string str15 = this.Request.Form["buttonindex"] ?? ""; List <RoadFlow.Data.Model.AppLibraryButtons1> allByAppId = appLibraryButtons1_1.GetAllByAppID(model1.ID); List <RoadFlow.Data.Model.AppLibraryButtons1> appLibraryButtons1List = new List <RoadFlow.Data.Model.AppLibraryButtons1>(); char[] chArray = new char[1] { ',' }; string[] strArray = str15.Split(chArray); for (index1 = 0; index1 < strArray.Length; ++index1) { string index = strArray[index1]; string str16 = this.Request.Form["button_" + index]; string str17 = this.Request.Form["buttonname_" + index]; string str18 = this.Request.Form["buttonevents_" + index]; string str19 = this.Request.Form["buttonico_" + index]; string str20 = this.Request.Form["showtype_" + index]; string str21 = this.Request.Form["buttonsort_" + index]; if (!str17.IsNullOrEmpty() && !str18.IsNullOrEmpty()) { RoadFlow.Data.Model.AppLibraryButtons1 model2 = allByAppId.Find((Predicate <RoadFlow.Data.Model.AppLibraryButtons1>)(p => p.ID == index.ToGuid())); bool flag2 = false; if (model2 == null) { flag2 = true; model2 = new RoadFlow.Data.Model.AppLibraryButtons1(); model2.ID = Guid.NewGuid(); } else { appLibraryButtons1List.Add(model2); } model2.AppLibraryID = model1.ID; if (str16.IsGuid()) { model2.ButtonID = new Guid?(str16.ToGuid()); } model2.Events = str18; model2.Ico = str19; model2.Name = str17.Trim1(); model2.Sort = str21.ToInt(0); model2.ShowType = str20.ToInt(0); model2.Type = 0; if (flag2) { appLibraryButtons1_1.Add(model2); } else { appLibraryButtons1_1.Update(model2); } } } foreach (RoadFlow.Data.Model.AppLibraryButtons1 appLibraryButtons1_2 in allByAppId) { RoadFlow.Data.Model.AppLibraryButtons1 sub = appLibraryButtons1_2; if (appLibraryButtons1List.Find((Predicate <RoadFlow.Data.Model.AppLibraryButtons1>)(p => p.ID == sub.ID)) == null) { appLibraryButtons1_1.Delete(sub.ID); } } transactionScope.Complete(); appLibraryButtons1_1.ClearCache(); } new RoadFlow.Platform.Menu().ClearAllDataTableCache(); new RoadFlow.Platform.WorkFlow().ClearStartFlowsCache(); appLibrary.ClearCache(); } return((ActionResult)this.View((object)model1)); }
protected void Page_Load(object sender, EventArgs e) { RoadFlow.Platform.Dictionary Dict = new RoadFlow.Platform.Dictionary(); string values = Request.QueryString["values"]; string rootid = Request.QueryString["rootid"]; string datasource = Request.QueryString["datasource"]; string sql = Request.QueryString["sql"]; DataTable SqlDataTable = new DataTable(); if ("1" == datasource) { string dbconn = Request.QueryString["dbconn"]; RoadFlow.Platform.DBConnection conn = new RoadFlow.Platform.DBConnection(); var conn1 = conn.Get(dbconn.ToGuid()); SqlDataTable = conn.GetDataTable(conn1, sql.UrlDecode().ReplaceSelectSql()); } System.Text.StringBuilder defautlSB = new System.Text.StringBuilder(); foreach (string value in values.Split(',')) { switch (datasource) { case "0": default: Guid id; if (!value.IsGuid(out id)) { continue; } defautlSB.AppendFormat("<div onclick=\"currentDel=this;showinfo('{0}');\" class=\"selectorDiv\" ondblclick=\"currentDel=this;del();\" value=\"{0}\">", value); defautlSB.Append(Dict.GetTitle(id)); defautlSB.Append("</div>"); break; case "1": //SQL string title1 = string.Empty; foreach (DataRow dr in SqlDataTable.Rows) { if (value == dr[0].ToString()) { title1 = SqlDataTable.Columns.Count > 1 ? dr[1].ToString() : value; break; } } defautlSB.AppendFormat("<div onclick=\"currentDel=this;showinfo('{0}');\" class=\"selectorDiv\" ondblclick=\"currentDel=this;del();\" value=\"{0}\">", value); defautlSB.Append(title1); defautlSB.Append("</div>"); break; case "2": //url string url2 = Request.QueryString["url2"]; if (!url2.IsNullOrEmpty()) { url2 = url2.IndexOf('?') >= 0 ? url2 + "&values=" + value : url2 + "?values=" + value; System.Text.StringBuilder sb = new System.Text.StringBuilder(); try { System.IO.TextWriter tw = new System.IO.StringWriter(sb); Server.Execute(url2, tw); } catch (Exception err) { } defautlSB.AppendFormat("<div onclick=\"currentDel=this;showinfo('{0}');\" class=\"selectorDiv\" ondblclick=\"currentDel=this;del();\" value=\"{0}\">", value); defautlSB.Append(sb.ToString()); defautlSB.Append("</div>"); } break; case "3": //table string dbconn = Request.QueryString["dbconn"]; string dbtable = Request.QueryString["dbtable"]; string valuefield = Request.QueryString["valuefield"]; string titlefield = Request.QueryString["titlefield"]; string parentfield = Request.QueryString["parentfield"]; string where = Request.QueryString["where"]; RoadFlow.Platform.DBConnection bdbconn = new RoadFlow.Platform.DBConnection(); var conn = bdbconn.Get(dbconn.ToGuid()); string sql2 = "select " + titlefield + " from " + dbtable + " where " + valuefield + "='" + value + "'"; DataTable dt = bdbconn.GetDataTable(conn, sql2.ReplaceSelectSql()); string title3 = string.Empty; if (dt.Rows.Count > 0) { title3 = dt.Rows[0][0].ToString(); } defautlSB.AppendFormat("<div onclick=\"currentDel=this;showinfo('{0}');\" class=\"selectorDiv\" ondblclick=\"currentDel=this;del();\" value=\"{0}\">", value); defautlSB.Append(title3); defautlSB.Append("</div>"); break; } } defaultValuesString = defautlSB.ToString(); }
public ActionResult Index() { RoadFlow.Platform.Dictionary dictionary = new RoadFlow.Platform.Dictionary(); string obj = base.Request.QueryString["values"] ?? ""; string text12 = base.Request.QueryString["rootid"]; string text = base.Request.QueryString["datasource"]; string text2 = base.Request.QueryString["sql"]; DataTable dataTable = new DataTable(); if ("1" == text) { string text3 = base.Request.QueryString["dbconn"]; RoadFlow.Platform.DBConnection dBConnection = new RoadFlow.Platform.DBConnection(); RoadFlow.Data.Model.DBConnection dbconn = dBConnection.Get(MyExtensions.ToGuid(text3)); dataTable = dBConnection.GetDataTable(dbconn, MyExtensions.ReplaceSelectSql(MyExtensions.UrlDecode(text2).FilterWildcard())); } StringBuilder stringBuilder = new StringBuilder(); string[] array = obj.Split(','); foreach (string text4 in array) { if (!MyExtensions.IsNullOrEmpty(text4)) { if (!(text == "0")) { if (text == "1") { string value = string.Empty; foreach (DataRow row in dataTable.Rows) { if (text4 == row[0].ToString()) { value = ((dataTable.Columns.Count > 1) ? row[1].ToString() : text4); break; } } stringBuilder.AppendFormat("<div onclick=\"currentDel=this;showinfo('{0}');\" class=\"selectorDiv\" ondblclick=\"currentDel=this;del();\" value=\"{0}\">", text4); stringBuilder.Append(value); stringBuilder.Append("</div>"); continue; } if (text == "2") { string text5 = base.Request.QueryString["url2"]; if (!MyExtensions.IsNullOrEmpty(text5)) { text5 = ((text5.IndexOf('?') >= 0) ? (text5 + "&values=" + text4) : (text5 + "?values=" + text4)); StringBuilder stringBuilder2 = new StringBuilder(); try { TextWriter writer = new StringWriter(stringBuilder2); base.Server.Execute(text5, writer); } catch { } stringBuilder.AppendFormat("<div onclick=\"currentDel=this;showinfo('{0}');\" class=\"selectorDiv\" ondblclick=\"currentDel=this;del();\" value=\"{0}\">", text4); stringBuilder.Append(stringBuilder2.ToString()); stringBuilder.Append("</div>"); } continue; } if (text == "3") { string text6 = base.Request.QueryString["dbconn"]; string text7 = base.Request.QueryString["dbtable"]; string text8 = base.Request.QueryString["valuefield"]; string text9 = base.Request.QueryString["titlefield"]; string text13 = base.Request.QueryString["parentfield"]; string text10 = base.Request.QueryString["where1"]; RoadFlow.Platform.DBConnection dBConnection2 = new RoadFlow.Platform.DBConnection(); RoadFlow.Data.Model.DBConnection dbconn2 = dBConnection2.Get(MyExtensions.ToGuid(text6)); string text11 = "select " + text9 + " from " + text7 + " where " + text8 + "='" + text4 + "'"; DataTable dataTable2 = dBConnection2.GetDataTable(dbconn2, MyExtensions.ReplaceSelectSql(text11)); string value2 = string.Empty; if (dataTable2.Rows.Count > 0) { value2 = dataTable2.Rows[0][0].ToString(); } stringBuilder.AppendFormat("<div onclick=\"currentDel=this;showinfo('{0}');\" class=\"selectorDiv\" ondblclick=\"currentDel=this;del();\" value=\"{0}\">", text4); stringBuilder.Append(value2); stringBuilder.Append("</div>"); base.ViewBag.where = MyExtensions.UrlEncode(text10); continue; } } Guid id = default(Guid); if (MyExtensions.IsGuid(text4, out id)) { stringBuilder.AppendFormat("<div onclick=\"currentDel=this;showinfo('{0}');\" class=\"selectorDiv\" ondblclick=\"currentDel=this;del();\" value=\"{0}\">", text4); stringBuilder.Append(dictionary.GetTitle(id)); stringBuilder.Append("</div>"); } } } base.ViewBag.defaultValuesString = MyExtensions.Trim1(stringBuilder.ToString()); return(View()); }