/// <summary> /// 获取员工列表 /// </summary> /// <param name="userInfo">用户</param> /// <param name="ids">组织主键</param> /// <returns>数据表</returns> public DataTable GetDataTableByIds(BaseUserInfo userInfo, string[] ids) { // 写入调试信息 #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.GetDataTable(BaseStaffEntity.FieldId, ids, BaseStaffEntity.FieldSortCode); dataTable.TableName = BaseStaffEntity.TableName; BaseLogManager.Instance.Add(dbHelper, userInfo, this.serviceName, AppMessage.StaffService_GetDataTableByIds, 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; }
private void ShowUser() { // 显示用户数据 this.txtUserName.Text = userEntity.UserName; this.txtRealName.Text = userEntity.RealName; this.txtCode.Text = userEntity.Code; this.txtMobile.Text = userEntity.Mobile; this.txtEmail.Text = userEntity.Email; if (userEntity.RoleId != null) { this.cmbRole.SelectedValue = userEntity.RoleId.ToString(); } this.ucCompany.SelectedId = userEntity.CompanyId; this.ucSubCompany.SelectedId = userEntity.SubCompanyId; this.ucDepartment.SelectedId = userEntity.DepartmentId; this.ucWorkgroup.SelectedId = userEntity.WorkgroupId; this.chbEnabled.Checked = (userEntity.Enabled == 1); this.txtDescription.Text = userEntity.Description; // 获取用户对应的员工信息 if (this.userEntity.Id != null) { // 加载员工 BaseStaffManager staffManager = new BaseStaffManager(UserInfo); this.staffEntity = new BaseStaffEntity(staffManager.GetDataTable(BaseStaffEntity.FieldUserId, userEntity.Id.ToString())); } }