Beispiel #1
0
        public int Update(RoadFlow.Data.Model.ProgramBuilderValidates model)
        {
            string sql = "UPDATE programbuildervalidates SET \r\n\t\t\t\tProgramID=@ProgramID,TableName=@TableName,FieldName=@FieldName,FieldNote=@FieldNote,Validate=@Validate\r\n\t\t\t\tWHERE ID=@ID";

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

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

            mySqlParameter2.Value       = (object)model.TableName;
            mySqlParameterArray[index2] = mySqlParameter2;
            int            index3          = 2;
            MySqlParameter mySqlParameter3 = new MySqlParameter("@FieldName", MySqlDbType.Text, -1);

            mySqlParameter3.Value       = (object)model.FieldName;
            mySqlParameterArray[index3] = mySqlParameter3;
            int            index4 = 3;
            MySqlParameter mySqlParameter4;

            if (model.FieldNote != null)
            {
                MySqlParameter mySqlParameter5 = new MySqlParameter("@FieldNote", MySqlDbType.Text, -1);
                mySqlParameter5.Value = (object)model.FieldNote;
                mySqlParameter4       = mySqlParameter5;
            }
            else
            {
                mySqlParameter4       = new MySqlParameter("@FieldNote", MySqlDbType.Text, -1);
                mySqlParameter4.Value = (object)DBNull.Value;
            }
            mySqlParameterArray[index4] = mySqlParameter4;
            int            index5          = 4;
            MySqlParameter mySqlParameter6 = new MySqlParameter("@Validate", MySqlDbType.Int32, 11);

            mySqlParameter6.Value       = (object)model.Validate;
            mySqlParameterArray[index5] = mySqlParameter6;
            int            index6          = 5;
            MySqlParameter mySqlParameter7 = new MySqlParameter("@ID", MySqlDbType.VarChar, 36);

            mySqlParameter7.Value       = (object)model.ID;
            mySqlParameterArray[index6] = mySqlParameter7;
            MySqlParameter[] parameter = mySqlParameterArray;
            return(this.dbHelper.Execute(sql, parameter, false));
        }
        public int Update(RoadFlow.Data.Model.ProgramBuilderValidates model)
        {
            string sql = "UPDATE ProgramBuilderValidates SET \r\n\t\t\t\tProgramID=:ProgramID,TableName=:TableName,FieldName=:FieldName,FieldNote=:FieldNote,Validate1=:Validate1\r\n\t\t\t\tWHERE ID=:ID";

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

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

            oracleParameter2.Value       = (object)model.TableName;
            oracleParameterArray[index2] = oracleParameter2;
            int             index3           = 2;
            OracleParameter oracleParameter3 = new OracleParameter(":FieldName", OracleDbType.Varchar2);

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

            if (model.FieldNote != null)
            {
                OracleParameter oracleParameter5 = new OracleParameter(":FieldNote", OracleDbType.Varchar2);
                oracleParameter5.Value = (object)model.FieldNote;
                oracleParameter4       = oracleParameter5;
            }
            else
            {
                oracleParameter4       = new OracleParameter(":FieldNote", OracleDbType.Varchar2);
                oracleParameter4.Value = (object)DBNull.Value;
            }
            oracleParameterArray[index4] = oracleParameter4;
            int             index5           = 4;
            OracleParameter oracleParameter6 = new OracleParameter(":Validate1", OracleDbType.Int32);

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

            oracleParameter7.Value       = (object)model.ID;
            oracleParameterArray[index6] = oracleParameter7;
            OracleParameter[] parameter = oracleParameterArray;
            return(this.dbHelper.Execute(sql, parameter));
        }
        public int Update(RoadFlow.Data.Model.ProgramBuilderValidates model)
        {
            string sql = "UPDATE ProgramBuilderValidates SET \r\n\t\t\t\tProgramID=@ProgramID,TableName=@TableName,FieldName=@FieldName,FieldNote=@FieldNote,Validate=@Validate\r\n\t\t\t\tWHERE ID=@ID";

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

            sqlParameter1.Value       = (object)model.ProgramID;
            sqlParameterArray[index1] = sqlParameter1;
            int          index2        = 1;
            SqlParameter sqlParameter2 = new SqlParameter("@TableName", SqlDbType.VarChar, 500);

            sqlParameter2.Value       = (object)model.TableName;
            sqlParameterArray[index2] = sqlParameter2;
            int          index3        = 2;
            SqlParameter sqlParameter3 = new SqlParameter("@FieldName", SqlDbType.VarChar, 500);

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

            if (model.FieldNote != null)
            {
                SqlParameter sqlParameter5 = new SqlParameter("@FieldNote", SqlDbType.NVarChar, 1000);
                sqlParameter5.Value = (object)model.FieldNote;
                sqlParameter4       = sqlParameter5;
            }
            else
            {
                sqlParameter4       = new SqlParameter("@FieldNote", SqlDbType.NVarChar, 1000);
                sqlParameter4.Value = (object)DBNull.Value;
            }
            sqlParameterArray[index4] = sqlParameter4;
            int          index5        = 4;
            SqlParameter sqlParameter6 = new SqlParameter("@Validate", SqlDbType.Int, -1);

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

            sqlParameter7.Value       = (object)model.ID;
            sqlParameterArray[index6] = sqlParameter7;
            SqlParameter[] parameter = sqlParameterArray;
            return(this.dbHelper.Execute(sql, parameter, false));
        }
Beispiel #4
0
        private List <RoadFlow.Data.Model.ProgramBuilderValidates> DataReaderToList(MySqlDataReader dataReader)
        {
            List <RoadFlow.Data.Model.ProgramBuilderValidates> builderValidatesList = new List <RoadFlow.Data.Model.ProgramBuilderValidates>();

            while (dataReader.Read())
            {
                RoadFlow.Data.Model.ProgramBuilderValidates builderValidates = new RoadFlow.Data.Model.ProgramBuilderValidates();
                builderValidates.ID        = dataReader.GetString(0).ToGuid();
                builderValidates.ProgramID = dataReader.GetString(1).ToGuid();
                builderValidates.TableName = dataReader.GetString(2);
                builderValidates.FieldName = dataReader.GetString(3);
                if (!dataReader.IsDBNull(4))
                {
                    builderValidates.FieldNote = dataReader.GetString(4);
                }
                builderValidates.Validate = dataReader.GetInt32(5);
                builderValidatesList.Add(builderValidates);
            }
            return(builderValidatesList);
        }
Beispiel #5
0
 public int Update(RoadFlow.Data.Model.ProgramBuilderValidates model)
 {
     return(this.dataProgramBuilderValidates.Update(model));
 }