DataModels
This commit is contained in:
parent
13e0a1136a
commit
81ced0652b
@ -3,7 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
|||||||
# Visual Studio Version 17
|
# Visual Studio Version 17
|
||||||
VisualStudioVersion = 17.8.34525.116
|
VisualStudioVersion = 17.8.34525.116
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RouteGuideView", "RouteGuideView\RouteGuideView.csproj", "{4116AC9B-4035-4701-9C35-049AA6A83B96}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RouteGuideView", "RouteGuideView\RouteGuideView.csproj", "{4116AC9B-4035-4701-9C35-049AA6A83B96}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RouteGuideDataModels", "RouteGuideDataModels\RouteGuideDataModels.csproj", "{734B62E6-F4F0-4356-A4BC-067F52416282}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
@ -15,6 +17,10 @@ Global
|
|||||||
{4116AC9B-4035-4701-9C35-049AA6A83B96}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{4116AC9B-4035-4701-9C35-049AA6A83B96}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{4116AC9B-4035-4701-9C35-049AA6A83B96}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{4116AC9B-4035-4701-9C35-049AA6A83B96}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{4116AC9B-4035-4701-9C35-049AA6A83B96}.Release|Any CPU.Build.0 = Release|Any CPU
|
{4116AC9B-4035-4701-9C35-049AA6A83B96}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{734B62E6-F4F0-4356-A4BC-067F52416282}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{734B62E6-F4F0-4356-A4BC-067F52416282}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{734B62E6-F4F0-4356-A4BC-067F52416282}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{734B62E6-F4F0-4356-A4BC-067F52416282}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
24
RouteGuide/RouteGuideDataModels/Enums/TransportType.cs
Normal file
24
RouteGuide/RouteGuideDataModels/Enums/TransportType.cs
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace RouteGuideDataModels.Enums
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Тип транспорта
|
||||||
|
/// </summary>
|
||||||
|
public enum TransportType
|
||||||
|
{
|
||||||
|
Маршрутка,
|
||||||
|
|
||||||
|
Автобус,
|
||||||
|
|
||||||
|
Троллейбус,
|
||||||
|
|
||||||
|
Трамвай,
|
||||||
|
|
||||||
|
Такси
|
||||||
|
}
|
||||||
|
}
|
19
RouteGuide/RouteGuideDataModels/IId.cs
Normal file
19
RouteGuide/RouteGuideDataModels/IId.cs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace RouteGuideDataModels
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Интерфейс для идентификатора
|
||||||
|
/// </summary>
|
||||||
|
public interface IId
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Идентификатор
|
||||||
|
/// </summary>
|
||||||
|
int Id { get; }
|
||||||
|
}
|
||||||
|
}
|
29
RouteGuide/RouteGuideDataModels/Models/IDriverModel.cs
Normal file
29
RouteGuide/RouteGuideDataModels/Models/IDriverModel.cs
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace RouteGuideDataModels.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Интерфейс для модели водителя
|
||||||
|
/// </summary>
|
||||||
|
public interface IDriverModel : IId
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// ФИО водителя
|
||||||
|
/// </summary>
|
||||||
|
string FullName { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Номер телефона водителя
|
||||||
|
/// </summary>
|
||||||
|
string Phone { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Опыт работы водителя
|
||||||
|
/// </summary>
|
||||||
|
int? Experience { get; }
|
||||||
|
}
|
||||||
|
}
|
29
RouteGuide/RouteGuideDataModels/Models/IRouteModel.cs
Normal file
29
RouteGuide/RouteGuideDataModels/Models/IRouteModel.cs
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace RouteGuideDataModels.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Интерфейс для модели маршрута
|
||||||
|
/// </summary>
|
||||||
|
public interface IRouteModel : IId
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Название маршрута
|
||||||
|
/// </summary>
|
||||||
|
string Name { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Идентификатор тарнспорта
|
||||||
|
/// </summary>
|
||||||
|
int TransportId { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Коллеция остановок маршрута
|
||||||
|
/// </summary>
|
||||||
|
Dictionary<int, (IStopModel, int)> RouteStops { get; }
|
||||||
|
}
|
||||||
|
}
|
39
RouteGuide/RouteGuideDataModels/Models/IScheduleModel.cs
Normal file
39
RouteGuide/RouteGuideDataModels/Models/IScheduleModel.cs
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace RouteGuideDataModels.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Интерфейс для модели расписания
|
||||||
|
/// </summary>
|
||||||
|
public interface IScheduleModel : IId
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Дата записи расписания
|
||||||
|
/// </summary>
|
||||||
|
DateTime Date { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Время отправления
|
||||||
|
/// </summary>
|
||||||
|
TimeOnly DepartureTime { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Время прибытия
|
||||||
|
/// </summary>
|
||||||
|
TimeOnly ArrivalTime { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Периодичность движения транспорта
|
||||||
|
/// </summary>
|
||||||
|
TimeOnly Frequency { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Идентификатор маршрута
|
||||||
|
/// </summary>
|
||||||
|
int RouteId { get; }
|
||||||
|
}
|
||||||
|
}
|
29
RouteGuide/RouteGuideDataModels/Models/IStopModel.cs
Normal file
29
RouteGuide/RouteGuideDataModels/Models/IStopModel.cs
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace RouteGuideDataModels.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Интерфейс для модели остановки
|
||||||
|
/// </summary>
|
||||||
|
public interface IStopModel : IId
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Название остановки
|
||||||
|
/// </summary>
|
||||||
|
string Name { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Название улицы
|
||||||
|
/// </summary>
|
||||||
|
string Street { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Номер дома
|
||||||
|
/// </summary>
|
||||||
|
int Number { get; }
|
||||||
|
}
|
||||||
|
}
|
35
RouteGuide/RouteGuideDataModels/Models/ITransportModel.cs
Normal file
35
RouteGuide/RouteGuideDataModels/Models/ITransportModel.cs
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
using RouteGuideDataModels.Enums;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace RouteGuideDataModels.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Интерфейс для модели транспорта
|
||||||
|
/// </summary>
|
||||||
|
public interface ITransportModel : IId
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Номерной знак
|
||||||
|
/// </summary>
|
||||||
|
string License { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Тип транспортного средства
|
||||||
|
/// </summary>
|
||||||
|
TransportType Type { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Вместимость (количество пассажиров)
|
||||||
|
/// </summary>
|
||||||
|
int Capacity { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Идентификатор водителя
|
||||||
|
/// </summary>
|
||||||
|
int DriverId { get; }
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
</Project>
|
Loading…
Reference in New Issue
Block a user