/// <summary> /// AddNewPerson функція, що вносить дані про користувача який забронював авіаквиток. /// </summary> public void AddNewPerson() { var sum = Int32.Parse(new String(string.Join(" ", Seating.Split(' ').ToList()[2]).Where(Char.IsDigit).ToArray())); PersonalInformation personalInformation = new PersonalInformation(); personalInformation.FirstName = FirstName; personalInformation.SecondName = SecondName; personalInformation.Document = Document; personalInformation.Gender = Gender.ToString(); personalInformation.FlightId = FlightId; personalInformation.BirthDate = BirthDate; personalInformation.Seating = string.Join(" ", Seating.Split(' ').ToList().GetRange(0, 2)).ToString(); personalInformation.Login = Login; CountTickets -= 1; Clients.Add(personalInformation, sum); if (CountTickets == 0) { Views.Payment menu = new Views.Payment(Login); menu.Show(); CloseWindow(); } else { Views.Personal_Information personal_Information = new Views.Personal_Information(Login, FlightId, CountTickets); personal_Information.Show(); CloseWindow(); } }