Example #1
0
        private List <RoadFlow.Data.Model.ProgramBuilderButtons> DataReaderToList(MySqlDataReader dataReader)
        {
            List <RoadFlow.Data.Model.ProgramBuilderButtons> list = new List <RoadFlow.Data.Model.ProgramBuilderButtons>();

            RoadFlow.Data.Model.ProgramBuilderButtons programBuilderButtons = null;
            while (((DbDataReader)dataReader).Read())
            {
                programBuilderButtons           = new RoadFlow.Data.Model.ProgramBuilderButtons();
                programBuilderButtons.ID        = ((DbDataReader)dataReader).GetString(0).ToGuid();
                programBuilderButtons.ProgramID = ((DbDataReader)dataReader).GetString(1).ToGuid();
                if (!((DbDataReader)dataReader).IsDBNull(2))
                {
                    programBuilderButtons.ButtonID = ((DbDataReader)dataReader).GetString(2).ToGuid();
                }
                programBuilderButtons.ButtonName = ((DbDataReader)dataReader).GetString(3);
                if (!((DbDataReader)dataReader).IsDBNull(4))
                {
                    programBuilderButtons.ClientScript = ((DbDataReader)dataReader).GetString(4);
                }
                if (!((DbDataReader)dataReader).IsDBNull(5))
                {
                    programBuilderButtons.Ico = ((DbDataReader)dataReader).GetString(5);
                }
                programBuilderButtons.ShowType       = ((DbDataReader)dataReader).GetInt32(6);
                programBuilderButtons.Sort           = ((DbDataReader)dataReader).GetInt32(7);
                programBuilderButtons.IsValidateShow = ((DbDataReader)dataReader).GetInt32(8);
                list.Add(programBuilderButtons);
            }
            return(list);
        }
Example #2
0
        public int Update(RoadFlow.Data.Model.ProgramBuilderButtons model)
        {
            string sql = "UPDATE ProgramBuilderButtons SET \r\n\t\t\t\tProgramID=@ProgramID,ButtonID=@ButtonID,ButtonName=@ButtonName,ClientScript=@ClientScript,Ico=@Ico,ShowType=@ShowType,Sort=@Sort,IsValidateShow=@IsValidateShow\r\n\t\t\t\tWHERE ID=@ID";

            SqlParameter[] parameter = new SqlParameter[9]
            {
                new SqlParameter("@ProgramID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.ProgramID
                },
                (!model.ButtonID.HasValue) ? new SqlParameter("@ButtonID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@ButtonID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.ButtonID
                },
                new SqlParameter("@ButtonName", SqlDbType.NVarChar, 400)
                {
                    Value = model.ButtonName
                },
                (model.ClientScript == null) ? new SqlParameter("@ClientScript", SqlDbType.VarChar, -1)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@ClientScript", SqlDbType.VarChar, -1)
                {
                    Value = model.ClientScript
                },
                (model.Ico == null) ? new SqlParameter("@Ico", SqlDbType.VarChar, 500)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@Ico", SqlDbType.VarChar, 500)
                {
                    Value = model.Ico
                },
                new SqlParameter("@ShowType", SqlDbType.Int, -1)
                {
                    Value = model.ShowType
                },
                new SqlParameter("@Sort", SqlDbType.Int, -1)
                {
                    Value = model.Sort
                },
                new SqlParameter("@IsValidateShow", SqlDbType.Int, -1)
                {
                    Value = model.IsValidateShow
                },
                new SqlParameter("@ID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.ID
                }
            };
            return(dbHelper.Execute(sql, parameter));
        }
