Exemplo n.º 1
0
        public string GetQueryButtonHtml(RoadFlow.Data.Model.ProgramBuilder pb)
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append("<input type=\"submit\" name=\"searchbutton\" value=\" 查 询 \" class=\"mybutton\"/>");
            return(stringBuilder.ToString());
        }
Exemplo n.º 2
0
        private List <RoadFlow.Data.Model.ProgramBuilder> DataReaderToList(OracleDataReader dataReader)
        {
            List <RoadFlow.Data.Model.ProgramBuilder> programBuilderList = new List <RoadFlow.Data.Model.ProgramBuilder>();

            while (dataReader.Read())
            {
                RoadFlow.Data.Model.ProgramBuilder programBuilder = new RoadFlow.Data.Model.ProgramBuilder();
                programBuilder.ID         = dataReader.GetString(0).ToGuid();
                programBuilder.Name       = dataReader.GetString(1);
                programBuilder.Type       = dataReader.GetString(2).ToGuid();
                programBuilder.CreateTime = dataReader.GetDateTime(3);
                if (!dataReader.IsDBNull(4))
                {
                    programBuilder.PublishTime = new DateTime?(dataReader.GetDateTime(4));
                }
                programBuilder.CreateUser = dataReader.GetString(5).ToGuid();
                programBuilder.SQL        = dataReader.GetString(6);
                programBuilder.IsAdd      = dataReader.GetInt32(7);
                programBuilder.DBConnID   = dataReader.GetString(8).ToGuid();
                programBuilder.Status     = dataReader.GetInt32(9);
                if (!dataReader.IsDBNull(10))
                {
                    programBuilder.FormID = dataReader.GetString(10);
                }
                if (!dataReader.IsDBNull(11))
                {
                    programBuilder.EditModel = new int?(dataReader.GetInt32(11));
                }
                if (!dataReader.IsDBNull(12))
                {
                    programBuilder.Width = dataReader.GetString(12);
                }
                if (!dataReader.IsDBNull(13))
                {
                    programBuilder.Height = dataReader.GetString(13);
                }
                if (!dataReader.IsDBNull(14))
                {
                    programBuilder.ButtonLocation = new int?(dataReader.GetInt32(14));
                }
                if (!dataReader.IsDBNull(15))
                {
                    programBuilder.IsPager = new int?(dataReader.GetInt32(15));
                }
                if (!dataReader.IsDBNull(16))
                {
                    programBuilder.ClientScript = dataReader.GetString(16);
                }
                if (!dataReader.IsDBNull(17))
                {
                    programBuilder.ExportTemplate = dataReader.GetString(17);
                }
                if (!dataReader.IsDBNull(18))
                {
                    programBuilder.ExportHeaderText = dataReader.GetString(18);
                }
                if (!dataReader.IsDBNull(19))
                {
                    programBuilder.ExportFileName = dataReader.GetString(19);
                }
                if (!dataReader.IsDBNull(20))
                {
                    programBuilder.TableStyle = dataReader.GetString(20);
                }
                if (!dataReader.IsDBNull(21))
                {
                    programBuilder.TableHead = dataReader.GetString(21);
                }
                if (!dataReader.IsDBNull(22))
                {
                    programBuilder.TableName = dataReader.GetString(22);
                }
                if (!dataReader.IsDBNull(23))
                {
                    programBuilder.InDataNumberFiledName = dataReader.GetString(23);
                }
                programBuilderList.Add(programBuilder);
            }
            return(programBuilderList);
        }
