Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string editID = Request.QueryString["id"];
            string type   = Request.QueryString["typeid"];

            if (editID.IsGuid())
            {
                appLibrary = bappLibrary.Get(editID.ToGuid());
            }
            if (!IsPostBack)
            {
                if (appLibrary != null)
                {
                    this.Title1.Value          = appLibrary.Title;
                    this.Address.Value         = appLibrary.Address;
                    this.TypeOptions.Text      = new RoadFlow.Platform.AppLibrary().GetTypeOptions(appLibrary.Type.ToString());
                    this.OpenModelOptions.Text = new RoadFlow.Platform.Dictionary().GetOptionsByCode("appopenmodel", value: appLibrary.OpenMode.ToString());
                    this.Params.Value          = appLibrary.Params;
                    this.Width.Value           = appLibrary.Width.ToString();
                    this.Height.Value          = appLibrary.Height.ToString();
                    this.UseMember.Value       = appLibrary.UseMember;
                    this.Note.Value            = appLibrary.Note;
                }
                else
                {
                    this.TypeOptions.Text      = new RoadFlow.Platform.AppLibrary().GetTypeOptions("");
                    this.OpenModelOptions.Text = new RoadFlow.Platform.Dictionary().GetOptionsByCode("appopenmodel");
                }
            }
        }
Example #2
0
        public string Delete()
        {
            RoadFlow.Platform.AppLibrary appLibrary1 = new RoadFlow.Platform.AppLibrary();
            string        str1          = this.Request.Form["ids"];
            StringBuilder stringBuilder = new StringBuilder();

            using (TransactionScope transactionScope = new TransactionScope())
            {
                string str2    = str1;
                char[] chArray = new char[1] {
                    ','
                };
                foreach (string str3 in str2.Split(chArray))
                {
                    Guid test;
                    if (str3.IsGuid(out test))
                    {
                        RoadFlow.Data.Model.AppLibrary appLibrary2 = appLibrary1.Get(test, false);
                        if (appLibrary2 != null)
                        {
                            stringBuilder.Append(appLibrary2.Serialize());
                            appLibrary1.Delete(test);
                            new RoadFlow.Platform.AppLibraryButtons1().DeleteByAppID(test);
                            new RoadFlow.Platform.AppLibrarySubPages().DeleteByAppID(test);
                        }
                    }
                }
                new RoadFlow.Platform.Menu().ClearAllDataTableCache();
                new RoadFlow.Platform.AppLibraryButtons1().ClearCache();
                new RoadFlow.Platform.AppLibrarySubPages().ClearCache();
                RoadFlow.Platform.Log.Add("删除了一批应用程序库", stringBuilder.ToString(), RoadFlow.Platform.Log.Types.菜单权限, "", "", (RoadFlow.Data.Model.Users)null);
                transactionScope.Complete();
            }
            return("删除成功!");
        }
        public string Delete()
        {
            RoadFlow.Platform.AppLibrary appLibrary = new RoadFlow.Platform.AppLibrary();
            string        text          = base.Request.Form["ids"];
            StringBuilder stringBuilder = new StringBuilder();

            using (TransactionScope transactionScope = new TransactionScope())
            {
                string[] array = text.Split(',');
                for (int i = 0; i < array.Length; i++)
                {
                    Guid id = default(Guid);
                    if (MyExtensions.IsGuid(array[i], out id))
                    {
                        RoadFlow.Data.Model.AppLibrary appLibrary2 = appLibrary.Get(id);
                        if (appLibrary2 != null)
                        {
                            stringBuilder.Append(MyExtensions.Serialize(appLibrary2));
                            appLibrary.Delete(id);
                            new RoadFlow.Platform.AppLibraryButtons1().DeleteByAppID(id);
                            new RoadFlow.Platform.AppLibrarySubPages().DeleteByAppID(id);
                        }
                    }
                }
                new RoadFlow.Platform.Menu().ClearAllDataTableCache();
                new RoadFlow.Platform.AppLibraryButtons1().ClearCache();
                new RoadFlow.Platform.AppLibrarySubPages().ClearCache();
                RoadFlow.Platform.Log.Add("删除了一批应用程序库", stringBuilder.ToString(), RoadFlow.Platform.Log.Types.菜单权限);
                transactionScope.Complete();
            }
            return("删除成功!");
        }
Example #4
0
        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;
        }
Example #5
0
        public RedirectToRouteResult Delete()
        {
            RoadFlow.Platform.AppLibrary bappLibrary = new RoadFlow.Platform.AppLibrary();
            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 = bappLibrary.Get(gid);
                    if (app != null)
                    {
                        delxml.Append(app.Serialize());
                        bappLibrary.Delete(gid);
                    }
                }
            }
            RoadFlow.Platform.Log.Add("删除了一批应用程序库", delxml.ToString(), RoadFlow.Platform.Log.Types.角色应用);
            return(RedirectToAction("List", Common.Tools.GetRouteValueDictionary()));
        }
