Exemplo n.º 1
0
        private List <RoadFlow.Data.Model.AppLibraryButtons1> DataReaderToList(SqlDataReader dataReader)
        {
            List <RoadFlow.Data.Model.AppLibraryButtons1> list = new List <RoadFlow.Data.Model.AppLibraryButtons1>();

            RoadFlow.Data.Model.AppLibraryButtons1 appLibraryButtons = null;
            while (dataReader.Read())
            {
                appLibraryButtons              = new RoadFlow.Data.Model.AppLibraryButtons1();
                appLibraryButtons.ID           = dataReader.GetGuid(0);
                appLibraryButtons.AppLibraryID = dataReader.GetGuid(1);
                if (!dataReader.IsDBNull(2))
                {
                    appLibraryButtons.ButtonID = dataReader.GetGuid(2);
                }
                appLibraryButtons.Name   = dataReader.GetString(3);
                appLibraryButtons.Events = dataReader.GetString(4);
                if (!dataReader.IsDBNull(5))
                {
                    appLibraryButtons.Ico = dataReader.GetString(5);
                }
                appLibraryButtons.Sort           = dataReader.GetInt32(6);
                appLibraryButtons.Type           = dataReader.GetInt32(7);
                appLibraryButtons.ShowType       = dataReader.GetInt32(8);
                appLibraryButtons.IsValidateShow = dataReader.GetInt32(9);
                list.Add(appLibraryButtons);
            }
            return(list);
        }
Exemplo n.º 2
0
        private List <RoadFlow.Data.Model.AppLibraryButtons1> DataReaderToList(OracleDataReader dataReader)
        {
            List <RoadFlow.Data.Model.AppLibraryButtons1> list = new List <RoadFlow.Data.Model.AppLibraryButtons1>();

            RoadFlow.Data.Model.AppLibraryButtons1 appLibraryButtons = null;
            while (((DbDataReader)dataReader).Read())
            {
                appLibraryButtons              = new RoadFlow.Data.Model.AppLibraryButtons1();
                appLibraryButtons.ID           = ((DbDataReader)dataReader).GetString(0).ToGuid();
                appLibraryButtons.AppLibraryID = ((DbDataReader)dataReader).GetString(1).ToGuid();
                if (!((DbDataReader)dataReader).IsDBNull(2))
                {
                    appLibraryButtons.ButtonID = ((DbDataReader)dataReader).GetString(2).ToGuid();
                }
                appLibraryButtons.Name   = ((DbDataReader)dataReader).GetString(3);
                appLibraryButtons.Events = ((DbDataReader)dataReader).GetString(4);
                if (!((DbDataReader)dataReader).IsDBNull(5))
                {
                    appLibraryButtons.Ico = ((DbDataReader)dataReader).GetString(5);
                }
                appLibraryButtons.Sort           = ((DbDataReader)dataReader).GetInt32(6);
                appLibraryButtons.Type           = ((DbDataReader)dataReader).GetInt32(7);
                appLibraryButtons.ShowType       = ((DbDataReader)dataReader).GetInt32(8);
                appLibraryButtons.IsValidateShow = ((DbDataReader)dataReader).GetInt32(9);
                list.Add(appLibraryButtons);
            }
            return(list);
        }
Exemplo n.º 3
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[] parameter = new SqlParameter[10]
            {
                new SqlParameter("@AppLibraryID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.AppLibraryID
                },
                (!model.ButtonID.HasValue) ? new SqlParameter("@ButtonID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@ButtonID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.ButtonID
                },
                new SqlParameter("@Name", SqlDbType.NVarChar, 1000)
                {
                    Value = model.Name
                },
                new SqlParameter("@Events", SqlDbType.VarChar, 5000)
                {
                    Value = model.Events
                },
                new SqlParameter("@Ico", SqlDbType.VarChar, 2000)
                {
                    Value = model.Ico
                },
                new SqlParameter("@Sort", SqlDbType.Int, -1)
                {
                    Value = model.Sort
                },
                new SqlParameter("@Type", SqlDbType.Int, -1)
                {
                    Value = model.Type
                },
                new SqlParameter("@ShowType", SqlDbType.Int, -1)
                {
                    Value = model.ShowType
                },
                new SqlParameter("@IsValidateShow", SqlDbType.Int, -1)
                {
                    Value = model.IsValidateShow
                },
                new SqlParameter("@ID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.ID
                }
            };
            return(dbHelper.Execute(sql, parameter));
        }
Exemplo n.º 4
0
        public int Add(RoadFlow.Data.Model.AppLibraryButtons1 model)
        {
            string sql = "INSERT INTO AppLibraryButtons1\r\n\t\t\t\t(ID,AppLibraryID,ButtonID,Name,Events,Ico,Sort,Type,ShowType,IsValidateShow) \r\n\t\t\t\tVALUES(@ID,@AppLibraryID,@ButtonID,@Name,@Events,@Ico,@Sort,@Type,@ShowType,@IsValidateShow)";

            SqlParameter[] parameter = new SqlParameter[10]
            {
                new SqlParameter("@ID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.ID
                },
                new SqlParameter("@AppLibraryID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.AppLibraryID
                },
                (!model.ButtonID.HasValue) ? new SqlParameter("@ButtonID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@ButtonID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.ButtonID
                },
                new SqlParameter("@Name", SqlDbType.NVarChar, 1000)
                {
                    Value = model.Name
                },
                new SqlParameter("@Events", SqlDbType.VarChar, 5000)
                {
                    Value = model.Events
                },
                new SqlParameter("@Ico", SqlDbType.VarChar, 2000)
                {
                    Value = model.Ico
                },
                new SqlParameter("@Sort", SqlDbType.Int, -1)
                {
                    Value = model.Sort
                },
                new SqlParameter("@Type", SqlDbType.Int, -1)
                {
                    Value = model.Type
                },
                new SqlParameter("@ShowType", SqlDbType.Int, -1)
                {
                    Value = model.ShowType
                },
                new SqlParameter("@IsValidateShow", SqlDbType.Int, -1)
                {
                    Value = model.IsValidateShow
                }
            };
            return(dbHelper.Execute(sql, parameter));
        }
