Esempio n. 1
0
 public int Update(RoadFlow.Data.Model.WeiXinMessage model)
 {
     return(this.dataWeiXinMessage.Update(model));
 }
Esempio n. 2
0
        public void Receive(string xml)
        {
            XElement root = XDocument.Parse(xml).Root;
            string   str1 = root.Element((XName)"ToUserName").Value;
            string   str2 = root.Element((XName)"FromUserName").Value;
            string   str3 = root.Element((XName)"CreateTime").Value;
            string   str4 = root.Element((XName)"MsgType").Value;
            string   str5 = root.Element((XName)"MsgId").Value;
            string   str6 = root.Element((XName)"AgentID").Value;

            RoadFlow.Platform.WeiXinMessage   weiXinMessage = new RoadFlow.Platform.WeiXinMessage();
            RoadFlow.Data.Model.WeiXinMessage model         = new RoadFlow.Data.Model.WeiXinMessage()
            {
                ID = Guid.NewGuid(), AddTime = DateTimeNew.Now, AgentID = str6.ToInt(), CreateTime = str3.ToInt()
            };
            model.CreateTime1  = Tools.JavaLongToDateTime(model.CreateTime);
            model.MsgType      = str4;
            model.MsgId        = str5.ToLong();
            model.ToUserName   = str1;
            model.FromUserName = str2;
            switch (str4)
            {
            case "image":
                model.PicUrl  = root.Element((XName)"PicUrl").Value;
                model.MediaId = root.Element((XName)"MediaId").Value;
                break;

            case "link":
                model.Title       = root.Element((XName)"Title").Value;
                model.Description = root.Element((XName)"Description").Value;
                model.PicUrl      = root.Element((XName)"PicUrl").Value;
                break;

            case "location":
                model.Location_X = root.Element((XName)"Location_X").Value;
                model.Location_Y = root.Element((XName)"Location_Y").Value;
                model.Scale      = root.Element((XName)"Scale").Value;
                model.Label      = root.Element((XName)"Label").Value;
                break;

            case "shortvideo":
                model.ThumbMediaId = root.Element((XName)"ThumbMediaId").Value;
                model.MediaId      = root.Element((XName)"MediaId").Value;
                break;

            case "text":
                model.Contents = root.Element((XName)"Content").Value;
                break;

            case "video":
                model.ThumbMediaId = root.Element((XName)"ThumbMediaId").Value;
                model.MediaId      = root.Element((XName)"MediaId").Value;
                break;

            case "voice":
                model.Format  = root.Element((XName)"Format").Value;
                model.MediaId = root.Element((XName)"MediaId").Value;
                break;
            }
            weiXinMessage.Add(model);
        }
Esempio n. 3
0
 public int Add(RoadFlow.Data.Model.WeiXinMessage model)
 {
     return(this.dataWeiXinMessage.Add(model));
 }