Example #6
0
        public ActionResult Edit(FormCollection collection)
        {
            string editID = Request.QueryString["id"];
            string type   = Request.QueryString["typeid"];

            RoadFlow.Platform.AppLibrary   bappLibrary = new RoadFlow.Platform.AppLibrary();
            RoadFlow.Data.Model.AppLibrary appLibrary  = null;
            if (editID.IsGuid())
            {
                appLibrary = bappLibrary.Get(editID.ToGuid());
            }
            bool   isAdd  = !editID.IsGuid();
            string oldXML = string.Empty;

            if (appLibrary == null)
            {
                appLibrary          = new RoadFlow.Data.Model.AppLibrary();
                appLibrary.ID       = Guid.NewGuid();
                ViewBag.TypeOptions = new RoadFlow.Platform.AppLibrary().GetTypeOptions(type);
                ViewBag.OpenOptions = new RoadFlow.Platform.Dictionary().GetOptionsByCode("appopenmodel", value: "");
            }
            else
            {
                oldXML = appLibrary.Serialize();
                ViewBag.TypeOptions = new RoadFlow.Platform.AppLibrary().GetTypeOptions(appLibrary.Type.ToString());
                ViewBag.OpenOptions = new RoadFlow.Platform.Dictionary().GetOptionsByCode("appopenmodel", value: appLibrary.OpenMode.ToString());
            }

            if (collection != null)
            {
                string title     = collection["title"];
                string address   = collection["address"];
                string openModel = collection["openModel"];
                string width     = collection["width"];
                string height    = collection["height"];
                string params1   = collection["Params"];
                string note      = collection["note"];
                string useMember = collection["UseMember"];
                type = collection["type"];

                appLibrary.Address  = address.Trim();
                appLibrary.Height   = height.ToIntOrNull();
                appLibrary.Note     = note;
                appLibrary.OpenMode = openModel.ToInt();
                appLibrary.Params   = params1;
                appLibrary.Title    = title;
                appLibrary.Type     = type.ToGuid();
                appLibrary.Width    = width.ToIntOrNull();

                if (!useMember.IsNullOrEmpty())
                {
                    appLibrary.UseMember = useMember;
                }
                else
                {
                    appLibrary.UseMember = null;
                }

                if (isAdd)
                {
                    bappLibrary.Add(appLibrary);
                    RoadFlow.Platform.Log.Add("添加了应用程序库", appLibrary.Serialize(), RoadFlow.Platform.Log.Types.角色应用);
                    ViewBag.Script = "alert('添加成功!');new RoadUI.Window().reloadOpener();new RoadUI.Window().close();";
                }
                else
                {
                    bappLibrary.Update(appLibrary);
                    RoadFlow.Platform.Log.Add("修改了应用程序库", "", RoadFlow.Platform.Log.Types.角色应用, oldXML, appLibrary.Serialize());
                    ViewBag.Script = "alert('修改成功!');new RoadUI.Window().reloadOpener();new RoadUI.Window().close();";
                }
                bappLibrary.UpdateUseMemberCache(appLibrary.ID);
                bappLibrary.ClearCache();
                new RoadFlow.Platform.RoleApp().ClearAllDataTableCache();
            }
            return(View(appLibrary));
        }
