Exemplo n.º 1
0
        public RedirectResult SubPageDelete()
        {
            string contents = this.Request.Form["subpagesbox"] ?? "";

            RoadFlow.Platform.AppLibrarySubPages appLibrarySubPages = new RoadFlow.Platform.AppLibrarySubPages();
            RoadFlow.Platform.AppLibraryButtons1 appLibraryButtons1 = new RoadFlow.Platform.AppLibraryButtons1();
            using (TransactionScope transactionScope = new TransactionScope())
            {
                string str1    = contents;
                char[] chArray = new char[1] {
                    ','
                };
                foreach (string str2 in str1.Split(chArray))
                {
                    if (str2.IsGuid())
                    {
                        appLibrarySubPages.Delete(str2.ToGuid());
                        appLibraryButtons1.DeleteByAppID(str2.ToGuid());
                    }
                }
                RoadFlow.Platform.Log.Add("删除了子页面", contents, RoadFlow.Platform.Log.Types.菜单权限, "", "", (RoadFlow.Data.Model.Users)null);
                transactionScope.Complete();
            }
            appLibrarySubPages.ClearCache();
            appLibraryButtons1.ClearCache();
            return(this.Redirect("SubPages" + this.Request.Url.Query));
        }
Exemplo n.º 2
0
        public RedirectResult SubPageDelete()
        {
            string text = base.Request.Form["subpagesbox"] ?? "";

            RoadFlow.Platform.AppLibrarySubPages appLibrarySubPages = new RoadFlow.Platform.AppLibrarySubPages();
            RoadFlow.Platform.AppLibraryButtons1 appLibraryButtons  = new RoadFlow.Platform.AppLibraryButtons1();
            using (TransactionScope transactionScope = new TransactionScope())
            {
                string[] array = text.Split(',');
                foreach (string text2 in array)
                {
                    if (MyExtensions.IsGuid(text2))
                    {
                        appLibrarySubPages.Delete(MyExtensions.ToGuid(text2));
                        appLibraryButtons.DeleteByAppID(MyExtensions.ToGuid(text2));
                    }
                }
                RoadFlow.Platform.Log.Add("删除了子页面", text, RoadFlow.Platform.Log.Types.菜单权限);
                transactionScope.Complete();
            }
            appLibrarySubPages.ClearCache();
            appLibraryButtons.ClearCache();
            return(Redirect("SubPages" + base.Request.Url.Query));
        }
Exemplo n.º 3
0
        public ActionResult SubPageEdit(FormCollection collection)
        {
            RoadFlow.Platform.AppLibrarySubPages   appLibrarySubPages = new RoadFlow.Platform.AppLibrarySubPages();
            RoadFlow.Data.Model.AppLibrarySubPages model1             = (RoadFlow.Data.Model.AppLibrarySubPages)null;
            string str1 = this.Request.QueryString["subid"];

            if (str1.IsGuid())
            {
                model1 = appLibrarySubPages.Get(str1.ToGuid());
            }
            if (collection != null)
            {
                string str2  = this.Request.Form["Title"];
                string str3  = this.Request.Form["Address"];
                bool   flag1 = false;
                if (model1 == null)
                {
                    model1              = new RoadFlow.Data.Model.AppLibrarySubPages();
                    flag1               = true;
                    model1.ID           = Guid.NewGuid();
                    model1.AppLibraryID = this.Request.QueryString["id"].ToGuid();
                }
                model1.Name    = str2.Trim1();
                model1.Address = str3.Trim1();
                using (TransactionScope transactionScope = new TransactionScope())
                {
                    if (flag1)
                    {
                        appLibrarySubPages.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__8.\u003C\u003Ep__0 == null)
                        {
                            // ISSUE: reference to a compiler-generated field
                            AppLibraryController.\u003C\u003Eo__8.\u003C\u003Ep__0 = 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__8.\u003C\u003Ep__0.Target((CallSite)AppLibraryController.\u003C\u003Eo__8.\u003C\u003Ep__0, this.ViewBag, "alert('添加成功!');window.location='SubPages" + this.Request.Url.Query + "';");
                    }
                    else
                    {
                        appLibrarySubPages.Update(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__8.\u003C\u003Ep__1 == null)
                        {
                            // ISSUE: reference to a compiler-generated field
                            AppLibraryController.\u003C\u003Eo__8.\u003C\u003Ep__1 = 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__8.\u003C\u003Ep__1.Target((CallSite)AppLibraryController.\u003C\u003Eo__8.\u003C\u003Ep__1, this.ViewBag, "alert('保存成功!');window.location='SubPages" + this.Request.Url.Query + "';");
                    }
                    RoadFlow.Platform.AppLibraryButtons1 appLibraryButtons1_1 = new RoadFlow.Platform.AppLibraryButtons1();
                    string str4 = 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] {
                        ','
                    };
                    foreach (string str5 in str4.Split(chArray))
                    {
                        string index = str5;
                        string str6  = this.Request.Form["button_" + index];
                        string str7  = this.Request.Form["buttonname_" + index];
                        string str8  = this.Request.Form["buttonevents_" + index];
                        string str9  = this.Request.Form["buttonico_" + index];
                        string str10 = this.Request.Form["showtype_" + index];
                        string str11 = this.Request.Form["buttonsort_" + index];
                        if (!str7.IsNullOrEmpty() && !str8.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 (str6.IsGuid())
                            {
                                model2.ButtonID = new Guid?(str6.ToGuid());
                            }
                            model2.Events   = str8;
                            model2.Ico      = str9;
                            model2.Name     = str7.Trim1();
                            model2.Sort     = str11.ToInt(0);
                            model2.ShowType = str10.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 sub1 = appLibraryButtons1_2;
                        if (appLibraryButtons1List.Find((Predicate <RoadFlow.Data.Model.AppLibraryButtons1>)(p => p.ID == sub1.ID)) == null)
                        {
                            appLibraryButtons1_1.Delete(sub1.ID);
                        }
                    }
                    transactionScope.Complete();
                    appLibraryButtons1_1.ClearCache();
                    appLibrarySubPages.ClearCache();
                }
            }
            if (model1 == null)
            {
                model1              = new RoadFlow.Data.Model.AppLibrarySubPages();
                model1.ID           = Guid.Empty;
                model1.AppLibraryID = this.Request.QueryString["id"].ToGuid();
            }
            return((ActionResult)this.View((object)model1));
        }
Exemplo n.º 4
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));
        }