Exemplo n.º 5
0
        public int Add(RoadFlow.Data.Model.AppLibraryButtons1 model)
        {
            //IL_0016: Unknown result type (might be due to invalid IL or missing references)
            //IL_001b: Unknown result type (might be due to invalid IL or missing references)
            //IL_002c: Expected O, but got Unknown
            //IL_002d: Expected O, but got Unknown
            //IL_0036: Unknown result type (might be due to invalid IL or missing references)
            //IL_003b: Unknown result type (might be due to invalid IL or missing references)
            //IL_004c: Expected O, but got Unknown
            //IL_004d: Expected O, but got Unknown
            //IL_0066: Unknown result type (might be due to invalid IL or missing references)
            //IL_006b: Unknown result type (might be due to invalid IL or missing references)
            //IL_007c: Expected O, but got Unknown
            //IL_0085: Unknown result type (might be due to invalid IL or missing references)
            //IL_008a: Unknown result type (might be due to invalid IL or missing references)
            //IL_0095: Expected O, but got Unknown
            //IL_0096: Expected O, but got Unknown
            //IL_009f: Unknown result type (might be due to invalid IL or missing references)
            //IL_00a4: Unknown result type (might be due to invalid IL or missing references)
            //IL_00b0: Expected O, but got Unknown
            //IL_00b1: Expected O, but got Unknown
            //IL_00ba: Unknown result type (might be due to invalid IL or missing references)
            //IL_00bf: Unknown result type (might be due to invalid IL or missing references)
            //IL_00cb: Expected O, but got Unknown
            //IL_00cc: Expected O, but got Unknown
            //IL_00d5: Unknown result type (might be due to invalid IL or missing references)
            //IL_00da: Unknown result type (might be due to invalid IL or missing references)
            //IL_00e6: Expected O, but got Unknown
            //IL_00e7: Expected O, but got Unknown
            //IL_00f0: Unknown result type (might be due to invalid IL or missing references)
            //IL_00f5: Unknown result type (might be due to invalid IL or missing references)
            //IL_0106: Expected O, but got Unknown
            //IL_0107: Expected O, but got Unknown
            //IL_0110: Unknown result type (might be due to invalid IL or missing references)
            //IL_0115: Unknown result type (might be due to invalid IL or missing references)
            //IL_0126: Expected O, but got Unknown
            //IL_0127: Expected O, but got Unknown
            //IL_0130: Unknown result type (might be due to invalid IL or missing references)
            //IL_0135: Unknown result type (might be due to invalid IL or missing references)
            //IL_0146: Expected O, but got Unknown
            //IL_0147: Expected O, but got Unknown
            //IL_0151: Unknown result type (might be due to invalid IL or missing references)
            //IL_0156: Unknown result type (might be due to invalid IL or missing references)
            //IL_0167: Expected O, but got Unknown
            //IL_0168: Expected O, but got Unknown
            string sql = "INSERT INTO AppLibraryButtons1\r\n\t\t\t\t(ID,AppLibraryID,ButtonID,Name,Events,Ico,Sort,Type,ShowType,IsValidateShow) \r\n\t\t\t\tVALUES(:ID,:AppLibraryID,:ButtonID,:Name,:Events,:Ico,:Sort,:Type,:ShowType,:IsValidateShow)";

            OracleParameter[] obj = new OracleParameter[10];
            OracleParameter   val = new OracleParameter(":ID", 126);

            ((DbParameter)val).Value = model.ID;
            obj[0] = val;
            OracleParameter val2 = new OracleParameter(":AppLibraryID", 126);

            ((DbParameter)val2).Value = model.AppLibraryID;
            obj[1] = val2;
            _003F val3;

            if (model.ButtonID.HasValue)
            {
                val3 = new OracleParameter(":ButtonID", 126);
                ((DbParameter)val3).Value = model.ButtonID;
            }
            else
            {
                val3 = new OracleParameter(":ButtonID", 126);
                ((DbParameter)val3).Value = DBNull.Value;
            }
            obj[2] = val3;
            OracleParameter val4 = new OracleParameter(":Name", 126);

            ((DbParameter)val4).Value = model.Name;
            obj[3] = val4;
            OracleParameter val5 = new OracleParameter(":Events", 126);

            ((DbParameter)val5).Value = model.Events;
            obj[4] = val5;
            OracleParameter val6 = new OracleParameter(":Ico", 126);

            ((DbParameter)val6).Value = model.Ico;
            obj[5] = val6;
            OracleParameter val7 = new OracleParameter(":Sort", 112);

            ((DbParameter)val7).Value = model.Sort;
            obj[6] = val7;
            OracleParameter val8 = new OracleParameter(":Type", 112);

            ((DbParameter)val8).Value = model.Type;
            obj[7] = val8;
            OracleParameter val9 = new OracleParameter(":ShowType", 112);

            ((DbParameter)val9).Value = model.ShowType;
            obj[8] = val9;
            OracleParameter val10 = new OracleParameter(":IsValidateShow", 112);

            ((DbParameter)val10).Value = model.IsValidateShow;
            obj[9] = val10;
            OracleParameter[] parameter = (OracleParameter[])obj;
            return(dbHelper.Execute(sql, parameter));
        }