Esempio n. 4
0
        private List <RoadFlow.Data.Model.WeiXinMessage> DataReaderToList(SqlDataReader dataReader)
        {
            List <RoadFlow.Data.Model.WeiXinMessage> weiXinMessageList = new List <RoadFlow.Data.Model.WeiXinMessage>();

            while (dataReader.Read())
            {
                RoadFlow.Data.Model.WeiXinMessage weiXinMessage = new RoadFlow.Data.Model.WeiXinMessage();
                weiXinMessage.ID          = dataReader.GetGuid(0);
                weiXinMessage.ToUserName  = dataReader.GetString(1);
                weiXinMessage.CreateTime  = dataReader.GetInt32(3);
                weiXinMessage.CreateTime1 = dataReader.GetDateTime(4);
                weiXinMessage.MsgType     = dataReader.GetString(5);
                weiXinMessage.MsgId       = dataReader.GetInt64(6);
                weiXinMessage.AgentID     = dataReader.GetInt32(7);
                if (!dataReader.IsDBNull(8))
                {
                    weiXinMessage.Contents = dataReader.GetString(8);
                }
                if (!dataReader.IsDBNull(9))
                {
                    weiXinMessage.PicUrl = dataReader.GetString(9);
                }
                if (!dataReader.IsDBNull(10))
                {
                    weiXinMessage.MediaId = dataReader.GetString(10);
                }
                if (!dataReader.IsDBNull(11))
                {
                    weiXinMessage.Format = dataReader.GetString(11);
                }
                if (!dataReader.IsDBNull(12))
                {
                    weiXinMessage.ThumbMediaId = dataReader.GetString(12);
                }
                if (!dataReader.IsDBNull(13))
                {
                    weiXinMessage.Location_X = dataReader.GetString(13);
                }
                if (!dataReader.IsDBNull(14))
                {
                    weiXinMessage.Location_Y = dataReader.GetString(14);
                }
                if (!dataReader.IsDBNull(15))
                {
                    weiXinMessage.Scale = dataReader.GetString(15);
                }
                if (!dataReader.IsDBNull(16))
                {
                    weiXinMessage.Label = dataReader.GetString(16);
                }
                if (!dataReader.IsDBNull(17))
                {
                    weiXinMessage.Title = dataReader.GetString(17);
                }
                if (!dataReader.IsDBNull(18))
                {
                    weiXinMessage.Description = dataReader.GetString(18);
                }
                weiXinMessage.AddTime = dataReader.GetDateTime(19);
                weiXinMessageList.Add(weiXinMessage);
            }
            return(weiXinMessageList);
        }
