/// <summary> /// 获取参数值 /// </summary> /// <param name="userInfo">用户</param> /// <param name="tableName">表名</param> /// <param name="categoryCode">分类编号</param> /// <param name="parameterId">参数主键</param> /// <param name="parameterCode">参数编号</param> /// <returns>参数值</returns> public string GetParameter(BaseUserInfo userInfo, string tableName, string categoryCode, string parameterId, string parameterCode) { var result = string.Empty; var parameter = ServiceInfo.Create(userInfo, MethodBase.GetCurrentMethod()); ServiceUtil.ProcessUserCenterReadDb(userInfo, parameter, (dbHelper) => { var manager = new BaseParameterManager(dbHelper, userInfo, tableName); result = manager.GetParameter(tableName, categoryCode, parameterId, parameterCode); }); return(result); }
/// <summary> /// 获取参数值 /// </summary> /// <param name="userInfo">用户</param> /// <param name="categoryId">分类主键</param> /// <param name="parameterId">参数主键</param> /// <param name="parameterCode">参数编号</param> /// <returns>参数值</returns> public string GetParameter(BaseUserInfo userInfo, string categoryId, string parameterId, string parameterCode) { // 写入调试信息 #if (DEBUG) int milliStart = BaseBusinessLogic.StartDebug(userInfo, MethodBase.GetCurrentMethod()); #endif // 加强安全验证防止未授权匿名调用 // #if (!DEBUG) // LogOnService.UserIsLogOn(userInfo); // #endif string returnValue = string.Empty; using (IDbHelper dbHelper = DbHelperFactory.GetHelper(BaseSystemInfo.UserCenterDbType)) { try { dbHelper.Open(UserCenterDbConnection); BaseParameterManager parameterManager = new BaseParameterManager(dbHelper, userInfo); returnValue = parameterManager.GetParameter(categoryId, parameterId, parameterCode); BaseLogManager.Instance.Add(dbHelper, userInfo, this.serviceName, AppMessage.ParameterService_GetParameter, MethodBase.GetCurrentMethod()); } catch (Exception ex) { BaseExceptionManager.LogException(dbHelper, userInfo, ex); throw ex; } finally { dbHelper.Close(); } } // 写入调试信息 #if (DEBUG) BaseBusinessLogic.EndDebug(MethodBase.GetCurrentMethod(), milliStart); #endif return(returnValue); }