/// <summary> /// 阅读消息 /// </summary> /// <param name="userInfo">用户</param> /// <param name="id">主键</param> public int Read(BaseUserInfo userInfo, string id) { int result = 0; var parameter = ServiceInfo.Create(userInfo, MethodBase.GetCurrentMethod()); ServiceUtil.ProcessMessageDb(userInfo, parameter, (dbHelper) => { var messageManager = new BaseMessageManager(dbHelper, userInfo); if (messageManager.Read(id, true) != null) { result++; } }); return(result); }
/// <summary> /// 阅读消息 /// </summary> /// <param name="userInfo">用户</param> /// <param name="id">主键</param> public void Read(BaseUserInfo userInfo, string id) { // 写入调试信息 #if (DEBUG) int milliStart = BaseBusinessLogic.StartDebug(userInfo, MethodBase.GetCurrentMethod()); #endif // 加强安全验证防止未授权匿名调用 #if (!DEBUG) LogOnService.UserIsLogOn(userInfo); #endif using (IDbHelper dbHelper = DbHelperFactory.GetHelper(BaseSystemInfo.UserCenterDbType)) { try { dbHelper.Open(UserCenterDbConnection); BaseMessageManager messageManager = new BaseMessageManager(dbHelper, userInfo); messageManager.Read(id); BaseLogManager.Instance.Add(dbHelper, userInfo, this.serviceName, AppMessage.MessageService_Read, MethodBase.GetCurrentMethod()); } catch (Exception ex) { BaseExceptionManager.LogException(dbHelper, userInfo, ex); throw ex; } finally { dbHelper.Close(); } } // 写入调试信息 #if (DEBUG) BaseBusinessLogic.EndDebug(MethodBase.GetCurrentMethod(), milliStart); #endif }