Exemplo n.º 6
0
        public int Update(RoadFlow.Data.Model.AppLibraryButtons1 model)
        {
            //IL_0016: Unknown result type (might be due to invalid IL or missing references)
            //IL_001b: Unknown result type (might be due to invalid IL or missing references)
            //IL_002c: Expected O, but got Unknown
            //IL_002d: Expected O, but got Unknown
            //IL_0046: Unknown result type (might be due to invalid IL or missing references)
            //IL_004b: Unknown result type (might be due to invalid IL or missing references)
            //IL_005c: Expected O, but got Unknown
            //IL_0065: Unknown result type (might be due to invalid IL or missing references)
            //IL_006a: Unknown result type (might be due to invalid IL or missing references)
            //IL_0075: Expected O, but got Unknown
            //IL_0076: Expected O, but got Unknown
            //IL_007f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0084: Unknown result type (might be due to invalid IL or missing references)
            //IL_0090: Expected O, but got Unknown
            //IL_0091: Expected O, but got Unknown
            //IL_009a: Unknown result type (might be due to invalid IL or missing references)
            //IL_009f: Unknown result type (might be due to invalid IL or missing references)
            //IL_00ab: Expected O, but got Unknown
            //IL_00ac: Expected O, but got Unknown
            //IL_00b5: Unknown result type (might be due to invalid IL or missing references)
            //IL_00ba: Unknown result type (might be due to invalid IL or missing references)
            //IL_00c6: Expected O, but got Unknown
            //IL_00c7: Expected O, but got Unknown
            //IL_00d0: Unknown result type (might be due to invalid IL or missing references)
            //IL_00d5: Unknown result type (might be due to invalid IL or missing references)
            //IL_00e6: Expected O, but got Unknown
            //IL_00e7: Expected O, but got Unknown
            //IL_00f0: Unknown result type (might be due to invalid IL or missing references)
            //IL_00f5: Unknown result type (might be due to invalid IL or missing references)
            //IL_0106: Expected O, but got Unknown
            //IL_0107: Expected O, but got Unknown
            //IL_0110: Unknown result type (might be due to invalid IL or missing references)
            //IL_0115: Unknown result type (might be due to invalid IL or missing references)
            //IL_0126: Expected O, but got Unknown
            //IL_0127: Expected O, but got Unknown
            //IL_0130: Unknown result type (might be due to invalid IL or missing references)
            //IL_0135: Unknown result type (might be due to invalid IL or missing references)
            //IL_0146: Expected O, but got Unknown
            //IL_0147: Expected O, but got Unknown
            //IL_0151: Unknown result type (might be due to invalid IL or missing references)
            //IL_0156: Unknown result type (might be due to invalid IL or missing references)
            //IL_0167: Expected O, but got Unknown
            //IL_0168: Expected O, but got Unknown
            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[] obj = new OracleParameter[10];
            OracleParameter   val = new OracleParameter(":AppLibraryID", 126);

            ((DbParameter)val).Value = model.AppLibraryID;
            obj[0] = val;
            _003F val2;

            if (model.ButtonID.HasValue)
            {
                val2 = new OracleParameter(":ButtonID", 126);
                ((DbParameter)val2).Value = model.ButtonID;
            }
            else
            {
                val2 = new OracleParameter(":ButtonID", 126);
                ((DbParameter)val2).Value = DBNull.Value;
            }
            obj[1] = val2;
            OracleParameter val3 = new OracleParameter(":Name", 126);

            ((DbParameter)val3).Value = model.Name;
            obj[2] = val3;
            OracleParameter val4 = new OracleParameter(":Events", 126);

            ((DbParameter)val4).Value = model.Events;
            obj[3] = val4;
            OracleParameter val5 = new OracleParameter(":Ico", 126);

            ((DbParameter)val5).Value = model.Ico;
            obj[4] = val5;
            OracleParameter val6 = new OracleParameter(":Sort", 112);

            ((DbParameter)val6).Value = model.Sort;
            obj[5] = val6;
            OracleParameter val7 = new OracleParameter(":Type", 112);

            ((DbParameter)val7).Value = model.Type;
            obj[6] = val7;
            OracleParameter val8 = new OracleParameter(":ShowType", 112);

            ((DbParameter)val8).Value = model.ShowType;
            obj[7] = val8;
            OracleParameter val9 = new OracleParameter(":IsValidateShow", 112);

            ((DbParameter)val9).Value = model.IsValidateShow;
            obj[8] = val9;
            OracleParameter val10 = new OracleParameter(":ID", 126);

            ((DbParameter)val10).Value = model.ID;
            obj[9] = val10;
            OracleParameter[] parameter = (OracleParameter[])obj;
            return(dbHelper.Execute(sql, parameter));
        }
Exemplo n.º 7
0
 public int Update(RoadFlow.Data.Model.AppLibraryButtons1 model)
 {
     return(dataAppLibraryButtons1.Update(model));
 }
Exemplo n.º 8
0
        public bool Publish(Guid id, bool isMvc = false)
        {
            RoadFlow.Data.Model.ProgramBuilder model1 = this.Get(id);
            if (model1 == null || model1.Name.IsNullOrEmpty() || model1.SQL.IsNullOrEmpty())
            {
                return(false);
            }
            AppLibrary appLibrary = new AppLibrary();

            RoadFlow.Data.Model.AppLibrary model2 = appLibrary.GetByCode(id.ToString(), true);
            bool flag1 = false;

            using (TransactionScope transactionScope = new TransactionScope())
            {
                if (model2 == null)
                {
                    flag1     = true;
                    model2    = new RoadFlow.Data.Model.AppLibrary();
                    model2.ID = Guid.NewGuid();
                }
                model2.Address  = !isMvc ? "/Platform/ProgramBuilder/Run.aspx?programid=" + id.ToString() : "/ProgramBuilder/Run?programid=" + id.ToString();
                model2.Code     = id.ToString();
                model2.OpenMode = 0;
                model2.Title    = model1.Name;
                model2.Type     = model1.Type;
                if (flag1)
                {
                    appLibrary.Add(model2);
                }
                else
                {
                    appLibrary.Update(model2);
                }
                model1.Status = 1;
                this.Update(model1);
                List <RoadFlow.Data.Model.ProgramBuilderButtons> all = new ProgramBuilderButtons().GetAll(model1.ID);
                AppLibraryButtons1 appLibraryButtons1_1 = new AppLibraryButtons1();
                List <RoadFlow.Data.Model.AppLibraryButtons1> allByAppId             = appLibraryButtons1_1.GetAllByAppID(model2.ID);
                List <RoadFlow.Data.Model.AppLibraryButtons1> appLibraryButtons1List = new List <RoadFlow.Data.Model.AppLibraryButtons1>();
                foreach (RoadFlow.Data.Model.ProgramBuilderButtons programBuilderButtons in all)
                {
                    RoadFlow.Data.Model.ProgramBuilderButtons button = programBuilderButtons;
                    RoadFlow.Data.Model.AppLibraryButtons1    model3 = allByAppId.Find((Predicate <RoadFlow.Data.Model.AppLibraryButtons1>)(p => p.ID == button.ID));
                    bool flag2 = false;
                    if (model3 == null)
                    {
                        model3 = new RoadFlow.Data.Model.AppLibraryButtons1();
                        flag2  = true;
                    }
                    model3.AppLibraryID   = model2.ID;
                    model3.ButtonID       = button.ButtonID;
                    model3.Events         = button.ClientScript;
                    model3.Ico            = button.Ico ?? "";
                    model3.ID             = button.ID;
                    model3.Name           = button.ButtonName;
                    model3.ShowType       = button.ShowType;
                    model3.Sort           = button.Sort;
                    model3.Type           = 0;
                    model3.IsValidateShow = button.IsValidateShow;
                    if (flag2)
                    {
                        appLibraryButtons1_1.Add(model3);
                    }
                    else
                    {
                        appLibraryButtons1_1.Update(model3);
                    }
                    appLibraryButtons1List.Add(model3);
                }
                foreach (RoadFlow.Data.Model.AppLibraryButtons1 appLibraryButtons1_2 in allByAppId)
                {
                    RoadFlow.Data.Model.AppLibraryButtons1 button = appLibraryButtons1_2;
                    if (appLibraryButtons1List.Find((Predicate <RoadFlow.Data.Model.AppLibraryButtons1>)(p => p.ID == button.ID)) == null)
                    {
                        appLibraryButtons1_1.Delete(button.ID);
                    }
                }
                transactionScope.Complete();
            }
            new AppLibrary().ClearCache();
            new Menu().ClearAllDataTableCache();
            new AppLibraryButtons1().ClearCache();
            new AppLibrarySubPages().ClearCache();
            this.AddToCache(new ProgramBuilderCache()
            {
                Program   = model1,
                Fields    = new ProgramBuilderFields().GetAll(model1.ID).OrderBy <RoadFlow.Data.Model.ProgramBuilderFields, int>((Func <RoadFlow.Data.Model.ProgramBuilderFields, int>)(p => p.Sort)).ToList <RoadFlow.Data.Model.ProgramBuilderFields>(),
                Querys    = new ProgramBuilderQuerys().GetAll(model1.ID).OrderBy <RoadFlow.Data.Model.ProgramBuilderQuerys, int>((Func <RoadFlow.Data.Model.ProgramBuilderQuerys, int>)(p => p.Sort)).ToList <RoadFlow.Data.Model.ProgramBuilderQuerys>(),
                Buttons   = new ProgramBuilderButtons().GetAll(id).OrderBy <RoadFlow.Data.Model.ProgramBuilderButtons, int>((Func <RoadFlow.Data.Model.ProgramBuilderButtons, int>)(p => p.Sort)).ToList <RoadFlow.Data.Model.ProgramBuilderButtons>(),
                Validates = new ProgramBuilderValidates().GetAll(id),
                Export    = new ProgramBuilderExport().GetAll(id).OrderBy <RoadFlow.Data.Model.ProgramBuilderExport, int>((Func <RoadFlow.Data.Model.ProgramBuilderExport, int>)(p => p.Sort)).ToList <RoadFlow.Data.Model.ProgramBuilderExport>()
            });
            return(true);
        }
