From 13e90c4e855f1c20a924b377b4c7fd5dc22e0c21 Mon Sep 17 00:00:00 2001 From: cyxaruk Date: Sun, 10 Nov 2024 12:07:31 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BD=D0=B0=D1=87=D0=B0=D0=BB=D0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/Bus.cs | 33 +++++++++++++++++++ .../Entities/Employee.cs | 29 ++++++++++++++++ .../Entities/Enums/EmployeePost.cs | 20 +++++++++++ 3 files changed, 82 insertions(+) create mode 100644 ProjectPeopleTransportation/ProjectPeopleTransportation/Entities/Bus.cs create mode 100644 ProjectPeopleTransportation/ProjectPeopleTransportation/Entities/Employee.cs create mode 100644 ProjectPeopleTransportation/ProjectPeopleTransportation/Entities/Enums/EmployeePost.cs diff --git a/ProjectPeopleTransportation/ProjectPeopleTransportation/Entities/Bus.cs b/ProjectPeopleTransportation/ProjectPeopleTransportation/Entities/Bus.cs new file mode 100644 index 0000000..3abd200 --- /dev/null +++ b/ProjectPeopleTransportation/ProjectPeopleTransportation/Entities/Bus.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectPeopleTransportation.Entities; + +internal class Bus +{ + public int ID { get; private set; } + + public string Model { get; private set; } = string.Empty; + + public string Brand { get; private set; } = string.Empty; + + public int BusNum { get; private set; } + + public int YearOfCreation { get; private set; } + + public static Bus CreateEntity(int id, string model, int busNum, string brand, int yearOfCreation) + { + return new Bus + { + ID = id, + Model = model, + BusNum = busNum, + Brand = brand, + YearOfCreation = yearOfCreation + }; + + } +} diff --git a/ProjectPeopleTransportation/ProjectPeopleTransportation/Entities/Employee.cs b/ProjectPeopleTransportation/ProjectPeopleTransportation/Entities/Employee.cs new file mode 100644 index 0000000..f33b779 --- /dev/null +++ b/ProjectPeopleTransportation/ProjectPeopleTransportation/Entities/Employee.cs @@ -0,0 +1,29 @@ +using ProjectPeopleTransportation.Entities.Enums; + +namespace ProjectPeopleTransportation.Entities; + +public class Employee +{ + public int Id { get; private set; } + + public string FirstName { get; private set; } = string.Empty; + + public string LastName { get; private set; } = string.Empty; + + public int PhoneNum { get; private set; } + + public EmployeePost EmployeePost { get; private set; } + + public static Employee CreateEntity(int id, string first, string last, int phone, EmployeePost employeePost) + { + return new Employee + { + Id = id, + FirstName = first ?? string.Empty, + LastName = last ?? string.Empty, + PhoneNum = phone, + EmployeePost = employeePost + }; + + } +} diff --git a/ProjectPeopleTransportation/ProjectPeopleTransportation/Entities/Enums/EmployeePost.cs b/ProjectPeopleTransportation/ProjectPeopleTransportation/Entities/Enums/EmployeePost.cs new file mode 100644 index 0000000..bc61dc6 --- /dev/null +++ b/ProjectPeopleTransportation/ProjectPeopleTransportation/Entities/Enums/EmployeePost.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectPeopleTransportation.Entities.Enums; + +public enum EmployeePost +{ + None = 0, + + Admin = 1, + + Engineer = 2, + + Driver = 3, + + Conductor = 4 +}