Пример #1
0
        private List <RoadFlow.Data.Model.SMSLog> DataReaderToList(OracleDataReader dataReader)
        {
            List <RoadFlow.Data.Model.SMSLog> smsLogList = new List <RoadFlow.Data.Model.SMSLog>();

            while (dataReader.Read())
            {
                RoadFlow.Data.Model.SMSLog smsLog = new RoadFlow.Data.Model.SMSLog();
                smsLog.ID           = dataReader.GetGuid(0);
                smsLog.MobileNumber = dataReader.GetString(1);
                smsLog.Contents     = dataReader.GetString(2);
                if (!dataReader.IsDBNull(3))
                {
                    smsLog.SendUserID = new Guid?(dataReader.GetGuid(3));
                }
                if (!dataReader.IsDBNull(4))
                {
                    smsLog.SendUserName = dataReader.GetString(4);
                }
                smsLog.SendTime = dataReader.GetDateTime(5);
                smsLog.Status   = dataReader.GetInt32(6);
                smsLog.Note     = dataReader.GetString(7);
                smsLogList.Add(smsLog);
            }
            return(smsLogList);
        }
Пример #2
0
        public int Update(RoadFlow.Data.Model.SMSLog model)
        {
            string sql = "UPDATE SMSLog SET \r\n\t\t\t\tMobileNumber=:MobileNumber,Contents=:Contents,SendUserID=:SendUserID,SendUserName=:SendUserName,SendTime=:SendTime,Status=:Status,Note=:Note\r\n\t\t\t\tWHERE ID=:ID";

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

            oracleParameter1.Value       = (object)model.MobileNumber;
            oracleParameterArray[index1] = oracleParameter1;
            int             index2           = 1;
            OracleParameter oracleParameter2 = new OracleParameter(":Contents", OracleDbType.NVarchar2);

            oracleParameter2.Value       = (object)model.Contents;
            oracleParameterArray[index2] = oracleParameter2;
            int             index3 = 2;
            OracleParameter oracleParameter3;

            if (model.SendUserID.HasValue)
            {
                OracleParameter oracleParameter4 = new OracleParameter(":SendUserID", OracleDbType.Varchar2);
                oracleParameter4.Value = (object)model.SendUserID;
                oracleParameter3       = oracleParameter4;
            }
            else
            {
                oracleParameter3       = new OracleParameter(":SendUserID", OracleDbType.Varchar2);
                oracleParameter3.Value = (object)DBNull.Value;
            }
            oracleParameterArray[index3] = oracleParameter3;
            int             index4 = 3;
            OracleParameter oracleParameter5;

            if (model.SendUserName != null)
            {
                OracleParameter oracleParameter4 = new OracleParameter(":SendUserName", OracleDbType.NVarchar2);
                oracleParameter4.Value = (object)model.SendUserName;
                oracleParameter5       = oracleParameter4;
            }
            else
            {
                oracleParameter5       = new OracleParameter(":SendUserName", OracleDbType.NVarchar2);
                oracleParameter5.Value = (object)DBNull.Value;
            }
            oracleParameterArray[index4] = oracleParameter5;
            int             index5           = 4;
            OracleParameter oracleParameter6 = new OracleParameter(":SendTime", OracleDbType.Date);

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

            oracleParameter7.Value       = (object)model.Status;
            oracleParameterArray[index6] = oracleParameter7;
            int             index7           = 6;
            OracleParameter oracleParameter8 = new OracleParameter(":Note", OracleDbType.Varchar2);

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

            oracleParameter9.Value       = (object)model.ID;
            oracleParameterArray[index8] = oracleParameter9;
            OracleParameter[] parameter = oracleParameterArray;
            return(this.dbHelper.Execute(sql, parameter));
        }
Пример #3
0
 public static void AddSync(RoadFlow.Data.Model.SMSLog model)
 {
     new SMSLog.dgWriteLog(SMSLog.add).BeginInvoke(model, (AsyncCallback)null, (object)null);
 }
Пример #4
0
 private static void add(RoadFlow.Data.Model.SMSLog model)
 {
     SMSLog.dataSMSLog.Add(model);
 }
Пример #5
0
 public int Update(RoadFlow.Data.Model.SMSLog model)
 {
     return(SMSLog.dataSMSLog.Update(model));
 }
Пример #6
0
 public int Add(RoadFlow.Data.Model.SMSLog model)
 {
     return(SMSLog.dataSMSLog.Add(model));
 }