Exemplo n.º 9
0
        public int Add(RoadFlow.Data.Model.AppLibraryButtons1 model)
        {
            //IL_001b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0020: Unknown result type (might be due to invalid IL or missing references)
            //IL_0031: Expected O, but got Unknown
            //IL_0032: Expected O, but got Unknown
            //IL_0040: Unknown result type (might be due to invalid IL or missing references)
            //IL_0045: Unknown result type (might be due to invalid IL or missing references)
            //IL_0056: Expected O, but got Unknown
            //IL_0057: Expected O, but got Unknown
            //IL_0075: Unknown result type (might be due to invalid IL or missing references)
            //IL_007a: Unknown result type (might be due to invalid IL or missing references)
            //IL_008b: Expected O, but got Unknown
            //IL_0099: Unknown result type (might be due to invalid IL or missing references)
            //IL_009e: Unknown result type (might be due to invalid IL or missing references)
            //IL_00a9: Expected O, but got Unknown
            //IL_00aa: Expected O, but got Unknown
            //IL_00b7: Unknown result type (might be due to invalid IL or missing references)
            //IL_00bc: Unknown result type (might be due to invalid IL or missing references)
            //IL_00c8: Expected O, but got Unknown
            //IL_00c9: Expected O, but got Unknown
            //IL_00d6: Unknown result type (might be due to invalid IL or missing references)
            //IL_00db: Unknown result type (might be due to invalid IL or missing references)
            //IL_00e7: Expected O, but got Unknown
            //IL_00e8: Expected O, but got Unknown
            //IL_00fd: Unknown result type (might be due to invalid IL or missing references)
            //IL_0102: Unknown result type (might be due to invalid IL or missing references)
            //IL_010e: Expected O, but got Unknown
            //IL_011b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0120: Unknown result type (might be due to invalid IL or missing references)
            //IL_012b: Expected O, but got Unknown
            //IL_012c: Expected O, but got Unknown
            //IL_0136: Unknown result type (might be due to invalid IL or missing references)
            //IL_013b: Unknown result type (might be due to invalid IL or missing references)
            //IL_014c: Expected O, but got Unknown
            //IL_014d: Expected O, but got Unknown
            //IL_0157: Unknown result type (might be due to invalid IL or missing references)
            //IL_015c: Unknown result type (might be due to invalid IL or missing references)
            //IL_016d: Expected O, but got Unknown
            //IL_016e: Expected O, but got Unknown
            //IL_0178: Unknown result type (might be due to invalid IL or missing references)
            //IL_017d: Unknown result type (might be due to invalid IL or missing references)
            //IL_018e: Expected O, but got Unknown
            //IL_018f: Expected O, but got Unknown
            //IL_019a: Unknown result type (might be due to invalid IL or missing references)
            //IL_019f: Unknown result type (might be due to invalid IL or missing references)
            //IL_01b0: Expected O, but got Unknown
            //IL_01b1: Expected O, but got Unknown
            string sql = "INSERT INTO applibrarybuttons1\r\n\t\t\t\t(ID,AppLibraryID,ButtonID,Name,Events,Ico,Sort,Type,ShowType,IsValidateShow) \r\n\t\t\t\tVALUES(@ID,@AppLibraryID,@ButtonID,@Name,@Events,@Ico,@Sort,@Type,@ShowType,@IsValidateShow)";

            MySqlParameter[] obj = new MySqlParameter[10];
            MySqlParameter   val = new MySqlParameter("@ID", 253, 36);

            ((DbParameter)val).Value = model.ID;
            obj[0] = val;
            MySqlParameter val2 = new MySqlParameter("@AppLibraryID", 253, 36);

            ((DbParameter)val2).Value = model.AppLibraryID;
            obj[1] = val2;
            _003F val3;

            if (model.ButtonID.HasValue)
            {
                val3 = new MySqlParameter("@ButtonID", 253, 36);
                ((DbParameter)val3).Value = model.ButtonID;
            }
            else
            {
                val3 = new MySqlParameter("@ButtonID", 253, 36);
                ((DbParameter)val3).Value = DBNull.Value;
            }
            obj[2] = val3;
            MySqlParameter val4 = new MySqlParameter("@Name", 752, -1);

            ((DbParameter)val4).Value = model.Name;
            obj[3] = val4;
            MySqlParameter val5 = new MySqlParameter("@Events", 752, -1);

            ((DbParameter)val5).Value = model.Events;
            obj[4] = val5;
            _003F val6;

            if (model.Ico != null)
            {
                val6 = new MySqlParameter("@Ico", 752, -1);
                ((DbParameter)val6).Value = model.Ico;
            }
            else
            {
                val6 = new MySqlParameter("@Ico", 752, -1);
                ((DbParameter)val6).Value = DBNull.Value;
            }
            obj[5] = val6;
            MySqlParameter val7 = new MySqlParameter("@Sort", 3, 11);

            ((DbParameter)val7).Value = model.Sort;
            obj[6] = val7;
            MySqlParameter val8 = new MySqlParameter("@Type", 3, 11);

            ((DbParameter)val8).Value = model.Type;
            obj[7] = val8;
            MySqlParameter val9 = new MySqlParameter("@ShowType", 3, 11);

            ((DbParameter)val9).Value = model.ShowType;
            obj[8] = val9;
            MySqlParameter val10 = new MySqlParameter("@IsValidateShow", 3, 11);

            ((DbParameter)val10).Value = model.IsValidateShow;
            obj[9] = val10;
            MySqlParameter[] parameter = (MySqlParameter[])obj;
            return(dbHelper.Execute(sql, parameter));
        }
