45 lines
1.1 KiB
C#
45 lines
1.1 KiB
C#
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;
|
|
using System.ComponentModel;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace ProjectGarage.Entities;
|
|
|
|
public class Driver
|
|
{
|
|
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}";
|
|
|
|
[Browsable(false)]
|
|
public int TruckId { get;private set; }
|
|
|
|
[DisplayName("Номера фуры")]
|
|
public string TruckNum { get;private set; } = string.Empty;
|
|
|
|
public static Driver CreateDriver(int id, string fname, string lname, int truckid)
|
|
{
|
|
return new Driver
|
|
{
|
|
Id = id,
|
|
Fname = fname,
|
|
Lname = lname,
|
|
TruckId = truckid
|
|
};
|
|
}
|
|
}
|