PIbd-23_Baryshev_D.A._Garage/ProjectGarage/Entities/Driver.cs

45 lines
1.1 KiB
C#
Raw Normal View History

2024-12-18 01:56:55 +04:00
using Dapper;
using DocumentFormat.OpenXml.Office2010.Excel;
using Newtonsoft.Json;
using Npgsql;
using ProjectGarage.Entities.Enums;
using ProjectGarage.Repositories;
using System;
using System.Collections.Generic;
2024-12-18 02:25:21 +04:00
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjectGarage.Entities;
public class Driver
{
2024-12-18 02:25:21 +04:00
public int Id { get; private set; }
2024-12-18 02:25:21 +04:00
[DisplayName("Фамилия")]
2024-12-03 23:06:20 +04:00
public string Fname { get;private set; } = string.Empty;
2024-12-18 02:25:21 +04:00
[DisplayName("Имя")]
2024-12-03 23:06:20 +04:00
public string Lname { get;private set; } = string.Empty;
2024-12-18 02:25:21 +04:00
public string FullName => $"{Fname} {Lname}";
[Browsable(false)]
2024-11-20 00:53:28 +04:00
public int TruckId { get;private set; }
[DisplayName("Номера фуры")]
public string TruckNum { get;private set; } = string.Empty;
2024-12-17 19:58:30 +04:00
public static Driver CreateDriver(int id, string fname, string lname, int truckid)
{
return new Driver
{
Id = id,
2024-12-03 23:06:20 +04:00
Fname = fname,
Lname = lname,
2024-12-17 19:58:30 +04:00
TruckId = truckid
};
}
}