Esempio n. 5
0
        public int Update(RoadFlow.Data.Model.WeiXinMessage model)
        {
            string sql = "UPDATE WeiXinMessage SET \r\n\t\t\t\tToUserName=@ToUserName,FromUserName=@FromUserName,CreateTime=@CreateTime,CreateTime1=@CreateTime1,MsgType=@MsgType,MsgId=@MsgId,AgentID=@AgentID,Contents=@Contents,PicUrl=@PicUrl,MediaId=@MediaId,Format=@Format,ThumbMediaId=@ThumbMediaId,Location_X=@Location_X,Location_Y=@Location_Y,Scale=@Scale,Label=@Label,Title=@Title,Description=@Description,AddTime=@AddTime\r\n\t\t\t\tWHERE ID=@ID";

            SqlParameter[] sqlParameterArray = new SqlParameter[20];
            int            index1            = 0;
            SqlParameter   sqlParameter1     = new SqlParameter("@ToUserName", SqlDbType.VarChar, 200);

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

            sqlParameter2.Value       = (object)model.FromUserName;
            sqlParameterArray[index2] = sqlParameter2;
            int          index3        = 2;
            SqlParameter sqlParameter3 = new SqlParameter("@CreateTime", SqlDbType.Int, -1);

            sqlParameter3.Value       = (object)model.CreateTime;
            sqlParameterArray[index3] = sqlParameter3;
            int          index4        = 3;
            SqlParameter sqlParameter4 = new SqlParameter("@CreateTime1", SqlDbType.DateTime, 8);

            sqlParameter4.Value       = (object)model.CreateTime1;
            sqlParameterArray[index4] = sqlParameter4;
            int          index5        = 4;
            SqlParameter sqlParameter5 = new SqlParameter("@MsgType", SqlDbType.VarChar, 50);

            sqlParameter5.Value       = (object)model.MsgType;
            sqlParameterArray[index5] = sqlParameter5;
            int          index6        = 5;
            SqlParameter sqlParameter6 = new SqlParameter("@MsgId", SqlDbType.BigInt, -1);

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

            sqlParameter7.Value       = (object)model.AgentID;
            sqlParameterArray[index7] = sqlParameter7;
            int          index8 = 7;
            SqlParameter sqlParameter8;

            if (model.Contents != null)
            {
                SqlParameter sqlParameter9 = new SqlParameter("@Contents", SqlDbType.NVarChar, -1);
                sqlParameter9.Value = (object)model.Contents;
                sqlParameter8       = sqlParameter9;
            }
            else
            {
                sqlParameter8       = new SqlParameter("@Contents", SqlDbType.NVarChar, -1);
                sqlParameter8.Value = (object)DBNull.Value;
            }
            sqlParameterArray[index8] = sqlParameter8;
            int          index9 = 8;
            SqlParameter sqlParameter10;

            if (model.PicUrl != null)
            {
                SqlParameter sqlParameter9 = new SqlParameter("@PicUrl", SqlDbType.VarChar, 500);
                sqlParameter9.Value = (object)model.PicUrl;
                sqlParameter10      = sqlParameter9;
            }
            else
            {
                sqlParameter10       = new SqlParameter("@PicUrl", SqlDbType.VarChar, 500);
                sqlParameter10.Value = (object)DBNull.Value;
            }
            sqlParameterArray[index9] = sqlParameter10;
            int          index10 = 9;
            SqlParameter sqlParameter11;

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

            if (model.Format != null)
            {
                SqlParameter sqlParameter9 = new SqlParameter("@Format", SqlDbType.VarChar, 50);
                sqlParameter9.Value = (object)model.Format;
                sqlParameter12      = sqlParameter9;
            }
            else
            {
                sqlParameter12       = new SqlParameter("@Format", SqlDbType.VarChar, 50);
                sqlParameter12.Value = (object)DBNull.Value;
            }
            sqlParameterArray[index11] = sqlParameter12;
            int          index12 = 11;
            SqlParameter sqlParameter13;

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

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

            if (model.Location_Y != null)
            {
                SqlParameter sqlParameter9 = new SqlParameter("@Location_Y", SqlDbType.VarChar, 50);
                sqlParameter9.Value = (object)model.Location_Y;
                sqlParameter15      = sqlParameter9;
            }
            else
            {
                sqlParameter15       = new SqlParameter("@Location_Y", SqlDbType.VarChar, 50);
                sqlParameter15.Value = (object)DBNull.Value;
            }
            sqlParameterArray[index14] = sqlParameter15;
            int          index15 = 14;
            SqlParameter sqlParameter16;

            if (model.Scale != null)
            {
                SqlParameter sqlParameter9 = new SqlParameter("@Scale", SqlDbType.VarChar, 50);
                sqlParameter9.Value = (object)model.Scale;
                sqlParameter16      = sqlParameter9;
            }
            else
            {
                sqlParameter16       = new SqlParameter("@Scale", SqlDbType.VarChar, 50);
                sqlParameter16.Value = (object)DBNull.Value;
            }
            sqlParameterArray[index15] = sqlParameter16;
            int          index16 = 15;
            SqlParameter sqlParameter17;

            if (model.Label != null)
            {
                SqlParameter sqlParameter9 = new SqlParameter("@Label", SqlDbType.NVarChar, 1000);
                sqlParameter9.Value = (object)model.Label;
                sqlParameter17      = sqlParameter9;
            }
            else
            {
                sqlParameter17       = new SqlParameter("@Label", SqlDbType.NVarChar, 1000);
                sqlParameter17.Value = (object)DBNull.Value;
            }
            sqlParameterArray[index16] = sqlParameter17;
            int          index17 = 16;
            SqlParameter sqlParameter18;

            if (model.Title != null)
            {
                SqlParameter sqlParameter9 = new SqlParameter("@Title", SqlDbType.NVarChar, 1000);
                sqlParameter9.Value = (object)model.Title;
                sqlParameter18      = sqlParameter9;
            }
            else
            {
                sqlParameter18       = new SqlParameter("@Title", SqlDbType.NVarChar, 1000);
                sqlParameter18.Value = (object)DBNull.Value;
            }
            sqlParameterArray[index17] = sqlParameter18;
            int          index18 = 17;
            SqlParameter sqlParameter19;

            if (model.Description != null)
            {
                SqlParameter sqlParameter9 = new SqlParameter("@Description", SqlDbType.NVarChar, 2000);
                sqlParameter9.Value = (object)model.Description;
                sqlParameter19      = sqlParameter9;
            }
            else
            {
                sqlParameter19       = new SqlParameter("@Description", SqlDbType.NVarChar, 2000);
                sqlParameter19.Value = (object)DBNull.Value;
            }
            sqlParameterArray[index18] = sqlParameter19;
            int          index19        = 18;
            SqlParameter sqlParameter20 = new SqlParameter("@AddTime", SqlDbType.DateTime, 8);

            sqlParameter20.Value       = (object)model.AddTime;
            sqlParameterArray[index19] = sqlParameter20;
            int          index20        = 19;
            SqlParameter sqlParameter21 = new SqlParameter("@ID", SqlDbType.UniqueIdentifier, -1);

            sqlParameter21.Value       = (object)model.ID;
            sqlParameterArray[index20] = sqlParameter21;
            SqlParameter[] parameter = sqlParameterArray;
            return(this.dbHelper.Execute(sql, parameter, false));
        }
