private async Task Get() { InfoUser loginUsers = await loginUsersService.Get(App.Current.Properties["token"].ToString()); IEnumerable <UserHelth> userHelths = await registrationUsersService.get_hels_status(); ID = loginUsers.IdUsers; if (loginUsers.Isman) { Pol_Lable.Text += "Мужской"; } else { Pol_Lable.Text += "Женский"; } userHelths = userHelths.Where(p => p.IdHealth == loginUsers.IdHelth); foreach (UserHelth userHelth in userHelths) { StatusHels_Lable.Text += userHelth.NameHealth; } FIO_Lable.Text += loginUsers.Fam + " " + loginUsers.Name + " " + loginUsers.Patronimic; Email_Lable.Text += loginUsers.Email; Login_Lable.Text += loginUsers.Login; User_Image.Source = new UriImageSource { CachingEnabled = false, Uri = new System.Uri(loginUsers.Logo) }; }
private async Task GetPicerAsync() { IEnumerable <UserHelth> userHelths = await registrationUsersService.get_hels_status(); hels_Picker = new Picker { Margin = new Thickness(60, -15, 10, 0) }; foreach (var item in userHelths) { hels_Picker.Items.Add(item.NameHealth); } hels_Picker.SelectedIndexChanged += (s, e) => { var picker_list = userHelths.FirstOrDefault(x => x.NameHealth == hels_Picker.Items[hels_Picker.SelectedIndex].ToString()); user_hals = picker_list.IdHealth; }; Main_Grid.Children.Add(hels_Picker, 1, 13); hels_Picker.SelectedIndex = 1; }
private async Task showEmployeeAsync() { YesRecords.Height = 0; NoRecords.Height = 0; RowDefinitionActivity.Height = new GridLength(1, GridUnitType.Star); activityIndicator.IsRunning = true; IEnumerable <InfoUser> infoUsers = await registrationUsersService.Get_user(); IEnumerable <UserHelth> userHelths = await registrationUsersService.get_hels_status(); var info = from p in infoUsers join u in userHelths on p.IdHelth equals u.IdHealth select new { p.Email, p.Fam, p.Isman, p.Login, p.Years, p.Rol, p.Patronimic, p.Name, u.NameHealth }; var res = infoUsers.ToList(); if (res.Count != 0) { lstData.ItemsSource = res; YesRecords.Height = new GridLength(1, GridUnitType.Star); NoRecords.Height = 0; await Task.Delay(1000); RowDefinitionActivity.Height = 0; activityIndicator.IsRunning = false; } else { lstData.ItemsSource = res; YesRecords.Height = 0; NoRecords.Height = new GridLength(1, GridUnitType.Star); } }
private async Task Get(int id) { try { InfoUser loginUsers = await registrationUsersService.Get_user_id(id); IEnumerable <UserHelth> userHelths = await registrationUsersService.get_hels_status(); ID = loginUsers.IdUsers; if (loginUsers.Isman) { Pol_Lable.Text += "Мужской"; } else { Pol_Lable.Text += "Женский"; } userHelths = userHelths.Where(p => p.IdHealth == loginUsers.IdHelth); foreach (UserHelth userHelth in userHelths) { StatusHels_Lable.Text += userHelth.NameHealth; } if (loginUsers.Logo != null) { User_Image.Source = new UriImageSource { CachingEnabled = true, CacheValidity = new System.TimeSpan(2, 0, 0, 0), Uri = new Uri(loginUsers.Logo) }; } else { User_Image.Source = ImageSource.FromResource(picture_lincs.LinksResourse() + "nophotouser.png"); } FIO_Lable.Text += loginUsers.Fam + " " + loginUsers.Name + " " + loginUsers.Patronimic; Yars_Lable.Text += loginUsers.Years; Email_Lable.Text += loginUsers.Email; Login_Lable.Text += loginUsers.Login; } catch { } }
private async Task Criate_LoginPicer(bool status) { IEnumerable <InfoUser> infoUsers = await registrationUsersService.Get_user(); LoginPicer = new Picker { Margin = new Thickness(10, -10, 10, 5) }; if (status) { infoUsers = infoUsers.Where(p => p.Login == PoiskLogin.Text || p.Login.StartsWith(PoiskLogin.Text)); } foreach (var item in infoUsers) { LoginPicer.Items.Add(item.Login); } LoginPicer.SelectedIndexChanged += async(s, e) => { IEnumerable <UserHelth> userHelths = await registrationUsersService.get_hels_status(); var picker_list = infoUsers.FirstOrDefault(x => x.Login == LoginPicer.Items[LoginPicer.SelectedIndex].ToString()); var picker_list_Hels = userHelths.FirstOrDefault(x => x.IdHealth == picker_list.IdHelth); IDUser = picker_list.IdUsers; Info_Editor.Text = ""; Info_Editor.Text = "Login: "******"\r\n"; Info_Editor.Text += "E-mail: " + picker_list.Email + "\r\n"; Info_Editor.Text += "ФИО: " + picker_list.Fam + " " + picker_list.Name + " " + picker_list.Patronimic + "\r\n"; Info_Editor.Text += "Возраст: " + picker_list.Years + "\r\n"; Info_Editor.Text += "Статус здоровья: " + picker_list_Hels.NameHealth + "\r\n"; if (picker_list.Isman == true) { Info_Editor.Text += "Пол: Мужской" + "\r\n"; } else { Info_Editor.Text += "Пол: Женский" + "\r\n"; } }; GridMain.Children.Add(LoginPicer, 1, 2); // LoginPicer.SelectedIndex = 1; }
private async Task Criate_LoginPicer(bool status) { IEnumerable <Participation> participations = await participationService.Get(); IEnumerable <InfoUser> infoUsers = await registrationUsersService.Get_user(); IEnumerable <Competentions> competentions = await competentionsServise.Get(); var info = from p in participations join i in infoUsers on p.IdUser equals i.IdUsers join c in competentions on p.IdCompetentions equals c.IdCompetentions select new { i.Login, i.Name, i.Fam, i.Patronimic, i.Email, i.Years, i.Isman, i.IdHelth, p.IdParticipation, c.Date }; LoginPicer = new Picker { Margin = new Thickness(10, -10, 10, 5) }; if (status) { info = info.Where(p => p.Login == PoiskLogin.Text || p.Login.StartsWith(PoiskLogin.Text)); } foreach (var item in info) { DateTime today = DateTime.Now; DateTime start = item.Date; if (today <= start && today.AddMonths(3) >= start) { LoginPicer.Items.Add(item.Login); } } LoginPicer.SelectedIndexChanged += async(s, e) => { IEnumerable <UserHelth> userHelths = await registrationUsersService.get_hels_status(); var picker_list = info.FirstOrDefault(x => x.Login == LoginPicer.Items[LoginPicer.SelectedIndex].ToString()); var picker_list_Hels = userHelths.FirstOrDefault(x => x.IdHealth == picker_list.IdHelth); Criate_SelectCompitentions(true, true); Info_Editor.Text = ""; Info_Editor.Text = "Login: "******"\r\n"; Info_Editor.Text += "E-mail: " + picker_list.Email + "\r\n"; Info_Editor.Text += "ФИО: " + picker_list.Fam + " " + picker_list.Name + " " + picker_list.Patronimic + "\r\n"; Info_Editor.Text += "Возраст: " + picker_list.Years + "\r\n"; Info_Editor.Text += "Статус здоровья: " + picker_list_Hels.NameHealth + "\r\n"; if (picker_list.Isman == true) { Info_Editor.Text += "Пол: Мужской" + "\r\n"; } else { Info_Editor.Text += "Пол: Женский" + "\r\n"; } }; GridMain.Children.Add(LoginPicer, 1, 2); }