Esempio n. 1
0
        private List <RoadFlow.Data.Model.AppLibraryButtons1> DataReaderToList(OracleDataReader dataReader)
        {
            List <RoadFlow.Data.Model.AppLibraryButtons1> appLibraryButtons1List = new List <RoadFlow.Data.Model.AppLibraryButtons1>();

            while (dataReader.Read())
            {
                RoadFlow.Data.Model.AppLibraryButtons1 appLibraryButtons1 = new RoadFlow.Data.Model.AppLibraryButtons1();
                appLibraryButtons1.ID           = dataReader.GetString(0).ToGuid();
                appLibraryButtons1.AppLibraryID = dataReader.GetString(1).ToGuid();
                if (!dataReader.IsDBNull(2))
                {
                    appLibraryButtons1.ButtonID = new Guid?(dataReader.GetString(2).ToGuid());
                }
                appLibraryButtons1.Name   = dataReader.GetString(3);
                appLibraryButtons1.Events = dataReader.GetString(4);
                if (!dataReader.IsDBNull(5))
                {
                    appLibraryButtons1.Ico = dataReader.GetString(5);
                }
                appLibraryButtons1.Sort           = dataReader.GetInt32(6);
                appLibraryButtons1.Type           = dataReader.GetInt32(7);
                appLibraryButtons1.ShowType       = dataReader.GetInt32(8);
                appLibraryButtons1.IsValidateShow = dataReader.GetInt32(9);
                appLibraryButtons1List.Add(appLibraryButtons1);
            }
            return(appLibraryButtons1List);
        }
Esempio n. 2
0
        public int Update(RoadFlow.Data.Model.AppLibraryButtons1 model)
        {
            string sql = "UPDATE AppLibraryButtons1 SET \r\n\t\t\t\tAppLibraryID=:AppLibraryID,ButtonID=:ButtonID,Name=:Name,Events=:Events,Ico=:Ico,Sort=:Sort,Type=:Type,ShowType=:ShowType,IsValidateShow=:IsValidateShow\r\n\t\t\t\tWHERE ID=:ID";

            OracleParameter[] oracleParameterArray = new OracleParameter[10];
            int             index1           = 0;
            OracleParameter oracleParameter1 = new OracleParameter(":AppLibraryID", OracleDbType.Varchar2);

            oracleParameter1.Value       = (object)model.AppLibraryID;
            oracleParameterArray[index1] = oracleParameter1;
            int             index2 = 1;
            OracleParameter oracleParameter2;

            if (model.ButtonID.HasValue)
            {
                OracleParameter oracleParameter3 = new OracleParameter(":ButtonID", OracleDbType.Varchar2);
                oracleParameter3.Value = (object)model.ButtonID;
                oracleParameter2       = oracleParameter3;
            }
            else
            {
                oracleParameter2       = new OracleParameter(":ButtonID", OracleDbType.Varchar2);
                oracleParameter2.Value = (object)DBNull.Value;
            }
            oracleParameterArray[index2] = oracleParameter2;
            int             index3           = 2;
            OracleParameter oracleParameter4 = new OracleParameter(":Name", OracleDbType.Varchar2);

            oracleParameter4.Value       = (object)model.Name;
            oracleParameterArray[index3] = oracleParameter4;
            int             index4           = 3;
            OracleParameter oracleParameter5 = new OracleParameter(":Events", OracleDbType.Varchar2);

            oracleParameter5.Value       = (object)model.Events;
            oracleParameterArray[index4] = oracleParameter5;
            int             index5           = 4;
            OracleParameter oracleParameter6 = new OracleParameter(":Ico", OracleDbType.Varchar2);

            oracleParameter6.Value       = (object)model.Ico;
            oracleParameterArray[index5] = oracleParameter6;
            int             index6           = 5;
            OracleParameter oracleParameter7 = new OracleParameter(":Sort", OracleDbType.Int32);

            oracleParameter7.Value       = (object)model.Sort;
            oracleParameterArray[index6] = oracleParameter7;
            int             index7           = 6;
            OracleParameter oracleParameter8 = new OracleParameter(":Type", OracleDbType.Int32);

            oracleParameter8.Value       = (object)model.Type;
            oracleParameterArray[index7] = oracleParameter8;
            int             index8           = 7;
            OracleParameter oracleParameter9 = new OracleParameter(":ShowType", OracleDbType.Int32);

            oracleParameter9.Value       = (object)model.ShowType;
            oracleParameterArray[index8] = oracleParameter9;
            int             index9            = 8;
            OracleParameter oracleParameter10 = new OracleParameter(":IsValidateShow", OracleDbType.Int32);

            oracleParameter10.Value      = (object)model.IsValidateShow;
            oracleParameterArray[index9] = oracleParameter10;
            int             index10           = 9;
            OracleParameter oracleParameter11 = new OracleParameter(":ID", OracleDbType.Varchar2);

            oracleParameter11.Value       = (object)model.ID;
            oracleParameterArray[index10] = oracleParameter11;
            OracleParameter[] parameter = oracleParameterArray;
            return(this.dbHelper.Execute(sql, parameter));
        }
