private void JPush_Insert(ReturnDalInfo info, string alarmContent, string isPush, string errInfo) { Tb_WechatMessage_Mod w = new Tb_WechatMessage_Mod(); w.ListId = Guid.NewGuid().ToString("N"); w.WechatId = info.UserToken; w.MessageType = 1; w.ProtocolType = Convert.ToInt32(Info.ProtocolType); w.Message = alarmContent; w.IsSuccess = isPush; w.PushType = "4"; w.SourceId = Info.Reason; w.Reserved1 = errInfo; w.Reserved2 = info.Identitycard; w.Reserved4 = GetName(info.AppcardType); Tb_WechatMessage_Dal.Insert(w); }
public static void Insert(Tb_WechatMessage_Mod info) { Database db = DataConnect.GetConnect; DbCommand cmd = db.GetSqlStringCommand("insert into TB_WECHATMESSAGE (listid,wechatid,messagetype,protocoltype,message,pushtime,issuccess,sourceid,isalarm,reserved1,reserved2,reserved3,reserved4,PushType)values(:listid,:wechatid,:messagetype,:protocoltype,:message,sysdate,:issuccess,:sourceid,:isalarm,:reserved1,:reserved2,:reserved3,:reserved4,:PushType)"); db.AddInParameter(cmd, ":listid", DbType.String, info.ListId); db.AddInParameter(cmd, ":wechatid", DbType.String, info.WechatId); 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, ":issuccess", DbType.String, info.IsSuccess); db.AddInParameter(cmd, ":sourceid", DbType.String, info.SourceId); db.AddInParameter(cmd, ":isalarm", DbType.String, info.IsAlarm); 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.AddInParameter(cmd, ":PushType", DbType.String, info.PushType); db.ExecuteNonQuery(cmd); }
private void Insert(string content, bool IsSend, string SendResult) { Tb_WechatMessage_Mod log = new Tb_WechatMessage_Mod(); log.ListId = Guid.NewGuid().ToString("N"); log.WechatId = Info.Phone; log.MessageType = 1; log.ProtocolType = Convert.ToInt32(Info.SubCmd); log.SourceId = Info.Reason; log.Message = content; log.Reserved2 = Info.UserId; log.PushType = "2"; log.IsSuccess = IsSend ? "1" : "2"; if (SendResult.Length >= 100) { SendResult = SendResult.Substring(0, 100); } log.Reserved1 = log.IsSuccess == "1" ? "" : SendResult; Tb_WechatMessage_Dal.Insert(log); }