private async void getData(string mail,HPUserDetail bossData = null) { if(!string.IsNullOrEmpty(mail)) { //"search?type=auto&search={0}" string orgApi = string.Format("organization/uid={0},ou=People,o=hp.com", mail); string api = string.Format("detail/{0}", mail); var u = await HttpHelper.GetInfo<SearchInfo>(orgApi); hs_Result.DataContext = u.result; if(bossData==null) { var boss = await HttpHelper.GetInfo<SingleInfo>(api); hs_Boss.DataContext = boss?.result; } else { hs_Boss.DataContext = bossData; } } }
protected async override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); ViewModel = new HPUserViewModel(e.Parameter as HPUserDetail); me = e.Parameter as HPUserDetail; Infoes = ViewModel.ToDic(); lv_Mgr.Opacity = 0; processBar.Opacity = 1; processBar.IsIndeterminate = true; var result = await PeopleFinderHelper.GetManagers(ViewModel.Uid); Managers = new Queue<HPUserDetail>(); Managers.Enqueue(me); //Managers = new List<HPUserDetail>(); foreach (var r in result.result) { Managers.Enqueue(r.First()); //Managers.Add(r.First()); } this.Bindings.Update(); processBar.IsIndeterminate = false; processBar.Opacity = 0; lv_Mgr.Opacity = 1; }
public HPUserViewModel(HPUserDetail d) { this.DisplayNameExtension = d?.hpDisplayNameExtension; this.PhotoUrl = d?.hpPictureOneHpURI; this.EmployeeId = d?.employeeNumber; this.Uid = d?.uid; this.Manager = d?.manager.Split(new string[] { "," }, StringSplitOptions.None).First().Replace("uid=", ""); this.JobFunction = $"{d?.hpJobFunction} ({d?.hpJobFunctionCode})"; this.JobFamily = $"{d?.hpJobFamily} ({d?.hpJobFamilyCode})"; this.CompanyName = d?.o; this.TenantCompanyName = d?.hpSplitCompany; this.HRMRU = d?.hpMRUCode; this.OrganizationUnit = d?.ou; this.BusinessUnit = $"{d?.hpBusinessUnit} ({d?.hpBusinessUnitAcronym})"; this.BusinessGroup = $"{d?.hpBusinessGroup} ({d?.hpBusinessGroupCode})" ; this.BusinessRegion = $"{d?.hpBusinessRegion} ({d?.hpBusinessRegionAcronym})"; this.CountryCode = d?.c?.ToLower(); this.Country = d?.co; this.NTUserId = d?.ntUserDomainId?.Replace(":", @"\"); this.EmployeeType = d?.employeeType; this.LegalName = d?.hpLegalName; this.FirstName = d?.givenName; this.LastName = d?.sn; this.Telephone = d?.telephoneNumber; this.Mobile = d?.mobile; this.Region = d?.l; this.BuildingName = d?.buildingName; }