Esempio n. 3
0
 public int Add(RoadFlow.Data.Model.AppLibraryButtons1 model)
 {
     return(this.dataAppLibraryButtons1.Add(model));
 }
Esempio n. 4
0
 public int Update(RoadFlow.Data.Model.AppLibraryButtons1 model)
 {
     return(this.dataAppLibraryButtons1.Update(model));
 }
Esempio n. 5
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));
        }
Esempio n. 6
0
        public int Update(RoadFlow.Data.Model.AppLibraryButtons1 model)
        {
            string sql = "UPDATE AppLibraryButtons1 SET \r\n\t\t\t\tAppLibraryID=@AppLibraryID,ButtonID=@ButtonID,Name=@Name,Events=@Events,Ico=@Ico,Sort=@Sort,Type=@Type,ShowType=@ShowType,IsValidateShow=@IsValidateShow\r\n\t\t\t\tWHERE ID=@ID";

            SqlParameter[] sqlParameterArray = new SqlParameter[10];
            int            index1            = 0;
            SqlParameter   sqlParameter1     = new SqlParameter("@AppLibraryID", SqlDbType.UniqueIdentifier, -1);

            sqlParameter1.Value       = (object)model.AppLibraryID;
            sqlParameterArray[index1] = sqlParameter1;
            int          index2 = 1;
            SqlParameter sqlParameter2;

            if (model.ButtonID.HasValue)
            {
                SqlParameter sqlParameter3 = new SqlParameter("@ButtonID", SqlDbType.UniqueIdentifier, -1);
                sqlParameter3.Value = (object)model.ButtonID;
                sqlParameter2       = sqlParameter3;
            }
            else
            {
                sqlParameter2       = new SqlParameter("@ButtonID", SqlDbType.UniqueIdentifier, -1);
                sqlParameter2.Value = (object)DBNull.Value;
            }
            sqlParameterArray[index2] = sqlParameter2;
            int          index3        = 2;
            SqlParameter sqlParameter4 = new SqlParameter("@Name", SqlDbType.NVarChar, 1000);

            sqlParameter4.Value       = (object)model.Name;
            sqlParameterArray[index3] = sqlParameter4;
            int          index4        = 3;
            SqlParameter sqlParameter5 = new SqlParameter("@Events", SqlDbType.VarChar, 5000);

            sqlParameter5.Value       = (object)model.Events;
            sqlParameterArray[index4] = sqlParameter5;
            int          index5        = 4;
            SqlParameter sqlParameter6 = new SqlParameter("@Ico", SqlDbType.VarChar, 2000);

            sqlParameter6.Value       = (object)model.Ico;
            sqlParameterArray[index5] = sqlParameter6;
            int          index6        = 5;
            SqlParameter sqlParameter7 = new SqlParameter("@Sort", SqlDbType.Int, -1);

            sqlParameter7.Value       = (object)model.Sort;
            sqlParameterArray[index6] = sqlParameter7;
            int          index7        = 6;
            SqlParameter sqlParameter8 = new SqlParameter("@Type", SqlDbType.Int, -1);

            sqlParameter8.Value       = (object)model.Type;
            sqlParameterArray[index7] = sqlParameter8;
            int          index8        = 7;
            SqlParameter sqlParameter9 = new SqlParameter("@ShowType", SqlDbType.Int, -1);

            sqlParameter9.Value       = (object)model.ShowType;
            sqlParameterArray[index8] = sqlParameter9;
            int          index9         = 8;
            SqlParameter sqlParameter10 = new SqlParameter("@IsValidateShow", SqlDbType.Int, -1);

            sqlParameter10.Value      = (object)model.IsValidateShow;
            sqlParameterArray[index9] = sqlParameter10;
            int          index10        = 9;
            SqlParameter sqlParameter11 = new SqlParameter("@ID", SqlDbType.UniqueIdentifier, -1);

            sqlParameter11.Value       = (object)model.ID;
            sqlParameterArray[index10] = sqlParameter11;
            SqlParameter[] parameter = sqlParameterArray;
            return(this.dbHelper.Execute(sql, parameter, false));
        }