Exemplo n.º 3
0
        public int Update(RoadFlow.Data.Model.ProgramBuilder model)
        {
            string sql = "UPDATE ProgramBuilder SET \r\n\t\t\t\tName=:Name,Type=:Type,CreateTime=:CreateTime,PublishTime=:PublishTime,CreateUser=:CreateUser,SQL=:SQL,IsAdd=:IsAdd,DBConnID=:DBConnID,Status=:Status,FormID=:FormID,EditModel=:EditModel,Width=:Width,Height=:Height,ButtonLocation=:ButtonLocation,IsPager=:IsPager,ClientScript=:ClientScript,ExportTemplate=:ExportTemplate,ExportHeaderText=:ExportHeaderText,ExportFileName=:ExportFileName,TableStyle=:TableStyle,TableHead=:TableHead,TableName=:TableName,InDataNumberFiledName=:InDataNumberFiledName   \r\n\t\t\t\tWHERE ID=:ID";

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

            oracleParameter1.Value       = (object)model.Name;
            oracleParameterArray[index1] = oracleParameter1;
            int             index2           = 1;
            OracleParameter oracleParameter2 = new OracleParameter(":Type", OracleDbType.Varchar2);

            oracleParameter2.Value       = (object)model.Type;
            oracleParameterArray[index2] = oracleParameter2;
            int             index3           = 2;
            OracleParameter oracleParameter3 = new OracleParameter(":CreateTime", OracleDbType.Date);

            oracleParameter3.Value       = (object)model.CreateTime;
            oracleParameterArray[index3] = oracleParameter3;
            int             index4 = 3;
            OracleParameter oracleParameter4;

            if (model.PublishTime.HasValue)
            {
                OracleParameter oracleParameter5 = new OracleParameter(":PublishTime", OracleDbType.Date);
                oracleParameter5.Value = (object)model.PublishTime;
                oracleParameter4       = oracleParameter5;
            }
            else
            {
                oracleParameter4       = new OracleParameter(":PublishTime", OracleDbType.Date);
                oracleParameter4.Value = (object)DBNull.Value;
            }
            oracleParameterArray[index4] = oracleParameter4;
            int             index5           = 4;
            OracleParameter oracleParameter6 = new OracleParameter(":CreateUser", OracleDbType.Varchar2);

            oracleParameter6.Value       = (object)model.CreateUser;
            oracleParameterArray[index5] = oracleParameter6;
            int             index6           = 5;
            OracleParameter oracleParameter7 = new OracleParameter(":SQL", OracleDbType.Varchar2);

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

            oracleParameter8.Value       = (object)model.IsAdd;
            oracleParameterArray[index7] = oracleParameter8;
            int             index8           = 7;
            OracleParameter oracleParameter9 = new OracleParameter(":DBConnID", OracleDbType.Varchar2);

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

            oracleParameter10.Value      = (object)model.Status;
            oracleParameterArray[index9] = oracleParameter10;
            int             index10 = 9;
            OracleParameter oracleParameter11;

            if (model.FormID != null)
            {
                OracleParameter oracleParameter5 = new OracleParameter(":FormID", OracleDbType.Varchar2);
                oracleParameter5.Value = (object)model.FormID;
                oracleParameter11      = oracleParameter5;
            }
            else
            {
                oracleParameter11       = new OracleParameter(":FormID", OracleDbType.Varchar2);
                oracleParameter11.Value = (object)DBNull.Value;
            }
            oracleParameterArray[index10] = oracleParameter11;
            int             index11  = 10;
            int?            nullable = model.EditModel;
            OracleParameter oracleParameter12;

            if (nullable.HasValue)
            {
                OracleParameter oracleParameter5 = new OracleParameter(":EditModel", OracleDbType.Int32);
                oracleParameter5.Value = (object)model.EditModel;
                oracleParameter12      = oracleParameter5;
            }
            else
            {
                oracleParameter12       = new OracleParameter(":EditModel", OracleDbType.Int32);
                oracleParameter12.Value = (object)DBNull.Value;
            }
            oracleParameterArray[index11] = oracleParameter12;
            int             index12 = 11;
            OracleParameter oracleParameter13;

            if (model.Width != null)
            {
                OracleParameter oracleParameter5 = new OracleParameter(":Width", OracleDbType.Varchar2);
                oracleParameter5.Value = (object)model.Width;
                oracleParameter13      = oracleParameter5;
            }
            else
            {
                oracleParameter13       = new OracleParameter(":Width", OracleDbType.Varchar2);
                oracleParameter13.Value = (object)DBNull.Value;
            }
            oracleParameterArray[index12] = oracleParameter13;
            int             index13 = 12;
            OracleParameter oracleParameter14;

            if (model.Height != null)
            {
                OracleParameter oracleParameter5 = new OracleParameter(":Height", OracleDbType.Varchar2);
                oracleParameter5.Value = (object)model.Height;
                oracleParameter14      = oracleParameter5;
            }
            else
            {
                oracleParameter14       = new OracleParameter(":Height", OracleDbType.Varchar2);
                oracleParameter14.Value = (object)DBNull.Value;
            }
            oracleParameterArray[index13] = oracleParameter14;
            int index14 = 13;

            nullable = model.ButtonLocation;
            OracleParameter oracleParameter15;

            if (nullable.HasValue)
            {
                OracleParameter oracleParameter5 = new OracleParameter(":ButtonLocation", OracleDbType.Int32);
                oracleParameter5.Value = (object)model.ButtonLocation;
                oracleParameter15      = oracleParameter5;
            }
            else
            {
                oracleParameter15       = new OracleParameter(":ButtonLocation", OracleDbType.Int32);
                oracleParameter15.Value = (object)DBNull.Value;
            }
            oracleParameterArray[index14] = oracleParameter15;
            int index15 = 14;

            nullable = model.IsPager;
            OracleParameter oracleParameter16;

            if (nullable.HasValue)
            {
                OracleParameter oracleParameter5 = new OracleParameter(":IsPager", OracleDbType.Int32);
                oracleParameter5.Value = (object)model.IsPager;
                oracleParameter16      = oracleParameter5;
            }
            else
            {
                oracleParameter16       = new OracleParameter(":IsPager", OracleDbType.Int32);
                oracleParameter16.Value = (object)DBNull.Value;
            }
            oracleParameterArray[index15] = oracleParameter16;
            int             index16 = 15;
            OracleParameter oracleParameter17;

            if (model.ClientScript != null)
            {
                OracleParameter oracleParameter5 = new OracleParameter(":ClientScript", OracleDbType.Varchar2);
                oracleParameter5.Value = (object)model.ClientScript;
                oracleParameter17      = oracleParameter5;
            }
            else
            {
                oracleParameter17       = new OracleParameter(":ClientScript", OracleDbType.Varchar2);
                oracleParameter17.Value = (object)DBNull.Value;
            }
            oracleParameterArray[index16] = oracleParameter17;
            int             index17 = 16;
            OracleParameter oracleParameter18;

            if (model.ExportTemplate != null)
            {
                OracleParameter oracleParameter5 = new OracleParameter(":ExportTemplate", OracleDbType.Varchar2, 4000);
                oracleParameter5.Value = (object)model.ExportTemplate;
                oracleParameter18      = oracleParameter5;
            }
            else
            {
                oracleParameter18       = new OracleParameter(":ExportTemplate", OracleDbType.Varchar2, 4000);
                oracleParameter18.Value = (object)DBNull.Value;
            }
            oracleParameterArray[index17] = oracleParameter18;
            int             index18 = 17;
            OracleParameter oracleParameter19;

            if (model.ExportHeaderText != null)
            {
                OracleParameter oracleParameter5 = new OracleParameter(":ExportHeaderText", OracleDbType.NVarchar2, 500);
                oracleParameter5.Value = (object)model.ExportHeaderText;
                oracleParameter19      = oracleParameter5;
            }
            else
            {
                oracleParameter19       = new OracleParameter(":ExportHeaderText", OracleDbType.NVarchar2, 500);
                oracleParameter19.Value = (object)DBNull.Value;
            }
            oracleParameterArray[index18] = oracleParameter19;
            int             index19 = 18;
            OracleParameter oracleParameter20;

            if (model.ExportFileName != null)
            {
                OracleParameter oracleParameter5 = new OracleParameter(":ExportFileName", OracleDbType.Varchar2, 500);
                oracleParameter5.Value = (object)model.ExportFileName;
                oracleParameter20      = oracleParameter5;
            }
            else
            {
                oracleParameter20       = new OracleParameter(":ExportFileName", OracleDbType.Varchar2, 500);
                oracleParameter20.Value = (object)DBNull.Value;
            }
            oracleParameterArray[index19] = oracleParameter20;
            int             index20 = 19;
            OracleParameter oracleParameter21;

            if (model.TableStyle != null)
            {
                OracleParameter oracleParameter5 = new OracleParameter(":TableStyle", OracleDbType.Varchar2, (int)byte.MaxValue);
                oracleParameter5.Value = (object)model.TableStyle;
                oracleParameter21      = oracleParameter5;
            }
            else
            {
                oracleParameter21       = new OracleParameter(":TableStyle", OracleDbType.Varchar2, (int)byte.MaxValue);
                oracleParameter21.Value = (object)DBNull.Value;
            }
            oracleParameterArray[index20] = oracleParameter21;
            int             index21 = 20;
            OracleParameter oracleParameter22;

            if (model.TableHead != null)
            {
                OracleParameter oracleParameter5 = new OracleParameter(":TableHead", OracleDbType.Varchar2, 4000);
                oracleParameter5.Value = (object)model.TableHead;
                oracleParameter22      = oracleParameter5;
            }
            else
            {
                oracleParameter22       = new OracleParameter(":TableHead", OracleDbType.Varchar2, 4000);
                oracleParameter22.Value = (object)DBNull.Value;
            }
            oracleParameterArray[index21] = oracleParameter22;
            int             index22 = 21;
            OracleParameter oracleParameter23;

            if (model.TableName != null)
            {
                OracleParameter oracleParameter5 = new OracleParameter(":TableName", OracleDbType.Varchar2, 500);
                oracleParameter5.Value = (object)model.TableName;
                oracleParameter23      = oracleParameter5;
            }
            else
            {
                oracleParameter23       = new OracleParameter(":TableName", OracleDbType.Varchar2, 500);
                oracleParameter23.Value = (object)DBNull.Value;
            }
            oracleParameterArray[index22] = oracleParameter23;
            int             index23 = 22;
            OracleParameter oracleParameter24;

            if (model.InDataNumberFiledName != null)
            {
                OracleParameter oracleParameter5 = new OracleParameter(":InDataNumberFiledName", OracleDbType.Varchar2, 500);
                oracleParameter5.Value = (object)model.InDataNumberFiledName;
                oracleParameter24      = oracleParameter5;
            }
            else
            {
                oracleParameter24       = new OracleParameter(":InDataNumberFiledName", OracleDbType.Varchar2, 500);
                oracleParameter24.Value = (object)DBNull.Value;
            }
            oracleParameterArray[index23] = oracleParameter24;
            int             index24           = 23;
            OracleParameter oracleParameter25 = new OracleParameter(":ID", OracleDbType.Varchar2);

            oracleParameter25.Value       = (object)model.ID;
            oracleParameterArray[index24] = oracleParameter25;
            OracleParameter[] parameter = oracleParameterArray;
            return(this.dbHelper.Execute(sql, parameter));
        }