Пример #7
0
        public int Update(RoadFlow.Data.Model.SMSLog model)
        {
            string sql = "UPDATE SMSLog SET \r\n\t\t\t\tMobileNumber=@MobileNumber,Contents=@Contents,SendUserID=@SendUserID,SendUserName=@SendUserName,SendTime=@SendTime,Status=@Status,Note=@Note\r\n\t\t\t\tWHERE ID=@ID";

            SqlParameter[] sqlParameterArray = new SqlParameter[8];
            int            index1            = 0;
            SqlParameter   sqlParameter1     = new SqlParameter("@MobileNumber", SqlDbType.VarChar, -1);

            sqlParameter1.Value       = (object)model.MobileNumber;
            sqlParameterArray[index1] = sqlParameter1;
            int          index2        = 1;
            SqlParameter sqlParameter2 = new SqlParameter("@Contents", SqlDbType.NVarChar, 400);

            sqlParameter2.Value       = (object)model.Contents;
            sqlParameterArray[index2] = sqlParameter2;
            int          index3 = 2;
            SqlParameter sqlParameter3;

            if (model.SendUserID.HasValue)
            {
                SqlParameter sqlParameter4 = new SqlParameter("@SendUserID", SqlDbType.UniqueIdentifier, -1);
                sqlParameter4.Value = (object)model.SendUserID;
                sqlParameter3       = sqlParameter4;
            }
            else
            {
                sqlParameter3       = new SqlParameter("@SendUserID", SqlDbType.UniqueIdentifier, -1);
                sqlParameter3.Value = (object)DBNull.Value;
            }
            sqlParameterArray[index3] = sqlParameter3;
            int          index4 = 3;
            SqlParameter sqlParameter5;

            if (model.SendUserName != null)
            {
                SqlParameter sqlParameter4 = new SqlParameter("@SendUserName", SqlDbType.NVarChar, 1000);
                sqlParameter4.Value = (object)model.SendUserName;
                sqlParameter5       = sqlParameter4;
            }
            else
            {
                sqlParameter5       = new SqlParameter("@SendUserName", SqlDbType.NVarChar, 1000);
                sqlParameter5.Value = (object)DBNull.Value;
            }
            sqlParameterArray[index4] = sqlParameter5;
            int          index5        = 4;
            SqlParameter sqlParameter6 = new SqlParameter("@SendTime", SqlDbType.DateTime, 8);

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

            sqlParameter7.Value       = (object)model.Status;
            sqlParameterArray[index6] = sqlParameter7;
            int          index7 = 6;
            SqlParameter sqlParameter8;

            if (model.Note != null)
            {
                SqlParameter sqlParameter4 = new SqlParameter("@Note", SqlDbType.VarChar, -1);
                sqlParameter4.Value = (object)model.Note;
                sqlParameter8       = sqlParameter4;
            }
            else
            {
                sqlParameter8       = new SqlParameter("@Note", SqlDbType.VarChar, -1);
                sqlParameter8.Value = (object)DBNull.Value;
            }
            sqlParameterArray[index7] = sqlParameter8;
            int          index8        = 7;
            SqlParameter sqlParameter9 = new SqlParameter("@ID", SqlDbType.UniqueIdentifier, -1);

            sqlParameter9.Value       = (object)model.ID;
            sqlParameterArray[index8] = sqlParameter9;
            SqlParameter[] parameter = sqlParameterArray;
            return(this.dbHelper.Execute(sql, parameter, false));
        }
Пример #8
0
        public int Update(RoadFlow.Data.Model.SMSLog model)
        {
            string sql = "UPDATE smslog SET \r\n\t\t\t\tMobileNumber=@MobileNumber,Contents=@Contents,SendUserID=@SendUserID,SendUserName=@SendUserName,SendTime=@SendTime,Status=@Status,Note=@Note\r\n\t\t\t\tWHERE ID=@ID";

            MySqlParameter[] mySqlParameterArray = new MySqlParameter[8];
            int            index1          = 0;
            MySqlParameter mySqlParameter1 = new MySqlParameter("@MobileNumber", MySqlDbType.LongText, -1);

            mySqlParameter1.Value       = (object)model.MobileNumber;
            mySqlParameterArray[index1] = mySqlParameter1;
            int            index2          = 1;
            MySqlParameter mySqlParameter2 = new MySqlParameter("@Contents", MySqlDbType.VarChar, 200);

            mySqlParameter2.Value       = (object)model.Contents;
            mySqlParameterArray[index2] = mySqlParameter2;
            int            index3 = 2;
            MySqlParameter mySqlParameter3;

            if (model.SendUserID.HasValue)
            {
                MySqlParameter mySqlParameter4 = new MySqlParameter("@SendUserID", MySqlDbType.VarChar, 36);
                mySqlParameter4.Value = (object)model.SendUserID;
                mySqlParameter3       = mySqlParameter4;
            }
            else
            {
                mySqlParameter3       = new MySqlParameter("@SendUserID", MySqlDbType.VarChar, 36);
                mySqlParameter3.Value = (object)DBNull.Value;
            }
            mySqlParameterArray[index3] = mySqlParameter3;
            int            index4 = 3;
            MySqlParameter mySqlParameter5;

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

            mySqlParameter6.Value       = (object)model.SendTime;
            mySqlParameterArray[index5] = mySqlParameter6;
            int            index6          = 5;
            MySqlParameter mySqlParameter7 = new MySqlParameter("@Status", MySqlDbType.Int32, 11);

            mySqlParameter7.Value       = (object)model.Status;
            mySqlParameterArray[index6] = mySqlParameter7;
            int            index7 = 6;
            MySqlParameter mySqlParameter8;

            if (model.Note != null)
            {
                MySqlParameter mySqlParameter4 = new MySqlParameter("@Note", MySqlDbType.LongText, -1);
                mySqlParameter4.Value = (object)model.Note;
                mySqlParameter8       = mySqlParameter4;
            }
            else
            {
                mySqlParameter8       = new MySqlParameter("@Note", MySqlDbType.LongText, -1);
                mySqlParameter8.Value = (object)DBNull.Value;
            }
            mySqlParameterArray[index7] = mySqlParameter8;
            int            index8          = 7;
            MySqlParameter mySqlParameter9 = new MySqlParameter("@ID", MySqlDbType.VarChar, 36);

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