Exemplo n.º 10
0
 public int Add(RoadFlow.Data.Model.AppLibraryButtons1 model)
 {
     return(dataAppLibraryButtons1.Add(model));
 }
Exemplo n.º 11
0
        public int Update(RoadFlow.Data.Model.AppLibraryButtons1 model)
        {
            //IL_001b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0020: Unknown result type (might be due to invalid IL or missing references)
            //IL_0031: Expected O, but got Unknown
            //IL_0032: Expected O, but got Unknown
            //IL_0050: Unknown result type (might be due to invalid IL or missing references)
            //IL_0055: Unknown result type (might be due to invalid IL or missing references)
            //IL_0066: Expected O, but got Unknown
            //IL_0074: Unknown result type (might be due to invalid IL or missing references)
            //IL_0079: Unknown result type (might be due to invalid IL or missing references)
            //IL_0084: Expected O, but got Unknown
            //IL_0085: Expected O, but got Unknown
            //IL_0092: Unknown result type (might be due to invalid IL or missing references)
            //IL_0097: Unknown result type (might be due to invalid IL or missing references)
            //IL_00a3: Expected O, but got Unknown
            //IL_00a4: Expected O, but got Unknown
            //IL_00b1: Unknown result type (might be due to invalid IL or missing references)
            //IL_00b6: Unknown result type (might be due to invalid IL or missing references)
            //IL_00c2: Expected O, but got Unknown
            //IL_00c3: Expected O, but got Unknown
            //IL_00d8: Unknown result type (might be due to invalid IL or missing references)
            //IL_00dd: Unknown result type (might be due to invalid IL or missing references)
            //IL_00e9: Expected O, but got Unknown
            //IL_00f6: Unknown result type (might be due to invalid IL or missing references)
            //IL_00fb: Unknown result type (might be due to invalid IL or missing references)
            //IL_0106: Expected O, but got Unknown
            //IL_0107: Expected O, but got Unknown
            //IL_0111: Unknown result type (might be due to invalid IL or missing references)
            //IL_0116: Unknown result type (might be due to invalid IL or missing references)
            //IL_0127: Expected O, but got Unknown
            //IL_0128: Expected O, but got Unknown
            //IL_0132: Unknown result type (might be due to invalid IL or missing references)
            //IL_0137: Unknown result type (might be due to invalid IL or missing references)
            //IL_0148: Expected O, but got Unknown
            //IL_0149: Expected O, but got Unknown
            //IL_0153: Unknown result type (might be due to invalid IL or missing references)
            //IL_0158: Unknown result type (might be due to invalid IL or missing references)
            //IL_0169: Expected O, but got Unknown
            //IL_016a: Expected O, but got Unknown
            //IL_0174: Unknown result type (might be due to invalid IL or missing references)
            //IL_0179: Unknown result type (might be due to invalid IL or missing references)
            //IL_018a: Expected O, but got Unknown
            //IL_018b: Expected O, but got Unknown
            //IL_019a: Unknown result type (might be due to invalid IL or missing references)
            //IL_019f: Unknown result type (might be due to invalid IL or missing references)
            //IL_01b0: Expected O, but got Unknown
            //IL_01b1: Expected O, but got Unknown
            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[] obj = new MySqlParameter[10];
            MySqlParameter   val = new MySqlParameter("@AppLibraryID", 253, 36);

            ((DbParameter)val).Value = model.AppLibraryID;
            obj[0] = val;
            _003F val2;

            if (model.ButtonID.HasValue)
            {
                val2 = new MySqlParameter("@ButtonID", 253, 36);
                ((DbParameter)val2).Value = model.ButtonID;
            }
            else
            {
                val2 = new MySqlParameter("@ButtonID", 253, 36);
                ((DbParameter)val2).Value = DBNull.Value;
            }
            obj[1] = val2;
            MySqlParameter val3 = new MySqlParameter("@Name", 752, -1);

            ((DbParameter)val3).Value = model.Name;
            obj[2] = val3;
            MySqlParameter val4 = new MySqlParameter("@Events", 752, -1);

            ((DbParameter)val4).Value = model.Events;
            obj[3] = val4;
            _003F val5;

            if (model.Ico != null)
            {
                val5 = new MySqlParameter("@Ico", 752, -1);
                ((DbParameter)val5).Value = model.Ico;
            }
            else
            {
                val5 = new MySqlParameter("@Ico", 752, -1);
                ((DbParameter)val5).Value = DBNull.Value;
            }
            obj[4] = val5;
            MySqlParameter val6 = new MySqlParameter("@Sort", 3, 11);

            ((DbParameter)val6).Value = model.Sort;
            obj[5] = val6;
            MySqlParameter val7 = new MySqlParameter("@Type", 3, 11);

            ((DbParameter)val7).Value = model.Type;
            obj[6] = val7;
            MySqlParameter val8 = new MySqlParameter("@ShowType", 3, 11);

            ((DbParameter)val8).Value = model.ShowType;
            obj[7] = val8;
            MySqlParameter val9 = new MySqlParameter("@IsValidateShow", 3, 11);

            ((DbParameter)val9).Value = model.IsValidateShow;
            obj[8] = val9;
            MySqlParameter val10 = new MySqlParameter("@ID", 253, 36);

            ((DbParameter)val10).Value = model.ID;
            obj[9] = val10;
            MySqlParameter[] parameter = (MySqlParameter[])obj;
            return(dbHelper.Execute(sql, parameter));
        }