Example #3
0
        public int Add(RoadFlow.Data.Model.ProgramBuilderButtons model)
        {
            string sql = "INSERT INTO ProgramBuilderButtons\r\n\t\t\t\t(ID,ProgramID,ButtonID,ButtonName,ClientScript,Ico,ShowType,Sort,IsValidateShow) \r\n\t\t\t\tVALUES(@ID,@ProgramID,@ButtonID,@ButtonName,@ClientScript,@Ico,@ShowType,@Sort,@IsValidateShow)";

            SqlParameter[] parameter = new SqlParameter[9]
            {
                new SqlParameter("@ID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.ID
                },
                new SqlParameter("@ProgramID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.ProgramID
                },
                (!model.ButtonID.HasValue) ? new SqlParameter("@ButtonID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@ButtonID", SqlDbType.UniqueIdentifier, -1)
                {
                    Value = model.ButtonID
                },
                new SqlParameter("@ButtonName", SqlDbType.NVarChar, 400)
                {
                    Value = model.ButtonName
                },
                (model.ClientScript == null) ? new SqlParameter("@ClientScript", SqlDbType.VarChar, -1)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@ClientScript", SqlDbType.VarChar, -1)
                {
                    Value = model.ClientScript
                },
                (model.Ico == null) ? new SqlParameter("@Ico", SqlDbType.VarChar, 500)
                {
                    Value = DBNull.Value
                } : new SqlParameter("@Ico", SqlDbType.VarChar, 500)
                {
                    Value = model.Ico
                },
                new SqlParameter("@ShowType", SqlDbType.Int, -1)
                {
                    Value = model.ShowType
                },
                new SqlParameter("@Sort", SqlDbType.Int, -1)
                {
                    Value = model.Sort
                },
                new SqlParameter("@IsValidateShow", SqlDbType.Int, -1)
                {
                    Value = model.IsValidateShow
                }
            };
            return(dbHelper.Execute(sql, parameter));
        }
Example #4
0
        public int Update(RoadFlow.Data.Model.ProgramBuilderButtons 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_0096: Unknown result type (might be due to invalid IL or missing references)
            //IL_009b: Unknown result type (might be due to invalid IL or missing references)
            //IL_00a7: Expected O, but got Unknown
            //IL_00a8: Expected O, but got Unknown
            //IL_00bd: Unknown result type (might be due to invalid IL or missing references)
            //IL_00c2: Unknown result type (might be due to invalid IL or missing references)
            //IL_00ce: Expected O, but got Unknown
            //IL_00db: Unknown result type (might be due to invalid IL or missing references)
            //IL_00e0: Unknown result type (might be due to invalid IL or missing references)
            //IL_00eb: Expected O, but got Unknown
            //IL_00ec: Expected O, but got Unknown
            //IL_0101: Unknown result type (might be due to invalid IL or missing references)
            //IL_0106: Unknown result type (might be due to invalid IL or missing references)
            //IL_0112: Expected O, but got Unknown
            //IL_011f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0124: Unknown result type (might be due to invalid IL or missing references)
            //IL_012f: Expected O, but got Unknown
            //IL_0130: Expected O, but got Unknown
            //IL_013a: Unknown result type (might be due to invalid IL or missing references)
            //IL_013f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0150: Expected O, but got Unknown
            //IL_0151: Expected O, but got Unknown
            //IL_015b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0160: Unknown result type (might be due to invalid IL or missing references)
            //IL_0171: Expected O, but got Unknown
            //IL_0172: Expected O, but got Unknown
            //IL_017c: Unknown result type (might be due to invalid IL or missing references)
            //IL_0181: Unknown result type (might be due to invalid IL or missing references)
            //IL_0192: Expected O, but got Unknown
            //IL_0193: Expected O, but got Unknown
            //IL_01a1: Unknown result type (might be due to invalid IL or missing references)
            //IL_01a6: Unknown result type (might be due to invalid IL or missing references)
            //IL_01b7: Expected O, but got Unknown
            //IL_01b8: Expected O, but got Unknown
            string sql = "UPDATE programbuilderbuttons SET \r\n\t\t\t\tProgramID=@ProgramID,ButtonID=@ButtonID,ButtonName=@ButtonName,ClientScript=@ClientScript,Ico=@Ico,ShowType=@ShowType,Sort=@Sort,IsValidateShow=@IsValidateShow\r\n\t\t\t\tWHERE ID=@ID";

            MySqlParameter[] obj = new MySqlParameter[9];
            MySqlParameter   val = new MySqlParameter("@ProgramID", 253, 36);

            ((DbParameter)val).Value = model.ProgramID;
            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("@ButtonName", 253, 200);

            ((DbParameter)val3).Value = model.ButtonName;
            obj[2] = val3;
            _003F val4;

            if (model.ClientScript != null)
            {
                val4 = new MySqlParameter("@ClientScript", 751, -1);
                ((DbParameter)val4).Value = model.ClientScript;
            }
            else
            {
                val4 = new MySqlParameter("@ClientScript", 751, -1);
                ((DbParameter)val4).Value = DBNull.Value;
            }
            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("@ShowType", 3, 11);

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

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

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

            ((DbParameter)val9).Value = model.ID;
            obj[8] = val9;
            MySqlParameter[] parameter = (MySqlParameter[])obj;
            return(dbHelper.Execute(sql, parameter));
        }
