начало положено
This commit is contained in:
parent
2803143064
commit
288050d220
@ -6,6 +6,7 @@ using ProjectGarage.Entities.Enums;
|
||||
using ProjectGarage.Repositories;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
@ -14,12 +15,17 @@ namespace ProjectGarage.Entities;
|
||||
|
||||
public class Driver
|
||||
{
|
||||
public int Id { get;private set; }
|
||||
public int Id { get; private set; }
|
||||
|
||||
[DisplayName("Фамилия")]
|
||||
public string Fname { get;private set; } = string.Empty;
|
||||
|
||||
|
||||
[DisplayName("Имя")]
|
||||
public string Lname { get;private set; } = string.Empty;
|
||||
|
||||
public string FullName => $"{Fname} {Lname}";
|
||||
|
||||
[DisplayName("Id фуры")]
|
||||
public int TruckId { get;private set; }
|
||||
|
||||
public static Driver CreateDriver(int id, string fname, string lname, int truckid)
|
||||
|
@ -1,6 +1,7 @@
|
||||
using ProjectGarage.Entities.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Reflection.Metadata.Ecma335;
|
||||
using System.Text;
|
||||
@ -12,10 +13,13 @@ public class Fuel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
[DisplayName("Название топлива")]
|
||||
public string FuelName { get; set; } = string.Empty;
|
||||
|
||||
[DisplayName("Вид топлива")]
|
||||
public FuelType FuelType { get; set; }
|
||||
|
||||
[DisplayName("Цена за литр")]
|
||||
public int Price { get; set; }
|
||||
|
||||
public static Fuel CreateFuel(int id, string name, FuelType type, int price)
|
||||
|
@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
@ -10,12 +11,16 @@ public class Route
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
[DisplayName("Название маршрута")]
|
||||
public string RouteName { get; set; } = string.Empty;
|
||||
|
||||
[DisplayName("Начальная т.")]
|
||||
public string StartP { get; set; } = string.Empty;
|
||||
|
||||
[DisplayName("Конечная т.")]
|
||||
public string FinalP { get; set; } = string.Empty;
|
||||
|
||||
[DisplayName("Протяженность")]
|
||||
public int Length { get; set; }
|
||||
|
||||
public static Route CreateRoute(int id,string name, string startp, string finalp, int len)
|
||||
|
@ -1,6 +1,7 @@
|
||||
using ProjectGarage.Entities.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
@ -11,12 +12,17 @@ public class Truck
|
||||
{
|
||||
public int Id { get; private set; }
|
||||
|
||||
[DisplayName("Номера фуры")]
|
||||
public string Numbers { get; private set; } = string.Empty;
|
||||
|
||||
[DisplayName("Марка фуры")]
|
||||
public TruckType Truck_Type { get; set; }
|
||||
|
||||
[DisplayName("Вместимость цистерны")]
|
||||
public int MaxFuel { get; private set; }
|
||||
|
||||
public string TruckInfo => $"{Numbers} {Truck_Type.ToString()}";
|
||||
|
||||
public static Truck CreateTruck(int id,string numbers, TruckType type, int maxFuel)
|
||||
{
|
||||
return new Truck()
|
||||
|
@ -49,7 +49,7 @@ namespace ProjectGarage.Forms
|
||||
InitializeComponent();
|
||||
_driverRepository = driverRepository ?? throw new ArgumentNullException(nameof(driverRepository));
|
||||
comboBoxTruckID.DataSource = truckRepository.ReadTrucks();
|
||||
comboBoxTruckID.DisplayMember = "Numbers";
|
||||
comboBoxTruckID.DisplayMember = "TruckInfo";
|
||||
comboBoxTruckID.ValueMember = "Id";
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ namespace ProjectGarage.Forms
|
||||
_replenishmentRepository = replenishmentRepository ??
|
||||
throw new ArgumentNullException(nameof(replenishmentRepository));
|
||||
comboBoxReplenishmentDriver.DataSource = driverRepository.ReadDrivers();
|
||||
comboBoxReplenishmentDriver.DisplayMember = "Fname";
|
||||
comboBoxReplenishmentDriver.DisplayMember = "FullName";
|
||||
comboBoxReplenishmentDriver.ValueMember = "Id";
|
||||
ColumnFuel.DataSource = fuelRepository.ReadFuels();
|
||||
ColumnFuel.DisplayMember = "FuelName";
|
||||
|
@ -25,7 +25,7 @@ namespace ProjectGarage.Forms
|
||||
throw new ArgumentNullException(nameof(transportationRepository));
|
||||
|
||||
comboBoxDriver.DataSource = driverRepository.ReadDrivers();
|
||||
comboBoxDriver.DisplayMember = "Fname";
|
||||
comboBoxDriver.DisplayMember = "FullName";
|
||||
comboBoxDriver.ValueMember = "Id";
|
||||
|
||||
comboBoxFuel.DataSource = fuelRepository.ReadFuels();
|
||||
|
Loading…
Reference in New Issue
Block a user