Esempio n. 6
0
        public int Update(RoadFlow.Data.Model.WeiXinMessage model)
        {
            string sql = "UPDATE WeiXinMessage SET \r\n\t\t\t\tToUserName=:ToUserName,FromUserName=:FromUserName,CreateTime=:CreateTime,CreateTime1=:CreateTime1,MsgType=:MsgType,MsgId=:MsgId,AgentID=:AgentID,Contents=:Contents,PicUrl=:PicUrl,MediaId=:MediaId,Format=:Format,ThumbMediaId=:ThumbMediaId,Location_X=:Location_X,Location_Y=:Location_Y,Scale=:Scale,Label=:Label,Title=:Title,Description=:Description,AddTime=:AddTime\r\n\t\t\t\tWHERE ID=:ID";

            OracleParameter[] oracleParameterArray = new OracleParameter[20];
            int             index1           = 0;
            OracleParameter oracleParameter1 = new OracleParameter(":ToUserName", OracleDbType.Varchar2, 200);

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

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

            oracleParameter3.Value       = (object)model.CreateTime;
            oracleParameterArray[index3] = oracleParameter3;
            int             index4           = 3;
            OracleParameter oracleParameter4 = new OracleParameter(":CreateTime1", OracleDbType.Date, 8);

            oracleParameter4.Value       = (object)model.CreateTime1;
            oracleParameterArray[index4] = oracleParameter4;
            int             index5           = 4;
            OracleParameter oracleParameter5 = new OracleParameter(":MsgType", OracleDbType.Varchar2, 50);

            oracleParameter5.Value       = (object)model.MsgType;
            oracleParameterArray[index5] = oracleParameter5;
            int             index6           = 5;
            OracleParameter oracleParameter6 = new OracleParameter(":MsgId", OracleDbType.Int64, -1);

            oracleParameter6.Value       = (object)model.MsgId;
            oracleParameterArray[index6] = oracleParameter6;
            int             index7           = 6;
            OracleParameter oracleParameter7 = new OracleParameter(":AgentID", OracleDbType.Int32, -1);

            oracleParameter7.Value       = (object)model.AgentID;
            oracleParameterArray[index7] = oracleParameter7;
            int             index8 = 7;
            OracleParameter oracleParameter8;

            if (model.Contents != null)
            {
                OracleParameter oracleParameter9 = new OracleParameter(":Contents", OracleDbType.NVarchar2, -1);
                oracleParameter9.Value = (object)model.Contents;
                oracleParameter8       = oracleParameter9;
            }
            else
            {
                oracleParameter8       = new OracleParameter(":Contents", OracleDbType.NVarchar2, -1);
                oracleParameter8.Value = (object)DBNull.Value;
            }
            oracleParameterArray[index8] = oracleParameter8;
            int             index9 = 8;
            OracleParameter oracleParameter10;

            if (model.PicUrl != null)
            {
                OracleParameter oracleParameter9 = new OracleParameter(":PicUrl", OracleDbType.Varchar2, 500);
                oracleParameter9.Value = (object)model.PicUrl;
                oracleParameter10      = oracleParameter9;
            }
            else
            {
                oracleParameter10       = new OracleParameter(":PicUrl", OracleDbType.Varchar2, 500);
                oracleParameter10.Value = (object)DBNull.Value;
            }
            oracleParameterArray[index9] = oracleParameter10;
            int             index10 = 9;
            OracleParameter oracleParameter11;

            if (model.MediaId != null)
            {
                OracleParameter oracleParameter9 = new OracleParameter(":MediaId", OracleDbType.Varchar2, 500);
                oracleParameter9.Value = (object)model.MediaId;
                oracleParameter11      = oracleParameter9;
            }
            else
            {
                oracleParameter11       = new OracleParameter(":MediaId", OracleDbType.Varchar2, 500);
                oracleParameter11.Value = (object)DBNull.Value;
            }
            oracleParameterArray[index10] = oracleParameter11;
            int             index11 = 10;
            OracleParameter oracleParameter12;

            if (model.Format != null)
            {
                OracleParameter oracleParameter9 = new OracleParameter(":Format", OracleDbType.Varchar2, 50);
                oracleParameter9.Value = (object)model.Format;
                oracleParameter12      = oracleParameter9;
            }
            else
            {
                oracleParameter12       = new OracleParameter(":Format", OracleDbType.Varchar2, 50);
                oracleParameter12.Value = (object)DBNull.Value;
            }
            oracleParameterArray[index11] = oracleParameter12;
            int             index12 = 11;
            OracleParameter oracleParameter13;

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

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

            if (model.Location_Y != null)
            {
                OracleParameter oracleParameter9 = new OracleParameter(":Location_Y", OracleDbType.Varchar2, 50);
                oracleParameter9.Value = (object)model.Location_Y;
                oracleParameter15      = oracleParameter9;
            }
            else
            {
                oracleParameter15       = new OracleParameter(":Location_Y", OracleDbType.Varchar2, 50);
                oracleParameter15.Value = (object)DBNull.Value;
            }
            oracleParameterArray[index14] = oracleParameter15;
            int             index15 = 14;
            OracleParameter oracleParameter16;

            if (model.Scale != null)
            {
                OracleParameter oracleParameter9 = new OracleParameter(":Scale", OracleDbType.Varchar2, 50);
                oracleParameter9.Value = (object)model.Scale;
                oracleParameter16      = oracleParameter9;
            }
            else
            {
                oracleParameter16       = new OracleParameter(":Scale", OracleDbType.Varchar2, 50);
                oracleParameter16.Value = (object)DBNull.Value;
            }
            oracleParameterArray[index15] = oracleParameter16;
            int             index16 = 15;
            OracleParameter oracleParameter17;

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

            if (model.Title != null)
            {
                OracleParameter oracleParameter9 = new OracleParameter(":Title", OracleDbType.NVarchar2, 1000);
                oracleParameter9.Value = (object)model.Title;
                oracleParameter18      = oracleParameter9;
            }
            else
            {
                oracleParameter18       = new OracleParameter(":Title", OracleDbType.NVarchar2, 1000);
                oracleParameter18.Value = (object)DBNull.Value;
            }
            oracleParameterArray[index17] = oracleParameter18;
            int             index18 = 17;
            OracleParameter oracleParameter19;

            if (model.Description != null)
            {
                OracleParameter oracleParameter9 = new OracleParameter(":Description", OracleDbType.NVarchar2, 2000);
                oracleParameter9.Value = (object)model.Description;
                oracleParameter19      = oracleParameter9;
            }
            else
            {
                oracleParameter19       = new OracleParameter(":Description", OracleDbType.NVarchar2, 2000);
                oracleParameter19.Value = (object)DBNull.Value;
            }
            oracleParameterArray[index18] = oracleParameter19;
            int             index19           = 18;
            OracleParameter oracleParameter20 = new OracleParameter(":AddTime", OracleDbType.Date, 8);

            oracleParameter20.Value       = (object)model.AddTime;
            oracleParameterArray[index19] = oracleParameter20;
            int             index20           = 19;
            OracleParameter oracleParameter21 = new OracleParameter(":ID", OracleDbType.Varchar2, -1);

            oracleParameter21.Value       = (object)model.ID;
            oracleParameterArray[index20] = oracleParameter21;
            OracleParameter[] parameter = oracleParameterArray;
            return(this.dbHelper.Execute(sql, parameter));
        }
