using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ProjectGarage.Entities; public class Transportation { public int Id { get; set; } [Browsable(false)] public int FuelId { get; set; } [Browsable(false)] public int RouteId { get; set; } [Browsable(false)] public int DriverId { get; set; } [DisplayName("Топливо")] public string FuelName { get; private set; } = string.Empty; [DisplayName("Водитель")] public string DriverName { get; private set; } = string.Empty; [DisplayName("Маршрут")] public string RouteName { get; private set; } = string.Empty; [DisplayName("Дата отправки")] public DateTime TransportationDate { get; private set; } [DisplayName("Кол-во топлива")] public int Amount { get; set; } public static Transportation CreateTransportation(int id, int fuel_id, int route_id, int driver_id, int amount) { return new Transportation { Id = id, FuelId = fuel_id, RouteId = route_id, DriverId = driver_id, Amount = amount, TransportationDate = DateTime.Now }; } }