Example #5
0
        public int Add(RoadFlow.Data.Model.ProgramBuilderButtons 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_00bb: Unknown result type (might be due to invalid IL or missing references)
            //IL_00c0: Unknown result type (might be due to invalid IL or missing references)
            //IL_00cc: Expected O, but got Unknown
            //IL_00cd: Expected O, but got Unknown
            //IL_00e2: Unknown result type (might be due to invalid IL or missing references)
            //IL_00e7: Unknown result type (might be due to invalid IL or missing references)
            //IL_00f3: Expected O, but got Unknown
            //IL_0100: Unknown result type (might be due to invalid IL or missing references)
            //IL_0105: Unknown result type (might be due to invalid IL or missing references)
            //IL_0110: Expected O, but got Unknown
            //IL_0111: Expected O, but got Unknown
            //IL_0126: Unknown result type (might be due to invalid IL or missing references)
            //IL_012b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0137: Expected O, but got Unknown
            //IL_0144: Unknown result type (might be due to invalid IL or missing references)
            //IL_0149: Unknown result type (might be due to invalid IL or missing references)
            //IL_0154: Expected O, but got Unknown
            //IL_0155: Expected O, but got Unknown
            //IL_015f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0164: Unknown result type (might be due to invalid IL or missing references)
            //IL_0175: Expected O, but got Unknown
            //IL_0176: Expected O, but got Unknown
            //IL_0180: Unknown result type (might be due to invalid IL or missing references)
            //IL_0185: Unknown result type (might be due to invalid IL or missing references)
            //IL_0196: Expected O, but got Unknown
            //IL_0197: Expected O, but got Unknown
            //IL_01a1: Unknown result type (might be due to invalid IL or missing references)
            //IL_01a6: Unknown result type (might be due to invalid IL or missing references)
            //IL_01b7: Expected O, but got Unknown
            //IL_01b8: Expected O, but got Unknown
            string sql = "INSERT INTO programbuilderbuttons\r\n\t\t\t\t(ID,ProgramID,ButtonID,ButtonName,ClientScript,Ico,ShowType,Sort,IsValidateShow) \r\n\t\t\t\tVALUES(@ID,@ProgramID,@ButtonID,@ButtonName,@ClientScript,@Ico,@ShowType,@Sort,@IsValidateShow)";

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

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

            ((DbParameter)val2).Value = model.ProgramID;
            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("@ButtonName", 253, 200);

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

            if (model.ClientScript != null)
            {
                val5 = new MySqlParameter("@ClientScript", 751, -1);
                ((DbParameter)val5).Value = model.ClientScript;
            }
            else
            {
                val5 = new MySqlParameter("@ClientScript", 751, -1);
                ((DbParameter)val5).Value = DBNull.Value;
            }
            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("@ShowType", 3, 11);

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

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

            ((DbParameter)val9).Value = model.IsValidateShow;
            obj[8] = val9;
            MySqlParameter[] parameter = (MySqlParameter[])obj;
            return(dbHelper.Execute(sql, parameter));
        }
Example #6
0
 public int Update(RoadFlow.Data.Model.ProgramBuilderButtons model)
 {
     return(dataProgramBuilderButtons.Update(model));
 }
Example #7
0
 public int Add(RoadFlow.Data.Model.ProgramBuilderButtons model)
 {
     return(dataProgramBuilderButtons.Add(model));
 }
Example #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);
        }