public bool InsertLocation(ESmsHistory info) { try { string sql = string.Format(@"insert into gps_smshistory(smshistory_id,LicenceNumber,telephone_number,UpSMSContent,DownSMSContent,ReceiveUserName,SendTime,TenantCode,SMSType,IsProfessional) values('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}');", info.smshistory_id.ToString(), info.LicenceNumber, info.telephone_number, info.UpSMSContent, info.DownSMSContent, info.ReceiveUserName, System.DateTime.Now, info.TenantCode, info.SMSType, info.IsProfessional); //Logger.Trace(sql); MySqlHelper.ExecuteNonQuery(MySqlHelper.DefaultConnectionString(string.Empty), sql); return true; } catch (Exception ex) { Logger.Error(ex); return false; } }
private List<EntityMessage> SaveLicenceNumberSMS(List<string> VehicleCode, EntityMessage entityMsg) { List<EntityMessage> list= new List<EntityMessage>(); for (int i = 1; i < VehicleCode.Count;i++ ) { EntityMessage entity = new EntityMessage(); ESmsHistory historyentity = new ESmsHistory(); entity.SearchLocation = historyentity; entity.SearchLocation.smshistory_id = IdentityNoService.GetESMShistoryID(); entity.SearchLocation.LicenceNumber = VehicleCode[i]; entity.SearchLocation.IsProfessional = entityMsg.SearchLocation.IsProfessional; entity.SearchLocation.DownSMSContent = entityMsg.SearchLocation.DownSMSContent; entity.SearchLocation.ReceiveUserName = entityMsg.SearchLocation.ReceiveUserName; entity.SearchLocation.SMSType = entityMsg.SearchLocation.SMSType; entity.SearchLocation.telephone_number = entityMsg.SearchLocation.telephone_number; entity.SearchLocation.TenantCode = entityMsg.SearchLocation.TenantCode; entity.SearchLocation.UpSMSContent = entityMsg.SearchLocation.UpSMSContent; list.Add(entity); } return list; }
/// <summary> /// 创建发送短信信息实体 /// </summary> /// <param name="mobile"></param> /// <returns></returns> protected virtual EntityMessage CreateEntityMessage(string mobile) { EntityMessage entityMsg = new EntityMessage(); ESmsHistory info = new ESmsHistory(); DataTable dt = QueryVehicleSetting(mobile); if (dt != null && dt.Rows.Count > 0) { info.smshistory_id = IdentityNoService.GetESMShistoryID(); //544545454; info.SMSType = 0; info.IsProfessional = int.Parse(dt.Rows[0]["IsProfessional"].ToString()); info.telephone_number = mobile; info.UpSMSContent = "CWZ"; info.ReceiveUserName = dt.Rows[0]["customername"].ToString(); info.TenantCode = dt.Rows[0]["tenantcode"].ToString(); } entityMsg.SearchLocation = info; entityMsg.isHistory = true; return entityMsg; }