Esempio n. 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));
        }
        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));
        }
Esempio n. 10
0
        public static System.Collections.Generic.Dictionary <int, string> getButtonsHtml(string menuID = "", string subpageID = "", string programID = "")
        {
            Guid menuID1;

            if (menuID.IsNullOrEmpty() || !menuID.IsGuid(out menuID1))
            {
                menuID1 = HttpContext.Current.Request.QueryString["appid"].ToGuid();
            }
            Guid subpageID1;

            if (!subpageID.IsGuid(out subpageID1))
            {
                subpageID1 = HttpContext.Current.Request.QueryString["subpageid"].ToGuid();
            }
            System.Collections.Generic.Dictionary <int, string> dictionary = new System.Collections.Generic.Dictionary <int, string>();
            dictionary.Add(0, "");
            dictionary.Add(1, "");
            dictionary.Add(2, "");
            string      str1     = HttpContext.Current.Request.QueryString["applibaryid"];
            List <Guid> guidList = new List <Guid>();

            if (str1.IsGuid())
            {
                foreach (RoadFlow.Data.Model.AppLibraryButtons1 appLibraryButtons1 in new AppLibraryButtons1().GetAllByAppID(str1.ToGuid()).FindAll((Predicate <RoadFlow.Data.Model.AppLibraryButtons1>)(p => p.IsValidateShow == 1)))
                {
                    guidList.Add(appLibraryButtons1.ID);
                }
            }
            else
            {
                foreach (RoadFlow.Data.Model.MenuUser menuUser in new MenuUser().GetAll(true).FindAll((Predicate <RoadFlow.Data.Model.MenuUser>)(p =>
                {
                    if (p.MenuID == menuID1 && p.SubPageID == subpageID1)
                    {
                        return(p.Users.Contains(Users.CurrentUserID.ToString(), StringComparison.CurrentCultureIgnoreCase));
                    }
                    return(false);
                })))
                {
                    string buttons = menuUser.Buttons;
                    char[] chArray = new char[1] {
                        ','
                    };
                    foreach (string str2 in buttons.Split(chArray))
                    {
                        Guid test;
                        if (str2.IsGuid(out test) && !guidList.Contains(test))
                        {
                            guidList.Add(test);
                        }
                    }
                }
            }
            List <RoadFlow.Data.Model.AppLibraryButtons1> source = new List <RoadFlow.Data.Model.AppLibraryButtons1>();

            RoadFlow.Data.Model.AppLibrary byCode = new AppLibrary().GetByCode(programID, true);
            if (byCode != null)
            {
                source.AddRange((IEnumerable <RoadFlow.Data.Model.AppLibraryButtons1>) new AppLibraryButtons1().GetAllByAppID(byCode.ID).FindAll((Predicate <RoadFlow.Data.Model.AppLibraryButtons1>)(p => p.IsValidateShow == 0)));
            }
            if (guidList.Count == 0 && source.Count == 0)
            {
                return(dictionary);
            }
            StringBuilder      stringBuilder1       = new StringBuilder();
            StringBuilder      stringBuilder2       = new StringBuilder();
            StringBuilder      stringBuilder3       = new StringBuilder();
            AppLibraryButtons1 appLibraryButtons1_1 = new AppLibraryButtons1();

            foreach (Guid id in guidList)
            {
                RoadFlow.Data.Model.AppLibraryButtons1 appLibraryButtons1_2 = appLibraryButtons1_1.Get(id, true);
                if (appLibraryButtons1_2 != null && appLibraryButtons1_2.IsValidateShow != 0)
                {
                    source.Add(appLibraryButtons1_2);
                }
            }
            foreach (RoadFlow.Data.Model.AppLibraryButtons1 appLibraryButtons1_2 in (IEnumerable <RoadFlow.Data.Model.AppLibraryButtons1>)source.OrderBy <RoadFlow.Data.Model.AppLibraryButtons1, int>((Func <RoadFlow.Data.Model.AppLibraryButtons1, int>)(p => p.Sort)))
            {
                string userID = Users.CurrentUserID.ToString();
                if (appLibraryButtons1_2.ShowType == 0)
                {
                    string str2 = "fun_" + Guid.NewGuid().ToString("N");
                    stringBuilder1.Append("<a href=\"javascript:void(0);\" onclick=\"" + str2 + "();return false;\"><span style=\"" + (appLibraryButtons1_2.Ico.IsNullOrEmpty() || appLibraryButtons1_2.Ico.IsFontIco() ? "padding-left:0px;" : "background-image:url(" + Config.BaseUrl + appLibraryButtons1_2.Ico + ");") + "\">" + (appLibraryButtons1_2.Ico.IsNullOrEmpty() || !appLibraryButtons1_2.Ico.IsFontIco() ? "" : "<i class='fa " + appLibraryButtons1_2.Ico + "' style='font-size:14px;vertical-align:middle;margin-right:3px;'></i>") + appLibraryButtons1_2.Name + "</span></a>");
                    stringBuilder1.Append("<script type=\"text/javascript\">function " + str2 + "(){" + appLibraryButtons1_2.Events.FilterWildcard(userID) + "}</script>");
                }
                else if (appLibraryButtons1_2.ShowType == 1)
                {
                    string str2 = "fun_" + Guid.NewGuid().ToString("N");
                    stringBuilder2.Append("<button type=\"button\" " + (appLibraryButtons1_2.Ico.IsNullOrEmpty() ? "style=\"margin-left:6px;\"" : "style=\"margin-left:6px;" + (appLibraryButtons1_2.Ico.IsNullOrEmpty() || appLibraryButtons1_2.Ico.IsFontIco() ? "" : "background-image:url(" + Config.BaseUrl + appLibraryButtons1_2.Ico + ");background-repeat:no-repeat;background-position-y:center;background-position-x:8px;padding-left:28px;") + "\"") + " onclick=\"" + str2 + "();return false;\" class=\"mybutton\">");
                    if (!appLibraryButtons1_2.Ico.IsNullOrEmpty() && appLibraryButtons1_2.Ico.IsFontIco())
                    {
                        stringBuilder2.Append("<i class=\"fa " + appLibraryButtons1_2.Ico + "\" style=\"font-size:14px;vertical-align:middle;margin-right:3px;\"></i>");
                    }
                    stringBuilder2.Append("<span style=\"vertical-align:middle;\">" + appLibraryButtons1_2.Name + "</span>");
                    stringBuilder2.Append("</button>");
                    stringBuilder2.Append("<script type=\"text/javascript\">function " + str2 + "(){" + appLibraryButtons1_2.Events.FilterWildcard(userID) + "}</script>");
                }
                else if (appLibraryButtons1_2.ShowType == 2)
                {
                    string str2 = "fun_" + Guid.NewGuid().ToString("N");
                    stringBuilder3.Append("<a href=\"javascript:void(0);\" onclick=\"" + appLibraryButtons1_2.Events + ";return false;\" " + (appLibraryButtons1_2.Ico.IsNullOrEmpty() ? "style=\"margin-left:0px;\"" : "style=\"margin-left:0px;" + (!appLibraryButtons1_2.Ico.IsFontIco() ? "padding-left:26px;background-image:url(" + Config.BaseUrl + appLibraryButtons1_2.Ico + ");background-repeat:no-repeat;background-position-y:center;background-position-x:8px;" : "") + "\"") + ">" + (appLibraryButtons1_2.Ico.IsNullOrEmpty() || !appLibraryButtons1_2.Ico.IsFontIco() ? "" : "<i class='fa " + appLibraryButtons1_2.Ico + "' style='font-size:14px;vertical-align:middle;margin-right:3px;padding-left:10px;'></i>") + appLibraryButtons1_2.Name + "</a>");
                }
            }
            dictionary[0] = stringBuilder1.Length > 0 ? "<div class=\"toolbar\" style=\"margin-top:0; border-top:none 0; position:fixed; top:0; left:0; right:0; margin-left:auto; z-index:999; width:100%; margin-right:auto;\">" + stringBuilder1.ToString() + "</div>" : "";
            dictionary[1] = stringBuilder2.ToString();
            dictionary[2] = stringBuilder3.ToString();
            return(dictionary);
        }
