Example #1
0
        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;
            }
        }
Example #2
0
        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));
        }
Example #3
0
        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));
        }