2024-11-05 23:39:22 +04:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2024-12-18 15:04:16 +04:00
|
|
|
|
using System.ComponentModel;
|
2024-11-05 23:39:22 +04:00
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace ProjectGarage.Entities;
|
|
|
|
|
|
|
|
|
|
public class Transportation
|
|
|
|
|
{
|
|
|
|
|
public int Id { get; set; }
|
|
|
|
|
|
2024-12-18 15:04:16 +04:00
|
|
|
|
[Browsable(false)]
|
2024-11-05 23:39:22 +04:00
|
|
|
|
public int FuelId { get; set; }
|
|
|
|
|
|
2024-12-18 15:04:16 +04:00
|
|
|
|
[Browsable(false)]
|
2024-11-05 23:39:22 +04:00
|
|
|
|
public int RouteId { get; set; }
|
|
|
|
|
|
2024-12-18 15:04:16 +04:00
|
|
|
|
[Browsable(false)]
|
2024-11-05 23:39:22 +04:00
|
|
|
|
public int DriverId { get; set; }
|
|
|
|
|
|
2024-12-18 15:04:16 +04:00
|
|
|
|
[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;
|
2024-11-05 23:39:22 +04:00
|
|
|
|
|
2024-12-24 19:04:22 +04:00
|
|
|
|
[DisplayName("Дата отправки")]
|
2024-12-18 15:04:16 +04:00
|
|
|
|
public DateTime TransportationDate { get; private set; }
|
|
|
|
|
|
|
|
|
|
[DisplayName("Кол-во топлива")]
|
|
|
|
|
public int Amount { get; set; }
|
2024-11-05 23:39:22 +04:00
|
|
|
|
|
2024-11-20 00:53:28 +04:00
|
|
|
|
public static Transportation CreateTransportation(int id, int fuel_id, int route_id, int driver_id, int amount)
|
2024-11-05 23:39:22 +04:00
|
|
|
|
{
|
|
|
|
|
return new Transportation
|
|
|
|
|
{
|
|
|
|
|
Id = id,
|
|
|
|
|
FuelId = fuel_id,
|
|
|
|
|
RouteId = route_id,
|
|
|
|
|
DriverId = driver_id,
|
|
|
|
|
Amount = amount,
|
|
|
|
|
TransportationDate = DateTime.Now
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|