Beispiel #1
0
        /// <summary>
        /// 插入
        /// </summary>
        /// <param name="info"></param>
        public static void Insert(Tb_PushMessage_Mod info)
        {
            Database  db  = DataConnect.GetConnect;
            string    sql = @"INSERT INTO TB_PUSHMESSAGE
                            (LISTID, PUSHTYPE, PUSHNUMBER, MESSAGETYPE, PROTOCOLTYPE, MESSAGE, PUSHTIME, ISSUCCESS, 
                             SOURCEID, ISALARM, REASON, RESERVED1, RESERVED2, RESERVED3, RESERVED4)
                          VALUES
                            (:LISTID, :PUSHTYPE, :PUSHNUMBER, :MESSAGETYPE, :PROTOCOLTYPE, :MESSAGE, :PUSHTIME,
                             :ISSUCCESS, :SOURCEID, :ISALARM, :REASON, :RESERVED1, :RESERVED2, :RESERVED3, :RESERVED4)";
            DbCommand cmd = db.GetSqlStringCommand(sql);

            db.AddInParameter(cmd, ":LISTID", DbType.String, info.LISTID);
            db.AddInParameter(cmd, ":PUSHTYPE", DbType.String, info.PUSHTYPE);
            db.AddInParameter(cmd, ":PUSHNUMBER", DbType.String, info.PUSHNUMBER);
            db.AddInParameter(cmd, ":MESSAGETYPE", DbType.String, info.MESSAGETYPE);
            db.AddInParameter(cmd, ":PROTOCOLTYPE", DbType.String, info.PROTOCOLTYPE);
            db.AddInParameter(cmd, ":MESSAGE", DbType.String, info.MESSAGE);
            db.AddInParameter(cmd, ":PUSHTIME", DbType.Date, info.PUSHTIME);
            db.AddInParameter(cmd, ":ISSUCCESS", DbType.String, info.ISSUCCESS);
            db.AddInParameter(cmd, ":SOURCEID", DbType.String, info.SOURCEID);
            db.AddInParameter(cmd, ":ISALARM", DbType.String, info.ISALARM);
            db.AddInParameter(cmd, ":REASON", DbType.String, info.REASON);
            db.AddInParameter(cmd, ":RESERVED1", DbType.String, info.RESERVED1);
            db.AddInParameter(cmd, ":RESERVED2", DbType.String, info.RESERVED2);
            db.AddInParameter(cmd, ":RESERVED3", DbType.String, info.RESERVED3);
            db.AddInParameter(cmd, ":RESERVED4", DbType.String, info.RESERVED4);
            db.ExecuteNonQuery(cmd);
        }
        /// <summary>
        /// 处理发送结果正确。
        /// </summary>
        /// <param name="v"></param>
        private void SendRight(Send_Mod v)
        {
            Tb_PushMessage_Mod info = new Tb_PushMessage_Mod();

            info.LISTID       = MyGuid.Create();
            info.PUSHTYPE     = "2";
            info.PUSHNUMBER   = v.Phone;
            info.MESSAGETYPE  = "1";
            info.PROTOCOLTYPE = Info.PI_PROTOCOLTYPE;
            info.MESSAGE      = v.Content;
            info.PUSHTIME     = DateTime.Now;
            info.ISSUCCESS    = "1";
            info.SOURCEID     = v.SourceId;
            info.ISALARM      = "0";
            Tb_PushMessage_Dal.Insert(info);
        }