예제 #1
0
        /// <summary>
        /// 获取父级下属员工
        /// </summary>
        /// <param name="userInfo"></param>
        /// <param name="organizationId"></param>
        /// <returns></returns>
        public DataTable GetParentChildrenStaffs(BaseUserInfo userInfo, string organizationId)
        {
            var dt = new DataTable(BaseStaffEntity.CurrentTableName);

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

            ServiceUtil.ProcessUserCenterWriteDb(userInfo, parameter, (dbHelper) =>
            {
                // 获得组织机构列表
                var manager         = new BaseStaffManager(dbHelper, userInfo);
                dt                  = manager.GetParentChildrenStaffs(organizationId);
                dt.DefaultView.Sort = BaseStaffEntity.FieldSortCode;
                dt.TableName        = BaseStaffEntity.CurrentTableName;
            });
            return(dt);
        }
예제 #2
0
        public DataTable GetParentChildrenStaffs(BaseUserInfo userInfo, string organizeId)
        {
            // 写入调试信息
            #if (DEBUG)
            int milliStart = BaseBusinessLogic.StartDebug(userInfo, MethodBase.GetCurrentMethod());
            #endif

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

            DataTable dataTable = new DataTable(BaseStaffEntity.TableName);
            using (IDbHelper dbHelper = DbHelperFactory.GetHelper(BaseSystemInfo.UserCenterDbType))
            {
                try
                {
                    dbHelper.Open(UserCenterDbConnection);
                    // 获得组织机构列表
                    BaseStaffManager staffManager = new BaseStaffManager(dbHelper, userInfo);
                    dataTable = staffManager.GetParentChildrenStaffs(organizeId);
                    dataTable.DefaultView.Sort = BaseStaffEntity.FieldSortCode;
                    dataTable.TableName        = BaseStaffEntity.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);
        }