Example #7
0
        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));
        }
        public ActionResult Edit(FormCollection collection)
        {
            string text  = base.Request.QueryString["id"];
            string value = base.Request.QueryString["typeid"];

            RoadFlow.Platform.AppLibrary   appLibrary  = new RoadFlow.Platform.AppLibrary();
            RoadFlow.Data.Model.AppLibrary appLibrary2 = null;
            if (MyExtensions.IsGuid(text))
            {
                appLibrary2 = appLibrary.Get(MyExtensions.ToGuid(text));
            }
            bool   flag   = !MyExtensions.IsGuid(text);
            string oldXML = string.Empty;

            if (appLibrary2 == null)
            {
                appLibrary2              = new RoadFlow.Data.Model.AppLibrary();
                appLibrary2.ID           = Guid.NewGuid();
                base.ViewBag.TypeOptions = new RoadFlow.Platform.AppLibrary().GetTypeOptions(value);
                base.ViewBag.OpenOptions = new RoadFlow.Platform.Dictionary().GetOptionsByCode("appopenmodel");
            }
            else
            {
                oldXML = MyExtensions.Serialize((object)appLibrary2);
                base.ViewBag.TypeOptions = new RoadFlow.Platform.AppLibrary().GetTypeOptions(appLibrary2.Type.ToString());
                base.ViewBag.OpenOptions = new RoadFlow.Platform.Dictionary().GetOptionsByCode("appopenmodel", RoadFlow.Platform.Dictionary.OptionValueField.Value, appLibrary2.OpenMode.ToString());
            }
            if (collection != null)
            {
                string title   = collection["title"];
                string text2   = collection["address"];
                string text3   = collection["openModel"];
                string text4   = collection["width"];
                string text5   = collection["height"];
                string @params = collection["Params"];
                string note    = collection["Note"];
                string text6   = collection["Ico"];
                string text7   = collection["IcoColor"];
                value = collection["type"];
                appLibrary2.Address  = text2.Trim();
                appLibrary2.Height   = MyExtensions.ToIntOrNull(text5);
                appLibrary2.Note     = note;
                appLibrary2.OpenMode = MyExtensions.ToInt(text3);
                appLibrary2.Params   = @params;
                appLibrary2.Title    = title;
                appLibrary2.Type     = MyExtensions.ToGuid(value);
                appLibrary2.Width    = MyExtensions.ToIntOrNull(text4);
                if (!MyExtensions.IsNullOrEmpty(text6))
                {
                    appLibrary2.Ico = text6;
                }
                else
                {
                    appLibrary2.Ico = null;
                }
                if (!MyExtensions.IsNullOrEmpty(text7))
                {
                    appLibrary2.Color = text7.Trim();
                }
                else
                {
                    appLibrary2.Color = null;
                }
                string text8 = base.Request.QueryString["pagesize"];
                string text9 = base.Request.QueryString["pagenumber"];
                using (TransactionScope transactionScope = new TransactionScope())
                {
                    if (flag)
                    {
                        appLibrary.Add(appLibrary2);
                        RoadFlow.Platform.Log.Add("添加了应用程序库", MyExtensions.Serialize((object)appLibrary2), RoadFlow.Platform.Log.Types.菜单权限);
                        base.ViewBag.Script = "alert('添加成功!');new RoadUI.Window().reloadOpener(undefined,undefined,\"query('" + text8 + "','" + text9 + "')\");new RoadUI.Window().close();";
                    }
                    else
                    {
                        appLibrary.Update(appLibrary2);
                        RoadFlow.Platform.Log.Add("修改了应用程序库", "", RoadFlow.Platform.Log.Types.菜单权限, oldXML, MyExtensions.Serialize((object)appLibrary2));
                        base.ViewBag.Script = "alert('修改成功!');new RoadUI.Window().reloadOpener(undefined,undefined,\"query('" + text8 + "','" + text9 + "')\");new RoadUI.Window().close();";
                    }
                    RoadFlow.Platform.AppLibraryButtons1 appLibraryButtons = new RoadFlow.Platform.AppLibraryButtons1();
                    string obj = base.Request.Form["buttonindex"] ?? "";
                    List <RoadFlow.Data.Model.AppLibraryButtons1> allByAppID = appLibraryButtons.GetAllByAppID(appLibrary2.ID);
                    List <RoadFlow.Data.Model.AppLibraryButtons1> list       = new List <RoadFlow.Data.Model.AppLibraryButtons1>();
                    string[] array = obj.Split(',');
                    foreach (string index in array)
                    {
                        string text10 = base.Request.Form["button_" + index];
                        string text11 = base.Request.Form["buttonname_" + index];
                        string text12 = base.Request.Form["buttonevents_" + index];
                        string ico    = base.Request.Form["buttonico_" + index];
                        string text13 = base.Request.Form["showtype_" + index];
                        string text14 = base.Request.Form["buttonsort_" + index];
                        if (!MyExtensions.IsNullOrEmpty(text11) && !MyExtensions.IsNullOrEmpty(text12))
                        {
                            RoadFlow.Data.Model.AppLibraryButtons1 appLibraryButtons2 = allByAppID.Find((RoadFlow.Data.Model.AppLibraryButtons1 p) => p.ID == MyExtensions.ToGuid(index));
                            bool flag2 = false;
                            if (appLibraryButtons2 == null)
                            {
                                flag2 = true;
                                appLibraryButtons2    = new RoadFlow.Data.Model.AppLibraryButtons1();
                                appLibraryButtons2.ID = Guid.NewGuid();
                            }
                            else
                            {
                                list.Add(appLibraryButtons2);
                            }
                            appLibraryButtons2.AppLibraryID = appLibrary2.ID;
                            if (MyExtensions.IsGuid(text10))
                            {
                                appLibraryButtons2.ButtonID = MyExtensions.ToGuid(text10);
                            }
                            appLibraryButtons2.Events   = text12;
                            appLibraryButtons2.Ico      = ico;
                            appLibraryButtons2.Name     = MyExtensions.Trim1(text11);
                            appLibraryButtons2.Sort     = MyExtensions.ToInt(text14, 0);
                            appLibraryButtons2.ShowType = MyExtensions.ToInt(text13, 0);
                            appLibraryButtons2.Type     = 0;
                            if (flag2)
                            {
                                appLibraryButtons.Add(appLibraryButtons2);
                            }
                            else
                            {
                                appLibraryButtons.Update(appLibraryButtons2);
                            }
                        }
                    }
                    foreach (RoadFlow.Data.Model.AppLibraryButtons1 item in allByAppID)
                    {
                        if (list.Find((RoadFlow.Data.Model.AppLibraryButtons1 p) => p.ID == item.ID) == null)
                        {
                            appLibraryButtons.Delete(item.ID);
                        }
                    }
                    transactionScope.Complete();
                    appLibraryButtons.ClearCache();
                }
                new RoadFlow.Platform.Menu().ClearAllDataTableCache();
                new RoadFlow.Platform.WorkFlow().ClearStartFlowsCache();
                appLibrary.ClearCache();
            }
            return(View(appLibrary2));
        }