DataModels
This commit is contained in:
parent
a03b37943b
commit
fdfde37703
25
RouteDirectory/RouteDirectory.sln
Normal file
25
RouteDirectory/RouteDirectory.sln
Normal file
@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.9.34723.18
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RouteDirectoryDataModels", "RouteDirectoryBusinessLogics\RouteDirectoryDataModels.csproj", "{69BE4B26-1636-4661-B3AA-A29C531223D9}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{69BE4B26-1636-4661-B3AA-A29C531223D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{69BE4B26-1636-4661-B3AA-A29C531223D9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{69BE4B26-1636-4661-B3AA-A29C531223D9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{69BE4B26-1636-4661-B3AA-A29C531223D9}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {8E96EBDB-BCBA-4BAD-87A6-72E49916BFAE}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RouteDirectoryDataModels.Enums
|
||||
{
|
||||
/// <summary>
|
||||
/// Тип транспорта
|
||||
/// </summary>
|
||||
public enum TransportType
|
||||
{
|
||||
Маршрутка,
|
||||
|
||||
Автобус,
|
||||
|
||||
Троллейбус,
|
||||
|
||||
Трамвай
|
||||
}
|
||||
}
|
13
RouteDirectory/RouteDirectoryBusinessLogics/IId.cs
Normal file
13
RouteDirectory/RouteDirectoryBusinessLogics/IId.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RouteDirectoryDataModels
|
||||
{
|
||||
public interface IId<T>
|
||||
{
|
||||
T Id { get; }
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RouteDirectoryDataModels.Models
|
||||
{
|
||||
public interface IRouteModel<T> : IId<T>
|
||||
{
|
||||
/// <summary>
|
||||
/// Название маршрута
|
||||
/// </summary>
|
||||
string RouteNumber { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Стоимость проезда
|
||||
/// </summary>
|
||||
int Fare { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Идентификатор транспорта
|
||||
/// </summary>
|
||||
T TransportId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Коллекция остановок маршрута
|
||||
/// </summary>
|
||||
Dictionary<T, (IStopModel<T>, int)> RouteStops { get; }
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RouteDirectoryDataModels.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Интерфейс для модели расписания
|
||||
/// </summary>
|
||||
public interface IScheduleModel<T> : IId<T>
|
||||
{
|
||||
/// <summary>
|
||||
/// Время отправления
|
||||
/// </summary>
|
||||
DateTime StartTime { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Время прибытия
|
||||
/// </summary>
|
||||
DateTime EndTime { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Периодичность движения транспорта
|
||||
/// </summary>
|
||||
DateTime TrafficInterval { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Идентификатор маршрута
|
||||
/// </summary>
|
||||
T RouteId { get; }
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RouteDirectoryDataModels.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Интерфейс для модели остановки
|
||||
/// </summary>
|
||||
public interface IStopModel<T> : IId<T>
|
||||
{
|
||||
/// <summary>
|
||||
/// Название остановки
|
||||
/// </summary>
|
||||
string Name { get; }
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
using RouteDirectoryDataModels.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RouteDirectoryDataModels.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Интерфейс для модели транспорта
|
||||
/// </summary>
|
||||
public interface ITransportType<T> : IId<T>
|
||||
{
|
||||
/// <summary>
|
||||
/// Тип транспортного средства
|
||||
/// </summary>
|
||||
TransportType Type { get; }
|
||||
/// <summary>
|
||||
/// Вместимость (количество пассажиров)
|
||||
/// </summary>
|
||||
int Capacity { 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