protected void Page_Load(object sender, EventArgs e) { string id = Request.QueryString["id"]; this.Code.Attributes.Add("validate_url", "CheckCode.ashx?id=" + id); if (id.IsGuid()) { dict = bdict.Get(id.ToGuid()); } if (dict == null) { dict = bdict.GetRoot(); } if (IsPostBack && dict != 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.数据字典); Page.ClientScript.RegisterStartupScript(Page.GetType(), "ok", "alert('删除成功!');parent.frames[0].reLoad('" + refreshID + "');window.location='Body.aspx?id=" + dict.ParentID.ToString() + "&appid=" + Request.QueryString["appid"] + "';", true); } //保存 if (!Request.Form["Save"].IsNullOrEmpty()) { 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"]; 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()); Page.ClientScript.RegisterStartupScript(Page.GetType(), "ok", "alert('保存成功!');parent.frames[0].reLoad('" + refreshID + "');", true); } } if (dict != null) { this.Title1.Value = dict.Title; this.Code.Value = dict.Code; this.Values.Value = dict.Value; this.Note.Value = dict.Note; this.Other.Value = dict.Other; } }
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 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 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)); }
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 string Tree1() { RoadFlow.Platform.Dictionary BDict = new RoadFlow.Platform.Dictionary(); string rootid = Request.QueryString["root"]; bool ischild = "1" == Request.QueryString["ischild"];//是否要加载下级节点 Guid rootID = Guid.Empty; if (!rootid.IsNullOrEmpty()) { if (!rootid.IsGuid(out rootID)) { var dict = BDict.GetByCode(rootid); if (dict != null) { rootID = dict.ID; } } } var root = rootID != Guid.Empty ? BDict.Get(rootID) : BDict.GetRoot(); var rootHasChild = BDict.HasChilds(root.ID); System.Text.StringBuilder json = new System.Text.StringBuilder("[", 1000); json.Append("{"); json.AppendFormat("\"id\":\"{0}\",", root.ID); json.AppendFormat("\"parentID\":\"{0}\",", root.ParentID); json.AppendFormat("\"title\":\"{0}\",", root.Title); json.AppendFormat("\"type\":\"{0}\",", rootHasChild ? "0" : "2"); //类型:0根 1父 2子 json.AppendFormat("\"ico\":\"{0}\",", Url.Content("~/images/ico/role.gif")); json.AppendFormat("\"hasChilds\":\"{0}\",", rootHasChild ? "1" : "0"); json.Append("\"childs\":["); var childs = BDict.GetChilds(root.ID); int i = 0; int count = childs.Count; foreach (var child in childs) { var hasChild = ischild && 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}\",", hasChild ? "1" : "2"); json.AppendFormat("\"ico\":\"{0}\",", ""); json.AppendFormat("\"hasChilds\":\"{0}\",", hasChild ? "1" : "0"); json.Append("\"childs\":["); json.Append("]"); json.Append("}"); if (i++ < count - 1) { json.Append(","); } } json.Append("]"); json.Append("}"); json.Append("]"); return(json.ToString()); }
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 ActionResult Body(FormCollection collection) { RoadFlow.Platform.Dictionary dictionary = new RoadFlow.Platform.Dictionary(); RoadFlow.Data.Model.Dictionary model = (RoadFlow.Data.Model.Dictionary)null; string str1 = this.Request.QueryString["id"]; if (str1.IsGuid()) { model = dictionary.Get(str1.ToGuid(), false); } if (model == null) { model = dictionary.GetRoot(); } if (collection != null) { Guid guid; string str2; if (!(model.ParentID == Guid.Empty)) { guid = model.ParentID; str2 = guid.ToString(); } else { guid = model.ID; str2 = guid.ToString(); } string str3 = str2; if (!this.Request.Form["Delete"].IsNullOrEmpty()) { int num = dictionary.DeleteAndAllChilds(model.ID); dictionary.RefreshCache(); RoadFlow.Platform.Log.Add("删除了数据字典及其下级共" + num.ToString() + "项", model.Serialize(), RoadFlow.Platform.Log.Types.数据字典, "", "", (RoadFlow.Data.Model.Users)null); // ISSUE: reference to a compiler-generated field if (DictController.\u003C\u003Eo__5.\u003C\u003Ep__0 == null) { // ISSUE: reference to a compiler-generated field DictController.\u003C\u003Eo__5.\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 Func <CallSite, object, string, object> target = DictController.\u003C\u003Eo__5.\u003C\u003Ep__0.Target; // ISSUE: reference to a compiler-generated field CallSite <Func <CallSite, object, string, object> > p0 = DictController.\u003C\u003Eo__5.\u003C\u003Ep__0; object viewBag = this.ViewBag; string[] strArray = new string[7] { "alert('删除成功!');parent.frames[0].reLoad('", str3, "');window.location='Body?id=", null, null, null, null }; int index = 3; guid = model.ParentID; string str4 = guid.ToString(); strArray[index] = str4; strArray[4] = "&appid="; strArray[5] = this.Request.QueryString["appid"]; strArray[6] = "';"; string str5 = string.Concat(strArray); object obj = target((CallSite)p0, viewBag, str5); return((ActionResult)this.View((object)model)); } string str6 = this.Request.Form["Title"]; string str7 = this.Request.Form["Code"]; string str8 = this.Request.Form["Values"]; string str9 = this.Request.Form["Note"]; string str10 = this.Request.Form["Other"]; string oldXML = model.Serialize(); model.Code = str7.IsNullOrEmpty() ? (string)null : str7.Trim(); model.Note = str9.IsNullOrEmpty() ? (string)null : str9.Trim(); model.Other = str10.IsNullOrEmpty() ? (string)null : str10.Trim(); model.Title = str6.Trim(); model.Value = str8.IsNullOrEmpty() ? (string)null : str8.Trim(); dictionary.Update(model); dictionary.RefreshCache(); RoadFlow.Platform.Log.Add("修改了数据字典项", "", RoadFlow.Platform.Log.Types.数据字典, oldXML, model.Serialize(), (RoadFlow.Data.Model.Users)null); // ISSUE: reference to a compiler-generated field if (DictController.\u003C\u003Eo__5.\u003C\u003Ep__1 == null) { // ISSUE: reference to a compiler-generated field DictController.\u003C\u003Eo__5.\u003C\u003Ep__1 = 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 obj1 = DictController.\u003C\u003Eo__5.\u003C\u003Ep__1.Target((CallSite)DictController.\u003C\u003Eo__5.\u003C\u003Ep__1, this.ViewBag, "alert('保存成功!');parent.frames[0].reLoad('" + str3 + "');"); } return((ActionResult)this.View((object)model)); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; RoadFlow.Platform.Dictionary BDict = new RoadFlow.Platform.Dictionary(); string rootid = context.Request.QueryString["root"]; bool ischild = "1" == context.Request.QueryString["ischild"];//是否要加载下级节点 Guid rootID = Guid.Empty; if (!rootid.IsGuid(out rootID)) { if (!rootid.IsGuid(out rootID)) { var dict = BDict.GetByCode(rootid); if (dict != null) { rootID = dict.ID; } } } var root = rootID != Guid.Empty ? BDict.Get(rootID) : BDict.GetRoot(); var rootHasChild = BDict.HasChilds(root.ID); System.Text.StringBuilder json = new System.Text.StringBuilder("[", 1000); json.Append("{"); json.AppendFormat("\"id\":\"{0}\",", root.ID); json.AppendFormat("\"parentID\":\"{0}\",", root.ParentID); json.AppendFormat("\"title\":\"{0}\",", root.Title); json.AppendFormat("\"type\":\"{0}\",", rootHasChild ? "0" : "2"); //类型:0根 1父 2子 json.AppendFormat("\"ico\":\"{0}\",", Common.Tools.BaseUrl + "/images/ico/role.gif"); json.AppendFormat("\"hasChilds\":\"{0}\",", rootHasChild ? "1" : "0"); json.Append("\"childs\":["); var childs = BDict.GetChilds(root.ID); int i = 0; int count = childs.Count; foreach (var child in childs) { var hasChild = ischild && 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}\",", hasChild ? "1" : "2"); json.AppendFormat("\"ico\":\"{0}\",", ""); json.AppendFormat("\"hasChilds\":\"{0}\",", hasChild ? "1" : "0"); json.Append("\"childs\":["); json.Append("]"); json.Append("}"); if (i++ < count - 1) { json.Append(","); } } json.Append("]"); json.Append("}"); json.Append("]"); context.Response.Write(json.ToString()); }