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 get_users(int id) { InfoUser infoUsers = await registrationUsersService.Get_user_id(id); if (id != 0) { Head_Lable.Text = "Редактирование профиля"; Grid_One.Height = 0; Grid_Two.Height = 0; Grid_Fore.Height = 0; Time_Lable_Picer.IsVisible = true; Rol_Picker.IsVisible = false; if (infoUsers.Rol == "Admin") { Time_Lable_Picer.Text = "Администратор"; } else { Time_Lable_Picer.Text = "Пользователь"; } pol = infoUsers.Isman; user_hals = infoUsers.IdHelth; Login_Entry.IsVisible = false; Login_Lable_Entry.IsVisible = true; Login_Lable_Entry.Text = infoUsers.Login.ToString(); Email_Entry.IsVisible = false; Email_Lable_Entry.IsVisible = true; Email_Lable_Entry.Text = infoUsers.Email; RolUser = infoUsers.Rol; Name_Entry.Text = infoUsers.Name; Fam_Entry.Text = infoUsers.Fam; Patronymic_Entry.Text = infoUsers.Patronimic; Yars_Entry.Text = infoUsers.Years.ToString(); User_Image.Source = new UriImageSource { CachingEnabled = false, Uri = new System.Uri(infoUsers.Logo) }; if (infoUsers.Rol == "Admin") { Rol_Picker.SelectedIndex = 1; } else { Rol_Picker.SelectedIndex = 2; } if (infoUsers.Isman) { Pol_Picer.SelectedIndex = 1; } else { Pol_Picer.SelectedIndex = 2; } IEnumerable <UserHelth> userHelths = await registrationUsersService.get_hels_status(); var picker_list = userHelths.FirstOrDefault(x => x.IdHealth == infoUsers.IdHelth); foreach (var item in hels_Picker.Items) { if (hels_Picker.Items[hels_Picker.SelectedIndex].ToString() == picker_list.NameHealth) { hels_Picker.SelectedIndex = hels_Picker.SelectedIndex; } } } }