public void AddSendMsgHistoryRecord(SendMsgHistoryRecordInfo info) { using (var manager = new UserBalanceManager()) { if (info == null) { throw new Exception("未查询到数据!"); } var ListInfo = manager.GetSendMsgHistoryRecord(info.PhoneNumber, info.IP, info.MsgType); if (ListInfo != null && ListInfo.Count > 1) { throw new Exception("每天只能发送三次,并且手机号码必须不相同!"); } SendMsgHistoryRecord entity = new SendMsgHistoryRecord(); ObjectConvert.ConverInfoToEntity(info, ref entity); manager.AddSendMsgHistoryRecord(entity); } }