Exemplo n.º 12
0
        public bool Publish(Guid id, bool isMvc = false)
        {
            RoadFlow.Data.Model.ProgramBuilder programBuilder = Get(id);
            if (programBuilder == null || programBuilder.Name.IsNullOrEmpty() || programBuilder.SQL.IsNullOrEmpty())
            {
                return(false);
            }
            AppLibrary appLibrary = new AppLibrary();

            RoadFlow.Data.Model.AppLibrary appLibrary2 = appLibrary.GetByCode(id.ToString());
            bool flag = false;

            using (TransactionScope transactionScope = new TransactionScope())
            {
                if (appLibrary2 == null)
                {
                    flag           = true;
                    appLibrary2    = new RoadFlow.Data.Model.AppLibrary();
                    appLibrary2.ID = Guid.NewGuid();
                }
                appLibrary2.Address  = ((!isMvc) ? ("/Platform/ProgramBuilder/Run.aspx?programid=" + id.ToString()) : ("/ProgramBuilder/Run?programid=" + id.ToString()));
                appLibrary2.Code     = id.ToString();
                appLibrary2.OpenMode = 0;
                appLibrary2.Title    = programBuilder.Name;
                appLibrary2.Type     = programBuilder.Type;
                if (flag)
                {
                    appLibrary.Add(appLibrary2);
                }
                else
                {
                    appLibrary.Update(appLibrary2);
                }
                programBuilder.Status = 1;
                Update(programBuilder);
                List <RoadFlow.Data.Model.ProgramBuilderButtons> all = new ProgramBuilderButtons().GetAll(programBuilder.ID);
                AppLibraryButtons1 appLibraryButtons = new AppLibraryButtons1();
                List <RoadFlow.Data.Model.AppLibraryButtons1> allByAppID = appLibraryButtons.GetAllByAppID(appLibrary2.ID);
                List <RoadFlow.Data.Model.AppLibraryButtons1> list       = new List <RoadFlow.Data.Model.AppLibraryButtons1>();
                foreach (RoadFlow.Data.Model.ProgramBuilderButtons item in all)
                {
                    RoadFlow.Data.Model.AppLibraryButtons1 appLibraryButtons2 = allByAppID.Find((RoadFlow.Data.Model.AppLibraryButtons1 p) => p.ID == item.ID);
                    bool flag2 = false;
                    if (appLibraryButtons2 == null)
                    {
                        appLibraryButtons2 = new RoadFlow.Data.Model.AppLibraryButtons1();
                        flag2 = true;
                    }
                    appLibraryButtons2.AppLibraryID   = appLibrary2.ID;
                    appLibraryButtons2.ButtonID       = item.ButtonID;
                    appLibraryButtons2.Events         = item.ClientScript;
                    appLibraryButtons2.Ico            = (item.Ico ?? "");
                    appLibraryButtons2.ID             = item.ID;
                    appLibraryButtons2.Name           = item.ButtonName;
                    appLibraryButtons2.ShowType       = item.ShowType;
                    appLibraryButtons2.Sort           = item.Sort;
                    appLibraryButtons2.Type           = 0;
                    appLibraryButtons2.IsValidateShow = item.IsValidateShow;
                    if (flag2)
                    {
                        appLibraryButtons.Add(appLibraryButtons2);
                    }
                    else
                    {
                        appLibraryButtons.Update(appLibraryButtons2);
                    }
                    list.Add(appLibraryButtons2);
                }
                foreach (RoadFlow.Data.Model.AppLibraryButtons1 item2 in allByAppID)
                {
                    if (list.Find((RoadFlow.Data.Model.AppLibraryButtons1 p) => p.ID == item2.ID) == null)
                    {
                        appLibraryButtons.Delete(item2.ID);
                    }
                }
                transactionScope.Complete();
            }
            new AppLibrary().ClearCache();
            new Menu().ClearAllDataTableCache();
            new AppLibraryButtons1().ClearCache();
            new AppLibrarySubPages().ClearCache();
            ProgramBuilderCache programBuilderCache = new ProgramBuilderCache();

            programBuilderCache.Program = programBuilder;
            programBuilderCache.Fields  = (from p in new ProgramBuilderFields().GetAll(programBuilder.ID)
                                           orderby p.Sort
                                           select p).ToList();
            programBuilderCache.Querys = (from p in new ProgramBuilderQuerys().GetAll(programBuilder.ID)
                                          orderby p.Sort
                                          select p).ToList();
            programBuilderCache.Buttons = (from p in new ProgramBuilderButtons().GetAll(id)
                                           orderby p.Sort
                                           select p).ToList();
            programBuilderCache.Validates = new ProgramBuilderValidates().GetAll(id);
            programBuilderCache.Export    = (from p in new ProgramBuilderExport().GetAll(id)
                                             orderby p.Sort
                                             select p).ToList();
            AddToCache(programBuilderCache);
            return(true);
        }