Exemplo n.º 4
0
        public int Update(RoadFlow.Data.Model.ProgramBuilder model)
        {
            string sql = "UPDATE ProgramBuilder SET \r\n\t\t\t\tName=@Name,Type=@Type,CreateTime=@CreateTime,PublishTime=@PublishTime,CreateUser=@CreateUser,SQL=@SQL,IsAdd=@IsAdd,DBConnID=@DBConnID,Status=@Status,FormID=@FormID,EditModel=@EditModel,Width=@Width,Height=@Height,ButtonLocation=@ButtonLocation,IsPager=@IsPager,ClientScript=@ClientScript,ExportTemplate=@ExportTemplate,ExportHeaderText=@ExportHeaderText,ExportFileName=@ExportFileName,TableStyle=@TableStyle,TableHead=@TableHead,TableName=@TableName,InDataNumberFiledName=@InDataNumberFiledName    \r\n\t\t\t\tWHERE ID=@ID";

            SqlParameter[] sqlParameterArray = new SqlParameter[24];
            int            index1            = 0;
            SqlParameter   sqlParameter1     = new SqlParameter("@Name", SqlDbType.NVarChar, 1000);

            sqlParameter1.Value       = (object)model.Name;
            sqlParameterArray[index1] = sqlParameter1;
            int          index2        = 1;
            SqlParameter sqlParameter2 = new SqlParameter("@Type", SqlDbType.UniqueIdentifier, -1);

            sqlParameter2.Value       = (object)model.Type;
            sqlParameterArray[index2] = sqlParameter2;
            int          index3        = 2;
            SqlParameter sqlParameter3 = new SqlParameter("@CreateTime", SqlDbType.DateTime, 8);

            sqlParameter3.Value       = (object)model.CreateTime;
            sqlParameterArray[index3] = sqlParameter3;
            int          index4 = 3;
            SqlParameter sqlParameter4;

            if (model.PublishTime.HasValue)
            {
                SqlParameter sqlParameter5 = new SqlParameter("@PublishTime", SqlDbType.DateTime, 8);
                sqlParameter5.Value = (object)model.PublishTime;
                sqlParameter4       = sqlParameter5;
            }
            else
            {
                sqlParameter4       = new SqlParameter("@PublishTime", SqlDbType.DateTime, 8);
                sqlParameter4.Value = (object)DBNull.Value;
            }
            sqlParameterArray[index4] = sqlParameter4;
            int          index5        = 4;
            SqlParameter sqlParameter6 = new SqlParameter("@CreateUser", SqlDbType.UniqueIdentifier, -1);

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

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

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

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

            sqlParameter10.Value      = (object)model.Status;
            sqlParameterArray[index9] = sqlParameter10;
            int          index10 = 9;
            SqlParameter sqlParameter11;

            if (model.FormID != null)
            {
                SqlParameter sqlParameter5 = new SqlParameter("@FormID", SqlDbType.VarChar, 500);
                sqlParameter5.Value = (object)model.FormID;
                sqlParameter11      = sqlParameter5;
            }
            else
            {
                sqlParameter11       = new SqlParameter("@FormID", SqlDbType.VarChar, 500);
                sqlParameter11.Value = (object)DBNull.Value;
            }
            sqlParameterArray[index10] = sqlParameter11;
            int          index11  = 10;
            int?         nullable = model.EditModel;
            SqlParameter sqlParameter12;

            if (nullable.HasValue)
            {
                SqlParameter sqlParameter5 = new SqlParameter("@EditModel", SqlDbType.Int, -1);
                sqlParameter5.Value = (object)model.EditModel;
                sqlParameter12      = sqlParameter5;
            }
            else
            {
                sqlParameter12       = new SqlParameter("@EditModel", SqlDbType.Int, -1);
                sqlParameter12.Value = (object)DBNull.Value;
            }
            sqlParameterArray[index11] = sqlParameter12;
            int          index12 = 11;
            SqlParameter sqlParameter13;

            if (model.Width != null)
            {
                SqlParameter sqlParameter5 = new SqlParameter("@Width", SqlDbType.VarChar, 50);
                sqlParameter5.Value = (object)model.Width;
                sqlParameter13      = sqlParameter5;
            }
            else
            {
                sqlParameter13       = new SqlParameter("@Width", SqlDbType.VarChar, 50);
                sqlParameter13.Value = (object)DBNull.Value;
            }
            sqlParameterArray[index12] = sqlParameter13;
            int          index13 = 12;
            SqlParameter sqlParameter14;

            if (model.Height != null)
            {
                SqlParameter sqlParameter5 = new SqlParameter("@Height", SqlDbType.VarChar, 50);
                sqlParameter5.Value = (object)model.Height;
                sqlParameter14      = sqlParameter5;
            }
            else
            {
                sqlParameter14       = new SqlParameter("@Height", SqlDbType.VarChar, 50);
                sqlParameter14.Value = (object)DBNull.Value;
            }
            sqlParameterArray[index13] = sqlParameter14;
            int index14 = 13;

            nullable = model.ButtonLocation;
            SqlParameter sqlParameter15;

            if (nullable.HasValue)
            {
                SqlParameter sqlParameter5 = new SqlParameter("@ButtonLocation", SqlDbType.Int, -1);
                sqlParameter5.Value = (object)model.ButtonLocation;
                sqlParameter15      = sqlParameter5;
            }
            else
            {
                sqlParameter15       = new SqlParameter("@ButtonLocation", SqlDbType.Int, -1);
                sqlParameter15.Value = (object)DBNull.Value;
            }
            sqlParameterArray[index14] = sqlParameter15;
            int index15 = 14;

            nullable = model.IsPager;
            SqlParameter sqlParameter16;

            if (nullable.HasValue)
            {
                SqlParameter sqlParameter5 = new SqlParameter("@IsPager", SqlDbType.Int, -1);
                sqlParameter5.Value = (object)model.IsPager;
                sqlParameter16      = sqlParameter5;
            }
            else
            {
                sqlParameter16       = new SqlParameter("@IsPager", SqlDbType.Int, -1);
                sqlParameter16.Value = (object)DBNull.Value;
            }
            sqlParameterArray[index15] = sqlParameter16;
            int          index16 = 15;
            SqlParameter sqlParameter17;

            if (model.ClientScript != null)
            {
                SqlParameter sqlParameter5 = new SqlParameter("@ClientScript", SqlDbType.VarChar, -1);
                sqlParameter5.Value = (object)model.ClientScript;
                sqlParameter17      = sqlParameter5;
            }
            else
            {
                sqlParameter17       = new SqlParameter("@ClientScript", SqlDbType.VarChar, -1);
                sqlParameter17.Value = (object)DBNull.Value;
            }
            sqlParameterArray[index16] = sqlParameter17;
            int          index17 = 16;
            SqlParameter sqlParameter18;

            if (model.ExportTemplate != null)
            {
                SqlParameter sqlParameter5 = new SqlParameter("@ExportTemplate", SqlDbType.VarChar, 4000);
                sqlParameter5.Value = (object)model.ExportTemplate;
                sqlParameter18      = sqlParameter5;
            }
            else
            {
                sqlParameter18       = new SqlParameter("@ExportTemplate", SqlDbType.VarChar, 4000);
                sqlParameter18.Value = (object)DBNull.Value;
            }
            sqlParameterArray[index17] = sqlParameter18;
            int          index18 = 17;
            SqlParameter sqlParameter19;

            if (model.ExportHeaderText != null)
            {
                SqlParameter sqlParameter5 = new SqlParameter("@ExportHeaderText", SqlDbType.NVarChar, 1000);
                sqlParameter5.Value = (object)model.ExportHeaderText;
                sqlParameter19      = sqlParameter5;
            }
            else
            {
                sqlParameter19       = new SqlParameter("@ExportHeaderText", SqlDbType.NVarChar, 1000);
                sqlParameter19.Value = (object)DBNull.Value;
            }
            sqlParameterArray[index18] = sqlParameter19;
            int          index19 = 18;
            SqlParameter sqlParameter20;

            if (model.ExportFileName != null)
            {
                SqlParameter sqlParameter5 = new SqlParameter("@ExportFileName", SqlDbType.VarChar, 500);
                sqlParameter5.Value = (object)model.ExportFileName;
                sqlParameter20      = sqlParameter5;
            }
            else
            {
                sqlParameter20       = new SqlParameter("@ExportFileName", SqlDbType.VarChar, 500);
                sqlParameter20.Value = (object)DBNull.Value;
            }
            sqlParameterArray[index19] = sqlParameter20;
            int          index20 = 19;
            SqlParameter sqlParameter21;

            if (model.TableStyle != null)
            {
                SqlParameter sqlParameter5 = new SqlParameter("@TableStyle", SqlDbType.VarChar, (int)byte.MaxValue);
                sqlParameter5.Value = (object)model.TableStyle;
                sqlParameter21      = sqlParameter5;
            }
            else
            {
                sqlParameter21       = new SqlParameter("@TableStyle", SqlDbType.VarChar, (int)byte.MaxValue);
                sqlParameter21.Value = (object)DBNull.Value;
            }
            sqlParameterArray[index20] = sqlParameter21;
            int          index21 = 20;
            SqlParameter sqlParameter22;

            if (model.TableHead != null)
            {
                SqlParameter sqlParameter5 = new SqlParameter("@TableHead", SqlDbType.VarChar, -1);
                sqlParameter5.Value = (object)model.TableHead;
                sqlParameter22      = sqlParameter5;
            }
            else
            {
                sqlParameter22       = new SqlParameter("@TableHead", SqlDbType.VarChar, -1);
                sqlParameter22.Value = (object)DBNull.Value;
            }
            sqlParameterArray[index21] = sqlParameter22;
            int          index22 = 21;
            SqlParameter sqlParameter23;

            if (model.TableName != null)
            {
                SqlParameter sqlParameter5 = new SqlParameter("@TableName", SqlDbType.VarChar, 500);
                sqlParameter5.Value = (object)model.TableName;
                sqlParameter23      = sqlParameter5;
            }
            else
            {
                sqlParameter23       = new SqlParameter("@TableName", SqlDbType.VarChar, 500);
                sqlParameter23.Value = (object)DBNull.Value;
            }
            sqlParameterArray[index22] = sqlParameter23;
            int          index23 = 22;
            SqlParameter sqlParameter24;

            if (model.InDataNumberFiledName != null)
            {
                SqlParameter sqlParameter5 = new SqlParameter("@InDataNumberFiledName", SqlDbType.VarChar, 500);
                sqlParameter5.Value = (object)model.InDataNumberFiledName;
                sqlParameter24      = sqlParameter5;
            }
            else
            {
                sqlParameter24       = new SqlParameter("@InDataNumberFiledName", SqlDbType.VarChar, 500);
                sqlParameter24.Value = (object)DBNull.Value;
            }
            sqlParameterArray[index23] = sqlParameter24;
            int          index24        = 23;
            SqlParameter sqlParameter25 = new SqlParameter("@ID", SqlDbType.UniqueIdentifier, -1);

            sqlParameter25.Value       = (object)model.ID;
            sqlParameterArray[index24] = sqlParameter25;
            SqlParameter[] parameter = sqlParameterArray;
            return(this.dbHelper.Execute(sql, parameter, false));
        }
