public string[] SearchFlight(int id) { Flight flight = new DataBaseManagerFlight().Find(id); string[] result = new string[5]; result[0] = flight.Id.ToString(); result[1] = flight.DeparturePoint; result[2] = flight.DestinationPoint; result[3] = flight.DepartureDateTime.ToString(); result[4] = flight.PlaneID.ToString(); return(result); }
public string[,] SearchFlights(string departurePoint, string destinationPoint) { Flight[] flights = new DataBaseManagerFlight().FindByPoints(departurePoint, destinationPoint).ToArray(); string[,] result = new string[flights.Length, 4]; for (int i = 0; i < flights.Length; i++) { result[i, 0] = flights[i].Id.ToString(); result[i, 1] = flights[i].PlaneID.ToString(); result[i, 2] = flights[i].DepartureDateTime.ToString(); } return(result); }
{ // Тест создания баз данных public static bool Test() { Flight flight = new Flight() { PlaneID = 1566, DeparturePoint = "Киев", DestinationPoint = "Варшава", DepartureDateTime = DateTime.Now, Staus = FlightStatus.Сheck_In }; DataBaseManagerFlight dataBase = new DataBaseManagerFlight(); flight = dataBase.Add(flight); flight.DestinationPoint = "Токио"; dataBase.ChangeInfo(flight); var searchFlight = dataBase.Find(flight.Id); // new DataBaseManagerPlane().CreateDB(); // new DataBaseManagerTickets().CreateDB(); return(true); }