Exemplo n.º 5
0
        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));
        }
Exemplo n.º 6
0
        public ActionResult SubPageEdit(FormCollection collection)
        {
            RoadFlow.Platform.AppLibrarySubPages   appLibrarySubPages  = new RoadFlow.Platform.AppLibrarySubPages();
            RoadFlow.Data.Model.AppLibrarySubPages appLibrarySubPages2 = null;
            string text = base.Request.QueryString["subid"];

            if (MyExtensions.IsGuid(text))
            {
                appLibrarySubPages2 = appLibrarySubPages.Get(MyExtensions.ToGuid(text));
            }
            if (collection != null)
            {
                string text2 = base.Request.Form["Title"];
                string text3 = base.Request.Form["Address"];
                bool   flag  = false;
                if (appLibrarySubPages2 == null)
                {
                    appLibrarySubPages2 = new RoadFlow.Data.Model.AppLibrarySubPages();
                    flag = true;
                    appLibrarySubPages2.ID           = Guid.NewGuid();
                    appLibrarySubPages2.AppLibraryID = MyExtensions.ToGuid(base.Request.QueryString["id"]);
                }
                appLibrarySubPages2.Name    = MyExtensions.Trim1(text2);
                appLibrarySubPages2.Address = MyExtensions.Trim1(text3);
                using (TransactionScope transactionScope = new TransactionScope())
                {
                    if (flag)
                    {
                        appLibrarySubPages.Add(appLibrarySubPages2);
                        RoadFlow.Platform.Log.Add("添加了子页面", MyExtensions.Serialize((object)appLibrarySubPages2), RoadFlow.Platform.Log.Types.菜单权限);
                        base.ViewBag.Script = "alert('添加成功!');window.location='SubPages" + base.Request.Url.Query + "';";
                    }
                    else
                    {
                        appLibrarySubPages.Update(appLibrarySubPages2);
                        RoadFlow.Platform.Log.Add("修改了子页面", MyExtensions.Serialize((object)appLibrarySubPages2), RoadFlow.Platform.Log.Types.菜单权限);
                        base.ViewBag.Script = "alert('保存成功!');window.location='SubPages" + base.Request.Url.Query + "';";
                    }
                    RoadFlow.Platform.AppLibraryButtons1 appLibraryButtons = new RoadFlow.Platform.AppLibraryButtons1();
                    string obj = base.Request.Form["buttonindex"] ?? "";
                    List <RoadFlow.Data.Model.AppLibraryButtons1> allByAppID = appLibraryButtons.GetAllByAppID(appLibrarySubPages2.ID);
                    List <RoadFlow.Data.Model.AppLibraryButtons1> list       = new List <RoadFlow.Data.Model.AppLibraryButtons1>();
                    string[] array = obj.Split(',');
                    foreach (string index in array)
                    {
                        string text4 = base.Request.Form["button_" + index];
                        string text5 = base.Request.Form["buttonname_" + index];
                        string text6 = base.Request.Form["buttonevents_" + index];
                        string ico   = base.Request.Form["buttonico_" + index];
                        string text7 = base.Request.Form["showtype_" + index];
                        string text8 = base.Request.Form["buttonsort_" + index];
                        if (!MyExtensions.IsNullOrEmpty(text5) && !MyExtensions.IsNullOrEmpty(text6))
                        {
                            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 = appLibrarySubPages2.ID;
                            if (MyExtensions.IsGuid(text4))
                            {
                                appLibraryButtons2.ButtonID = MyExtensions.ToGuid(text4);
                            }
                            appLibraryButtons2.Events   = text6;
                            appLibraryButtons2.Ico      = ico;
                            appLibraryButtons2.Name     = MyExtensions.Trim1(text5);
                            appLibraryButtons2.Sort     = MyExtensions.ToInt(text8, 0);
                            appLibraryButtons2.ShowType = MyExtensions.ToInt(text7, 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();
                    appLibrarySubPages.ClearCache();
                }
            }
            if (appLibrarySubPages2 == null)
            {
                appLibrarySubPages2              = new RoadFlow.Data.Model.AppLibrarySubPages();
                appLibrarySubPages2.ID           = Guid.Empty;
                appLibrarySubPages2.AppLibraryID = MyExtensions.ToGuid(base.Request.QueryString["id"]);
            }
            return(View(appLibrarySubPages2));
        }