Exemplo n.º 5
0
        public int Add(RoadFlow.Data.Model.ProgramBuilder model)
        {
            string sql = "INSERT INTO programbuilder\r\n\t\t\t\t(ID,Name,Type,CreateTime,PublishTime,CreateUser,`SQL`,IsAdd,DBConnID,Status,FormID,EditModel,Width,Height,ButtonLocation,IsPager,ClientScript,ExportTemplate,ExportHeaderText,ExportFileName,TableStyle,TableHead,`TableName`,InDataNumberFiledName) \r\n\t\t\t\tVALUES(@ID,@Name,@Type,@CreateTime,@PublishTime,@CreateUser,@SQL,@IsAdd,@DBConnID,@Status,@FormID,@EditModel,@Width,@Height,@ButtonLocation,@IsPager,@ClientScript,@ExportTemplate,@ExportHeaderText,@ExportFileName,@TableStyle,@TableHead,@TableName,@InDataNumberFiledName)";

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

            mySqlParameter1.Value       = (object)model.ID;
            mySqlParameterArray[index1] = mySqlParameter1;
            int            index2          = 1;
            MySqlParameter mySqlParameter2 = new MySqlParameter("@Name", MySqlDbType.Text, -1);

            mySqlParameter2.Value       = (object)model.Name;
            mySqlParameterArray[index2] = mySqlParameter2;
            int            index3          = 2;
            MySqlParameter mySqlParameter3 = new MySqlParameter("@Type", MySqlDbType.VarChar, 36);

            mySqlParameter3.Value       = (object)model.Type;
            mySqlParameterArray[index3] = mySqlParameter3;
            int            index4          = 3;
            MySqlParameter mySqlParameter4 = new MySqlParameter("@CreateTime", MySqlDbType.DateTime, -1);

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

            if (model.PublishTime.HasValue)
            {
                MySqlParameter mySqlParameter6 = new MySqlParameter("@PublishTime", MySqlDbType.DateTime, -1);
                mySqlParameter6.Value = (object)model.PublishTime;
                mySqlParameter5       = mySqlParameter6;
            }
            else
            {
                mySqlParameter5       = new MySqlParameter("@PublishTime", MySqlDbType.DateTime, -1);
                mySqlParameter5.Value = (object)DBNull.Value;
            }
            mySqlParameterArray[index5] = mySqlParameter5;
            int            index6          = 5;
            MySqlParameter mySqlParameter7 = new MySqlParameter("@CreateUser", MySqlDbType.VarChar, 36);

            mySqlParameter7.Value       = (object)model.CreateUser;
            mySqlParameterArray[index6] = mySqlParameter7;
            int            index7          = 6;
            MySqlParameter mySqlParameter8 = new MySqlParameter("@SQL", MySqlDbType.LongText, -1);

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

            mySqlParameter9.Value       = (object)model.IsAdd;
            mySqlParameterArray[index8] = mySqlParameter9;
            int            index9           = 8;
            MySqlParameter mySqlParameter10 = new MySqlParameter("@DBConnID", MySqlDbType.VarChar, 36);

            mySqlParameter10.Value      = (object)model.DBConnID;
            mySqlParameterArray[index9] = mySqlParameter10;
            int            index10          = 9;
            MySqlParameter mySqlParameter11 = new MySqlParameter("@Status", MySqlDbType.Int32, 11);

            mySqlParameter11.Value       = (object)model.Status;
            mySqlParameterArray[index10] = mySqlParameter11;
            int            index11 = 10;
            MySqlParameter mySqlParameter12;

            if (model.FormID != null)
            {
                MySqlParameter mySqlParameter6 = new MySqlParameter("@FormID", MySqlDbType.Text, -1);
                mySqlParameter6.Value = (object)model.FormID;
                mySqlParameter12      = mySqlParameter6;
            }
            else
            {
                mySqlParameter12       = new MySqlParameter("@FormID", MySqlDbType.Text, -1);
                mySqlParameter12.Value = (object)DBNull.Value;
            }
            mySqlParameterArray[index11] = mySqlParameter12;
            int            index12  = 11;
            int?           nullable = model.EditModel;
            MySqlParameter mySqlParameter13;

            if (nullable.HasValue)
            {
                MySqlParameter mySqlParameter6 = new MySqlParameter("@EditModel", MySqlDbType.Int32, 11);
                mySqlParameter6.Value = (object)model.EditModel;
                mySqlParameter13      = mySqlParameter6;
            }
            else
            {
                mySqlParameter13       = new MySqlParameter("@EditModel", MySqlDbType.Int32, 11);
                mySqlParameter13.Value = (object)DBNull.Value;
            }
            mySqlParameterArray[index12] = mySqlParameter13;
            int            index13 = 12;
            MySqlParameter mySqlParameter14;

            if (model.Width != null)
            {
                MySqlParameter mySqlParameter6 = new MySqlParameter("@Width", MySqlDbType.VarChar, 50);
                mySqlParameter6.Value = (object)model.Width;
                mySqlParameter14      = mySqlParameter6;
            }
            else
            {
                mySqlParameter14       = new MySqlParameter("@Width", MySqlDbType.VarChar, 50);
                mySqlParameter14.Value = (object)DBNull.Value;
            }
            mySqlParameterArray[index13] = mySqlParameter14;
            int            index14 = 13;
            MySqlParameter mySqlParameter15;

            if (model.Height != null)
            {
                MySqlParameter mySqlParameter6 = new MySqlParameter("@Height", MySqlDbType.VarChar, 50);
                mySqlParameter6.Value = (object)model.Height;
                mySqlParameter15      = mySqlParameter6;
            }
            else
            {
                mySqlParameter15       = new MySqlParameter("@Height", MySqlDbType.VarChar, 50);
                mySqlParameter15.Value = (object)DBNull.Value;
            }
            mySqlParameterArray[index14] = mySqlParameter15;
            int index15 = 14;

            nullable = model.ButtonLocation;
            MySqlParameter mySqlParameter16;

            if (nullable.HasValue)
            {
                MySqlParameter mySqlParameter6 = new MySqlParameter("@ButtonLocation", MySqlDbType.Int32, 11);
                mySqlParameter6.Value = (object)model.ButtonLocation;
                mySqlParameter16      = mySqlParameter6;
            }
            else
            {
                mySqlParameter16       = new MySqlParameter("@ButtonLocation", MySqlDbType.Int32, 11);
                mySqlParameter16.Value = (object)DBNull.Value;
            }
            mySqlParameterArray[index15] = mySqlParameter16;
            int index16 = 15;

            nullable = model.IsPager;
            MySqlParameter mySqlParameter17;

            if (nullable.HasValue)
            {
                MySqlParameter mySqlParameter6 = new MySqlParameter("@IsPager", MySqlDbType.Int32, 11);
                mySqlParameter6.Value = (object)model.IsPager;
                mySqlParameter17      = mySqlParameter6;
            }
            else
            {
                mySqlParameter17       = new MySqlParameter("@IsPager", MySqlDbType.Int32, 11);
                mySqlParameter17.Value = (object)DBNull.Value;
            }
            mySqlParameterArray[index16] = mySqlParameter17;
            int            index17 = 16;
            MySqlParameter mySqlParameter18;

            if (model.ClientScript != null)
            {
                MySqlParameter mySqlParameter6 = new MySqlParameter("@ClientScript", MySqlDbType.LongText, -1);
                mySqlParameter6.Value = (object)model.ClientScript;
                mySqlParameter18      = mySqlParameter6;
            }
            else
            {
                mySqlParameter18       = new MySqlParameter("@ClientScript", MySqlDbType.LongText, -1);
                mySqlParameter18.Value = (object)DBNull.Value;
            }
            mySqlParameterArray[index17] = mySqlParameter18;
            int            index18 = 17;
            MySqlParameter mySqlParameter19;

            if (model.ExportTemplate != null)
            {
                MySqlParameter mySqlParameter6 = new MySqlParameter("@ExportTemplate", MySqlDbType.Text, -1);
                mySqlParameter6.Value = (object)model.ExportTemplate;
                mySqlParameter19      = mySqlParameter6;
            }
            else
            {
                mySqlParameter19       = new MySqlParameter("@ExportTemplate", MySqlDbType.Text, -1);
                mySqlParameter19.Value = (object)DBNull.Value;
            }
            mySqlParameterArray[index18] = mySqlParameter19;
            int            index19 = 18;
            MySqlParameter mySqlParameter20;

            if (model.ExportHeaderText != null)
            {
                MySqlParameter mySqlParameter6 = new MySqlParameter("@ExportHeaderText", MySqlDbType.Text, -1);
                mySqlParameter6.Value = (object)model.ExportHeaderText;
                mySqlParameter20      = mySqlParameter6;
            }
            else
            {
                mySqlParameter20       = new MySqlParameter("@ExportHeaderText", MySqlDbType.Text, -1);
                mySqlParameter20.Value = (object)DBNull.Value;
            }
            mySqlParameterArray[index19] = mySqlParameter20;
            int            index20 = 19;
            MySqlParameter mySqlParameter21;

            if (model.ExportFileName != null)
            {
                MySqlParameter mySqlParameter6 = new MySqlParameter("@ExportFileName", MySqlDbType.Text, -1);
                mySqlParameter6.Value = (object)model.ExportFileName;
                mySqlParameter21      = mySqlParameter6;
            }
            else
            {
                mySqlParameter21       = new MySqlParameter("@ExportFileName", MySqlDbType.Text, -1);
                mySqlParameter21.Value = (object)DBNull.Value;
            }
            mySqlParameterArray[index20] = mySqlParameter21;
            int            index21 = 20;
            MySqlParameter mySqlParameter22;

            if (model.TableStyle != null)
            {
                MySqlParameter mySqlParameter6 = new MySqlParameter("@TableStyle", MySqlDbType.VarChar, (int)byte.MaxValue);
                mySqlParameter6.Value = (object)model.TableStyle;
                mySqlParameter22      = mySqlParameter6;
            }
            else
            {
                mySqlParameter22       = new MySqlParameter("@TableStyle", MySqlDbType.VarChar, (int)byte.MaxValue);
                mySqlParameter22.Value = (object)DBNull.Value;
            }
            mySqlParameterArray[index21] = mySqlParameter22;
            int            index22 = 21;
            MySqlParameter mySqlParameter23;

            if (model.TableHead != null)
            {
                MySqlParameter mySqlParameter6 = new MySqlParameter("@TableHead", MySqlDbType.Text, -1);
                mySqlParameter6.Value = (object)model.TableHead;
                mySqlParameter23      = mySqlParameter6;
            }
            else
            {
                mySqlParameter23       = new MySqlParameter("@TableHead", MySqlDbType.Text, -1);
                mySqlParameter23.Value = (object)DBNull.Value;
            }
            mySqlParameterArray[index22] = mySqlParameter23;
            int            index23 = 22;
            MySqlParameter mySqlParameter24;

            if (model.TableName != null)
            {
                MySqlParameter mySqlParameter6 = new MySqlParameter("@TableName", MySqlDbType.VarChar, (int)byte.MaxValue);
                mySqlParameter6.Value = (object)model.TableName;
                mySqlParameter24      = mySqlParameter6;
            }
            else
            {
                mySqlParameter24       = new MySqlParameter("@TableName", MySqlDbType.VarChar, (int)byte.MaxValue);
                mySqlParameter24.Value = (object)DBNull.Value;
            }
            mySqlParameterArray[index23] = mySqlParameter24;
            int            index24 = 23;
            MySqlParameter mySqlParameter25;

            if (model.InDataNumberFiledName != null)
            {
                MySqlParameter mySqlParameter6 = new MySqlParameter("@InDataNumberFiledName", MySqlDbType.VarChar, (int)byte.MaxValue);
                mySqlParameter6.Value = (object)model.InDataNumberFiledName;
                mySqlParameter25      = mySqlParameter6;
            }
            else
            {
                mySqlParameter25       = new MySqlParameter("@InDataNumberFiledName", MySqlDbType.VarChar, (int)byte.MaxValue);
                mySqlParameter25.Value = (object)DBNull.Value;
            }
            mySqlParameterArray[index24] = mySqlParameter25;
            MySqlParameter[] parameter = mySqlParameterArray;
            return(this.dbHelper.Execute(sql, parameter, false));
        }