DataModels

This commit is contained in:
kamilia 2024-05-13 00:12:52 +04:00
parent a03b37943b
commit fdfde37703
8 changed files with 177 additions and 0 deletions

View 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

View File

@ -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
{
Маршрутка,
Автобус,
Троллейбус,
Трамвай
}
}

View 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; }
}
}

View File

@ -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; }
}
}

View File

@ -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; }
}
}

View File

@ -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; }
}
}

View File

@ -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; }
}
}

View File

@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>