Esempio n. 11
0
        public int Update(RoadFlow.Data.Model.AppLibraryButtons1 model)
        {
            string sql = "UPDATE applibrarybuttons1 SET \r\n\t\t\t\tAppLibraryID=@AppLibraryID,ButtonID=@ButtonID,Name=@Name,Events=@Events,Ico=@Ico,Sort=@Sort,Type=@Type,ShowType=@ShowType,IsValidateShow=@IsValidateShow\r\n\t\t\t\tWHERE ID=@ID";

            MySqlParameter[] mySqlParameterArray = new MySqlParameter[10];
            int            index1          = 0;
            MySqlParameter mySqlParameter1 = new MySqlParameter("@AppLibraryID", MySqlDbType.VarChar, 36);

            mySqlParameter1.Value       = (object)model.AppLibraryID;
            mySqlParameterArray[index1] = mySqlParameter1;
            int            index2 = 1;
            MySqlParameter mySqlParameter2;

            if (model.ButtonID.HasValue)
            {
                MySqlParameter mySqlParameter3 = new MySqlParameter("@ButtonID", MySqlDbType.VarChar, 36);
                mySqlParameter3.Value = (object)model.ButtonID;
                mySqlParameter2       = mySqlParameter3;
            }
            else
            {
                mySqlParameter2       = new MySqlParameter("@ButtonID", MySqlDbType.VarChar, 36);
                mySqlParameter2.Value = (object)DBNull.Value;
            }
            mySqlParameterArray[index2] = mySqlParameter2;
            int            index3          = 2;
            MySqlParameter mySqlParameter4 = new MySqlParameter("@Name", MySqlDbType.Text, -1);

            mySqlParameter4.Value       = (object)model.Name;
            mySqlParameterArray[index3] = mySqlParameter4;
            int            index4          = 3;
            MySqlParameter mySqlParameter5 = new MySqlParameter("@Events", MySqlDbType.Text, -1);

            mySqlParameter5.Value       = (object)model.Events;
            mySqlParameterArray[index4] = mySqlParameter5;
            int            index5 = 4;
            MySqlParameter mySqlParameter6;

            if (model.Ico != null)
            {
                MySqlParameter mySqlParameter3 = new MySqlParameter("@Ico", MySqlDbType.Text, -1);
                mySqlParameter3.Value = (object)model.Ico;
                mySqlParameter6       = mySqlParameter3;
            }
            else
            {
                mySqlParameter6       = new MySqlParameter("@Ico", MySqlDbType.Text, -1);
                mySqlParameter6.Value = (object)DBNull.Value;
            }
            mySqlParameterArray[index5] = mySqlParameter6;
            int            index6          = 5;
            MySqlParameter mySqlParameter7 = new MySqlParameter("@Sort", MySqlDbType.Int32, 11);

            mySqlParameter7.Value       = (object)model.Sort;
            mySqlParameterArray[index6] = mySqlParameter7;
            int            index7          = 6;
            MySqlParameter mySqlParameter8 = new MySqlParameter("@Type", MySqlDbType.Int32, 11);

            mySqlParameter8.Value       = (object)model.Type;
            mySqlParameterArray[index7] = mySqlParameter8;
            int            index8          = 7;
            MySqlParameter mySqlParameter9 = new MySqlParameter("@ShowType", MySqlDbType.Int32, 11);

            mySqlParameter9.Value       = (object)model.ShowType;
            mySqlParameterArray[index8] = mySqlParameter9;
            int            index9           = 8;
            MySqlParameter mySqlParameter10 = new MySqlParameter("@IsValidateShow", MySqlDbType.Int32, 11);

            mySqlParameter10.Value      = (object)model.IsValidateShow;
            mySqlParameterArray[index9] = mySqlParameter10;
            int            index10          = 9;
            MySqlParameter mySqlParameter11 = new MySqlParameter("@ID", MySqlDbType.VarChar, 36);

            mySqlParameter11.Value       = (object)model.ID;
            mySqlParameterArray[index10] = mySqlParameter11;
            MySqlParameter[] parameter = mySqlParameterArray;
            return(this.dbHelper.Execute(sql, parameter, false));
        }