Exemplo n.º 13
0
        public static Dictionary <int, string> getButtonsHtml(string menuID = "", string subpageID = "", string programID = "")
        {
            Guid menuID2;

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

            if (!subpageID.IsGuid(out subpageID2))
            {
                subpageID2 = HttpContext.Current.Request.QueryString["subpageid"].ToGuid();
            }
            Dictionary <int, string> dictionary = new Dictionary <int, string>();

            dictionary.Add(0, "");
            dictionary.Add(1, "");
            dictionary.Add(2, "");
            string      str  = HttpContext.Current.Request.QueryString["applibaryid"];
            List <Guid> list = new List <Guid>();

            if (str.IsGuid())
            {
                foreach (RoadFlow.Data.Model.AppLibraryButtons1 item in new AppLibraryButtons1().GetAllByAppID(str.ToGuid()).FindAll((RoadFlow.Data.Model.AppLibraryButtons1 p) => p.IsValidateShow == 1))
                {
                    list.Add(item.ID);
                }
            }
            else
            {
                foreach (RoadFlow.Data.Model.MenuUser item2 in new MenuUser().GetAll().FindAll(delegate(RoadFlow.Data.Model.MenuUser p)
                {
                    if (p.MenuID == menuID2 && p.SubPageID == subpageID2)
                    {
                        return(p.Users.Contains(Users.CurrentUserID.ToString(), StringComparison.CurrentCultureIgnoreCase));
                    }
                    return(false);
                }))
                {
                    string[] array = item2.Buttons.Split(',');
                    for (int i = 0; i < array.Length; i++)
                    {
                        Guid test;
                        if (array[i].IsGuid(out test) && !list.Contains(test))
                        {
                            list.Add(test);
                        }
                    }
                }
            }
            List <RoadFlow.Data.Model.AppLibraryButtons1> list2 = new List <RoadFlow.Data.Model.AppLibraryButtons1>();

            RoadFlow.Data.Model.AppLibrary byCode = new AppLibrary().GetByCode(programID);
            if (byCode != null)
            {
                list2.AddRange(new AppLibraryButtons1().GetAllByAppID(byCode.ID).FindAll((RoadFlow.Data.Model.AppLibraryButtons1 p) => p.IsValidateShow == 0));
            }
            if (list.Count == 0 && list2.Count == 0)
            {
                return(dictionary);
            }
            StringBuilder      stringBuilder     = new StringBuilder();
            StringBuilder      stringBuilder2    = new StringBuilder();
            StringBuilder      stringBuilder3    = new StringBuilder();
            AppLibraryButtons1 appLibraryButtons = new AppLibraryButtons1();

            foreach (Guid item3 in list)
            {
                RoadFlow.Data.Model.AppLibraryButtons1 appLibraryButtons2 = appLibraryButtons.Get(item3, true);
                if (appLibraryButtons2 != null && appLibraryButtons2.IsValidateShow != 0)
                {
                    list2.Add(appLibraryButtons2);
                }
            }
            foreach (RoadFlow.Data.Model.AppLibraryButtons1 item4 in from p in list2
                     orderby p.Sort
                     select p)
            {
                string userID = Users.CurrentUserID.ToString();
                if (item4.ShowType == 0)
                {
                    string text = "fun_" + Guid.NewGuid().ToString("N");
                    stringBuilder.Append("<a href=\"javascript:void(0);\" onclick=\"" + text + "();return false;\"><span style=\"" + ((!item4.Ico.IsNullOrEmpty() && !item4.Ico.IsFontIco()) ? ("background-image:url(" + Config.BaseUrl + item4.Ico + ");") : "padding-left:0px;") + "\">" + ((!item4.Ico.IsNullOrEmpty() && item4.Ico.IsFontIco()) ? ("<i class='fa " + item4.Ico + "' style='font-size:14px;vertical-align:middle;margin-right:3px;'></i>") : "") + item4.Name + "</span></a>");
                    stringBuilder.Append("<script type=\"text/javascript\">function " + text + "(){" + item4.Events.FilterWildcard(userID) + "}</script>");
                }
                else if (item4.ShowType == 1)
                {
                    string text2 = "fun_" + Guid.NewGuid().ToString("N");
                    stringBuilder2.Append("<button type=\"button\" " + (item4.Ico.IsNullOrEmpty() ? "style=\"margin-left:6px;\"" : ("style=\"margin-left:6px;" + ((!item4.Ico.IsNullOrEmpty() && !item4.Ico.IsFontIco()) ? ("background-image:url(" + Config.BaseUrl + item4.Ico + ");background-repeat:no-repeat;background-position-y:center;background-position-x:8px;padding-left:28px;") : "") + "\"")) + " onclick=\"" + text2 + "();return false;\" class=\"mybutton\">");
                    if (!item4.Ico.IsNullOrEmpty() && item4.Ico.IsFontIco())
                    {
                        stringBuilder2.Append("<i class=\"fa " + item4.Ico + "\" style=\"font-size:14px;vertical-align:middle;margin-right:3px;\"></i>");
                    }
                    stringBuilder2.Append("<span style=\"vertical-align:middle;\">" + item4.Name + "</span>");
                    stringBuilder2.Append("</button>");
                    stringBuilder2.Append("<script type=\"text/javascript\">function " + text2 + "(){" + item4.Events.FilterWildcard(userID) + "}</script>");
                }
                else if (item4.ShowType == 2)
                {
                    string text3 = "fun_" + Guid.NewGuid().ToString("N");
                    stringBuilder3.Append("<a href=\"javascript:void(0);\" onclick=\"" + item4.Events + ";return false;\" " + (item4.Ico.IsNullOrEmpty() ? "style=\"margin-left:0px;\"" : ("style=\"margin-left:0px;" + ((!item4.Ico.IsFontIco()) ? ("padding-left:26px;background-image:url(" + Config.BaseUrl + item4.Ico + ");background-repeat:no-repeat;background-position-y:center;background-position-x:8px;") : "") + "\"")) + ">" + ((!item4.Ico.IsNullOrEmpty() && item4.Ico.IsFontIco()) ? ("<i class='fa " + item4.Ico + "' style='font-size:14px;vertical-align:middle;margin-right:3px;padding-left:10px;'></i>") : "") + item4.Name + "</a>");
                }
            }
            dictionary[0] = ((stringBuilder.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;\">" + stringBuilder.ToString() + "</div>") : "");
            dictionary[1] = stringBuilder2.ToString();
            dictionary[2] = stringBuilder3.ToString();
            return(dictionary);
        }
