38 lines
1.2 KiB
C#
38 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace ProjectAirline.Entities;
|
|
|
|
public class Flight
|
|
{
|
|
public int Id { get; private set; }
|
|
public int AirplaneID { get; private set; }
|
|
public DateTime DepartureTime { get; private set; }
|
|
public DateTime ArrivalTime { get; private set; }
|
|
public string Destination { get; private set; } = string.Empty;
|
|
public string DeparturePoint { get; private set; } = string.Empty;
|
|
public int TicketPrice { get; private set; }
|
|
public IEnumerable<EmployeeFlight> EmployeeFlights { get; private set; } = [];
|
|
public static Flight CreateOperation(int id, int airPlaneID, string destination, string departurePoint, int ticketPrice,
|
|
IEnumerable<EmployeeFlight> employeeFlights)
|
|
{
|
|
return new Flight
|
|
{
|
|
Id = id,
|
|
AirplaneID = airPlaneID,
|
|
DepartureTime = DateTime.Now,
|
|
ArrivalTime = DateTime.Now,
|
|
Destination = destination ?? string.Empty,
|
|
DeparturePoint = departurePoint ?? string.Empty,
|
|
TicketPrice = ticketPrice,
|
|
EmployeeFlights = employeeFlights
|
|
};
|
|
}
|
|
|
|
|
|
|
|
}
|