Esempio n. 7
0
        public int Add(RoadFlow.Data.Model.WeiXinMessage model)
        {
            string sql = "INSERT INTO WeiXinMessage\r\n\t\t\t\t(ID,ToUserName,FromUserName,CreateTime,CreateTime1,MsgType,MsgId,AgentID,Contents,PicUrl,MediaId,Format,ThumbMediaId,Location_X,Location_Y,Scale,Label,Title,Description,AddTime) \r\n\t\t\t\tVALUES(@ID,@ToUserName,@FromUserName,@CreateTime,@CreateTime1,@MsgType,@MsgId,@AgentID,@Contents,@PicUrl,@MediaId,@Format,@ThumbMediaId,@Location_X,@Location_Y,@Scale,@Label,@Title,@Description,@AddTime)";

            MySqlParameter[] mySqlParameterArray = new MySqlParameter[20];
            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("@ToUserName", MySqlDbType.VarChar, 200);

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

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

            mySqlParameter4.Value       = (object)model.CreateTime;
            mySqlParameterArray[index4] = mySqlParameter4;
            int            index5          = 4;
            MySqlParameter mySqlParameter5 = new MySqlParameter("@CreateTime1", MySqlDbType.DateTime, 8);

            mySqlParameter5.Value       = (object)model.CreateTime1;
            mySqlParameterArray[index5] = mySqlParameter5;
            int            index6          = 5;
            MySqlParameter mySqlParameter6 = new MySqlParameter("@MsgType", MySqlDbType.VarChar, 50);

            mySqlParameter6.Value       = (object)model.MsgType;
            mySqlParameterArray[index6] = mySqlParameter6;
            int            index7          = 6;
            MySqlParameter mySqlParameter7 = new MySqlParameter("@MsgId", MySqlDbType.Int64, -1);

            mySqlParameter7.Value       = (object)model.MsgId;
            mySqlParameterArray[index7] = mySqlParameter7;
            int            index8          = 7;
            MySqlParameter mySqlParameter8 = new MySqlParameter("@AgentID", MySqlDbType.Int32, -1);

            mySqlParameter8.Value       = (object)model.AgentID;
            mySqlParameterArray[index8] = mySqlParameter8;
            int            index9 = 8;
            MySqlParameter mySqlParameter9;

            if (model.Contents != null)
            {
                MySqlParameter mySqlParameter10 = new MySqlParameter("@Contents", MySqlDbType.VarChar, -1);
                mySqlParameter10.Value = (object)model.Contents;
                mySqlParameter9        = mySqlParameter10;
            }
            else
            {
                mySqlParameter9       = new MySqlParameter("@Contents", MySqlDbType.VarChar, -1);
                mySqlParameter9.Value = (object)DBNull.Value;
            }
            mySqlParameterArray[index9] = mySqlParameter9;
            int            index10 = 9;
            MySqlParameter mySqlParameter11;

            if (model.PicUrl != null)
            {
                MySqlParameter mySqlParameter10 = new MySqlParameter("@PicUrl", MySqlDbType.VarChar, 500);
                mySqlParameter10.Value = (object)model.PicUrl;
                mySqlParameter11       = mySqlParameter10;
            }
            else
            {
                mySqlParameter11       = new MySqlParameter("@PicUrl", MySqlDbType.VarChar, 500);
                mySqlParameter11.Value = (object)DBNull.Value;
            }
            mySqlParameterArray[index10] = mySqlParameter11;
            int            index11 = 10;
            MySqlParameter mySqlParameter12;

            if (model.MediaId != null)
            {
                MySqlParameter mySqlParameter10 = new MySqlParameter("@MediaId", MySqlDbType.VarChar, 500);
                mySqlParameter10.Value = (object)model.MediaId;
                mySqlParameter12       = mySqlParameter10;
            }
            else
            {
                mySqlParameter12       = new MySqlParameter("@MediaId", MySqlDbType.VarChar, 500);
                mySqlParameter12.Value = (object)DBNull.Value;
            }
            mySqlParameterArray[index11] = mySqlParameter12;
            int            index12 = 11;
            MySqlParameter mySqlParameter13;

            if (model.Format != null)
            {
                MySqlParameter mySqlParameter10 = new MySqlParameter("@Format", MySqlDbType.VarChar, 50);
                mySqlParameter10.Value = (object)model.Format;
                mySqlParameter13       = mySqlParameter10;
            }
            else
            {
                mySqlParameter13       = new MySqlParameter("@Format", MySqlDbType.VarChar, 50);
                mySqlParameter13.Value = (object)DBNull.Value;
            }
            mySqlParameterArray[index12] = mySqlParameter13;
            int            index13 = 12;
            MySqlParameter mySqlParameter14;

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

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

            if (model.Location_Y != null)
            {
                MySqlParameter mySqlParameter10 = new MySqlParameter("@Location_Y", MySqlDbType.VarChar, 50);
                mySqlParameter10.Value = (object)model.Location_Y;
                mySqlParameter16       = mySqlParameter10;
            }
            else
            {
                mySqlParameter16       = new MySqlParameter("@Location_Y", MySqlDbType.VarChar, 50);
                mySqlParameter16.Value = (object)DBNull.Value;
            }
            mySqlParameterArray[index15] = mySqlParameter16;
            int            index16 = 15;
            MySqlParameter mySqlParameter17;

            if (model.Scale != null)
            {
                MySqlParameter mySqlParameter10 = new MySqlParameter("@Scale", MySqlDbType.VarChar, 50);
                mySqlParameter10.Value = (object)model.Scale;
                mySqlParameter17       = mySqlParameter10;
            }
            else
            {
                mySqlParameter17       = new MySqlParameter("@Scale", MySqlDbType.VarChar, 50);
                mySqlParameter17.Value = (object)DBNull.Value;
            }
            mySqlParameterArray[index16] = mySqlParameter17;
            int            index17 = 16;
            MySqlParameter mySqlParameter18;

            if (model.Label != null)
            {
                MySqlParameter mySqlParameter10 = new MySqlParameter("@Label", MySqlDbType.VarChar, 1000);
                mySqlParameter10.Value = (object)model.Label;
                mySqlParameter18       = mySqlParameter10;
            }
            else
            {
                mySqlParameter18       = new MySqlParameter("@Label", MySqlDbType.VarChar, 1000);
                mySqlParameter18.Value = (object)DBNull.Value;
            }
            mySqlParameterArray[index17] = mySqlParameter18;
            int            index18 = 17;
            MySqlParameter mySqlParameter19;

            if (model.Title != null)
            {
                MySqlParameter mySqlParameter10 = new MySqlParameter("@Title", MySqlDbType.VarChar, 1000);
                mySqlParameter10.Value = (object)model.Title;
                mySqlParameter19       = mySqlParameter10;
            }
            else
            {
                mySqlParameter19       = new MySqlParameter("@Title", MySqlDbType.VarChar, 1000);
                mySqlParameter19.Value = (object)DBNull.Value;
            }
            mySqlParameterArray[index18] = mySqlParameter19;
            int            index19 = 18;
            MySqlParameter mySqlParameter20;

            if (model.Description != null)
            {
                MySqlParameter mySqlParameter10 = new MySqlParameter("@Description", MySqlDbType.VarChar, 2000);
                mySqlParameter10.Value = (object)model.Description;
                mySqlParameter20       = mySqlParameter10;
            }
            else
            {
                mySqlParameter20       = new MySqlParameter("@Description", MySqlDbType.VarChar, 2000);
                mySqlParameter20.Value = (object)DBNull.Value;
            }
            mySqlParameterArray[index19] = mySqlParameter20;
            int            index20          = 19;
            MySqlParameter mySqlParameter21 = new MySqlParameter("@AddTime", MySqlDbType.DateTime, 8);

            mySqlParameter21.Value       = (object)model.AddTime;
            mySqlParameterArray[index20] = mySqlParameter21;
            MySqlParameter[] parameter = mySqlParameterArray;
            return(this.dbHelper.Execute(sql, parameter, false));
        }