Exemplo n.º 14
0
        public ActionResult Edit(FormCollection collection)
        {
            string str   = 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 (str.IsGuid())
            {
                appLibrary2 = appLibrary.Get(str.ToGuid());
            }
            bool   flag   = !str.IsGuid();
            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 = appLibrary2.Serialize();
                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 text    = collection["address"];
                string str2    = collection["openModel"];
                string str3    = collection["width"];
                string str4    = collection["height"];
                string @params = collection["Params"];
                string note    = collection["Note"];
                string text2   = collection["Ico"];
                string text3   = collection["IcoColor"];
                value = collection["type"];
                appLibrary2.Address  = text.Trim();
                appLibrary2.Height   = str4.ToIntOrNull();
                appLibrary2.Note     = note;
                appLibrary2.OpenMode = str2.ToInt();
                appLibrary2.Params   = @params;
                appLibrary2.Title    = title;
                appLibrary2.Type     = value.ToGuid();
                appLibrary2.Width    = str3.ToIntOrNull();
                if (!text2.IsNullOrEmpty())
                {
                    appLibrary2.Ico = text2;
                }
                else
                {
                    appLibrary2.Ico = null;
                }
                if (!text3.IsNullOrEmpty())
                {
                    appLibrary2.Color = text3.Trim();
                }
                else
                {
                    appLibrary2.Color = null;
                }
                string text4 = base.Request.QueryString["pagesize"];
                string text5 = base.Request.QueryString["pagenumber"];
                using (TransactionScope transactionScope = new TransactionScope())
                {
                    if (flag)
                    {
                        appLibrary.Add(appLibrary2);
                        RoadFlow.Platform.Log.Add("添加了应用程序库", appLibrary2.Serialize(), RoadFlow.Platform.Log.Types.菜单权限);
                        base.ViewBag.Script = "alert('添加成功!');new RoadUI.Window().reloadOpener(undefined,undefined,\"query('" + text4 + "','" + text5 + "')\");new RoadUI.Window().close();";
                    }
                    else
                    {
                        appLibrary.Update(appLibrary2);
                        RoadFlow.Platform.Log.Add("修改了应用程序库", "", RoadFlow.Platform.Log.Types.菜单权限, oldXML, appLibrary2.Serialize());
                        base.ViewBag.Script = "alert('修改成功!');new RoadUI.Window().reloadOpener(undefined,undefined,\"query('" + text4 + "','" + text5 + "')\");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 str5  = base.Request.Form["button_" + index];
                        string str6  = base.Request.Form["buttonname_" + index];
                        string text6 = base.Request.Form["buttonevents_" + index];
                        string ico   = base.Request.Form["buttonico_" + index];
                        string str7  = base.Request.Form["showtype_" + index];
                        string str8  = base.Request.Form["buttonsort_" + index];
                        if (!str6.IsNullOrEmpty() && !text6.IsNullOrEmpty())
                        {
                            RoadFlow.Data.Model.AppLibraryButtons1 appLibraryButtons2 = allByAppID.Find((RoadFlow.Data.Model.AppLibraryButtons1 p) => p.ID == index.ToGuid());
                            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 (str5.IsGuid())
                            {
                                appLibraryButtons2.ButtonID = str5.ToGuid();
                            }
                            appLibraryButtons2.Events   = text6;
                            appLibraryButtons2.Ico      = ico;
                            appLibraryButtons2.Name     = str6.Trim1();
                            appLibraryButtons2.Sort     = str8.ToInt(0);
                            appLibraryButtons2.ShowType = str7.ToInt(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.º 15
0
        public ActionResult SubPageEdit(FormCollection collection)
        {
            RoadFlow.Platform.AppLibrarySubPages   appLibrarySubPages  = new RoadFlow.Platform.AppLibrarySubPages();
            RoadFlow.Data.Model.AppLibrarySubPages appLibrarySubPages2 = null;
            string str = base.Request.QueryString["subid"];

            if (str.IsGuid())
            {
                appLibrarySubPages2 = appLibrarySubPages.Get(str.ToGuid());
            }
            if (collection != null)
            {
                string str2 = base.Request.Form["Title"];
                string str3 = base.Request.Form["Address"];
                bool   flag = false;
                if (appLibrarySubPages2 == null)
                {
                    appLibrarySubPages2 = new RoadFlow.Data.Model.AppLibrarySubPages();
                    flag = true;
                    appLibrarySubPages2.ID           = Guid.NewGuid();
                    appLibrarySubPages2.AppLibraryID = base.Request.QueryString["id"].ToGuid();
                }
                appLibrarySubPages2.Name    = str2.Trim1();
                appLibrarySubPages2.Address = str3.Trim1();
                using (TransactionScope transactionScope = new TransactionScope())
                {
                    if (flag)
                    {
                        appLibrarySubPages.Add(appLibrarySubPages2);
                        RoadFlow.Platform.Log.Add("添加了子页面", appLibrarySubPages2.Serialize(), RoadFlow.Platform.Log.Types.菜单权限);
                        base.ViewBag.Script = "alert('添加成功!');window.location='SubPages" + base.Request.Url.Query + "';";
                    }
                    else
                    {
                        appLibrarySubPages.Update(appLibrarySubPages2);
                        RoadFlow.Platform.Log.Add("修改了子页面", appLibrarySubPages2.Serialize(), 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 str4 = base.Request.Form["button_" + index];
                        string str5 = base.Request.Form["buttonname_" + index];
                        string text = base.Request.Form["buttonevents_" + index];
                        string ico  = base.Request.Form["buttonico_" + index];
                        string str6 = base.Request.Form["showtype_" + index];
                        string str7 = base.Request.Form["buttonsort_" + index];
                        if (!str5.IsNullOrEmpty() && !text.IsNullOrEmpty())
                        {
                            RoadFlow.Data.Model.AppLibraryButtons1 appLibraryButtons2 = allByAppID.Find((RoadFlow.Data.Model.AppLibraryButtons1 p) => p.ID == index.ToGuid());
                            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 (str4.IsGuid())
                            {
                                appLibraryButtons2.ButtonID = str4.ToGuid();
                            }
                            appLibraryButtons2.Events   = text;
                            appLibraryButtons2.Ico      = ico;
                            appLibraryButtons2.Name     = str5.Trim1();
                            appLibraryButtons2.Sort     = str7.ToInt(0);
                            appLibraryButtons2.ShowType = str6.ToInt(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 = base.Request.QueryString["id"].ToGuid();
            }
            return(View(appLibrarySubPages2));
        }