Beispiel #1
0
        /// <summary>
        /// 获取监控列表
        /// </summary>
        /// <param name="userInfo">用户信息</param>
        /// <returns></returns>
        public DataTable GetMonitorDT(BaseUserInfo userInfo)
        {
            // 写入调试信息
            #if (DEBUG)
            int milliStart = BaseBusinessLogic.StartDebug(userInfo, MethodBase.GetCurrentMethod());
            #endif

            // 加强安全验证防止未授权匿名调用
            #if (!DEBUG)
            LogOnService.UserIsLogOn(userInfo);
            #endif

            DataTable dataTable = null;
            using (IDbHelper dbHelper = DbHelperFactory.GetHelper(BaseSystemInfo.WorkFlowDbType))
            {
                try
                {
                    dbHelper.Open(WorkFlowDbConnection);
                    BaseWorkFlowCurrentManager workFlowCurrentManager = new BaseWorkFlowCurrentManager(dbHelper, userInfo);
                    if (userInfo.IsAdministrator)
                    {
                        dataTable = workFlowCurrentManager.GetDataTable(new KeyValuePair <string, object>(BaseWorkFlowCurrentEntity.FieldDeletionStateCode, 0), BaseWorkFlowCurrentEntity.FieldSendDate);
                    }
                    else
                    {
                        dataTable = workFlowCurrentManager.GetMonitorDT();
                    }
                    dataTable.TableName = BaseWorkFlowCurrentEntity.TableName;
                    BaseLogManager.Instance.Add(dbHelper, userInfo, this.serviceName, MethodBase.GetCurrentMethod());
                }
                catch (Exception ex)
                {
                    BaseExceptionManager.LogException(dbHelper, userInfo, ex);
                    throw ex;
                }
                finally
                {
                    dbHelper.Close();
                }
            }

            // 写入调试信息
            #if (DEBUG)
            BaseBusinessLogic.EndDebug(MethodBase.GetCurrentMethod(), milliStart);
            #endif

            return(dataTable);
        }
Beispiel #2
0
        /// <summary>
        /// 获取监控列表
        /// </summary>
        /// <param name="userInfo">用户信息</param>
        /// <returns></returns>
        public DataTable GetMonitorDT(BaseUserInfo userInfo)
        {
            DataTable dt = null;

            var parameter = ServiceInfo.Create(userInfo, MethodBase.GetCurrentMethod());

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, (dbHelper) =>
            {
                var workFlowCurrentManager = new BaseWorkFlowCurrentManager(dbHelper, userInfo);
                if (userInfo.IsAdministrator)
                {
                    dt = workFlowCurrentManager.GetDataTable(new KeyValuePair <string, object>(BaseWorkFlowCurrentEntity.FieldDeletionStateCode, 0), BaseWorkFlowCurrentEntity.FieldSendDate);
                }
                else
                {
                    dt = workFlowCurrentManager.GetMonitorDT();
                }
                dt.TableName = BaseWorkFlowCurrentEntity.TableName;
            });
            return(dt);
        }