public string[] GenerateСlient(string city = null) { var responseMessage = _httpClient.GetAsync("https://randomuser.me/api/?inc=gender,name,location,login,dob,nat=gb&noinfo").Result; var contentString = responseMessage.Content.ReadAsStringAsync().Result; // я так и не понял почему я не могу обойтись без листа var a = JsonSerializer.Deserialize <Root>(contentString).results.First(); var result = new string[7]; result[0] = a.login.username; result[1] = a.login.password; result[2] = a.name.last + ' ' + a.name.first; result[3] = a.gender; result[4] = a.dob.date.ToShortDateString(); // не смог использовать ?? кишки тонки result[5] = (city == null) ? a.location.city : StandartView.ConverteToStandartString(city); result[6] = GeneratePhoneNumber(); Dispose(); return(result); }
public Human(string login, string password, bool isStandertView = false) { if (!isStandertView) { StandartView.LoginEr(login); } Login = login; _password = HachPassword(password); }
public Client(string login, string password, string myFulName, string sex, string myBirthday, string myCity, string myPhoneNumber, bool isStandartView = false) : base(login, password, isStandartView) { MyFulName = new FulName(myFulName, isStandartView); MyBirthday = StandartView.ConverteStringToDate(myBirthday); MyCity = (isStandartView) ? myCity : StandartView.ConverteToStandartString(myCity); MyPhoneNumber = (isStandartView) ? myPhoneNumber : StandartView.ConverteToStandartPhoneNumber(myPhoneNumber); MySex = new Gender(sex); MyZodiacSign = new ZodiacSign(MyBirthday); MyCompatibilityByName = new СompatibilityByName(MyFulName.FirstName); }
private static string ReadLogin() { while (true) { Console.WriteLine("Введите логин:"); var login = Console.ReadLine(); Console.WriteLine(); if (StandartView.IsLogin(login)) { return(login); } else { Console.WriteLine("Не возможный формат логина\n"); } } }