Contracts
This commit is contained in:
parent
5175f7bb75
commit
6c7c5fa390
14
Sto/STOContracts/BindingModels/CarBindingModel.cs
Normal file
14
Sto/STOContracts/BindingModels/CarBindingModel.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using STODataModels.Models;
|
||||
|
||||
namespace STOContracts.BindingModels
|
||||
{
|
||||
public class CarBindingModel : ICarModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Brand { get; set; } = string.Empty;
|
||||
public string Model { get; set; } = string.Empty;
|
||||
public string VIN { get; set; } = string.Empty;
|
||||
public Dictionary<int, (ISpareModel, int)> CarSpares { get; set; } = new();
|
||||
|
||||
}
|
||||
}
|
12
Sto/STOContracts/BindingModels/EmployerBindingModel.cs
Normal file
12
Sto/STOContracts/BindingModels/EmployerBindingModel.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using STODataModels.Models;
|
||||
|
||||
namespace STOContracts.BindingModels
|
||||
{
|
||||
public class EmployerBindingModel : IEmployerModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Login { get; set; } = string.Empty;
|
||||
public string Password { get; set; } = string.Empty;
|
||||
public string Email { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
13
Sto/STOContracts/BindingModels/MaintenanceBindingModel.cs
Normal file
13
Sto/STOContracts/BindingModels/MaintenanceBindingModel.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using STODataModels.Models;
|
||||
|
||||
namespace STOContracts.BindingModels
|
||||
{
|
||||
public class MaintenanceBindingModel : IMaintenanceModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int EmployerId { get; set; }
|
||||
public double Cost { get; set; }
|
||||
public DateTime DateCreate { get; set; }
|
||||
public Dictionary<int, (ICarModel, int)> MaintenanceCars { get; set; } = new();
|
||||
}
|
||||
}
|
15
Sto/STOContracts/BindingModels/ReportBindingModel.cs
Normal file
15
Sto/STOContracts/BindingModels/ReportBindingModel.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace STOContracts.BindingModels
|
||||
{
|
||||
public class ReportBindingModel
|
||||
{
|
||||
public string FileName { get; set; } = string.Empty;
|
||||
public DateTime? DateFrom { get; set; }
|
||||
public DateTime? DateTo { get; set; }
|
||||
}
|
||||
}
|
10
Sto/STOContracts/BindingModels/ServiceBindingModel.cs
Normal file
10
Sto/STOContracts/BindingModels/ServiceBindingModel.cs
Normal file
@ -0,0 +1,10 @@
|
||||
using STODataModels.Models;
|
||||
|
||||
namespace STOContracts.BindingModels
|
||||
{
|
||||
public class ServiceBindingModel : IServiceModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string ServiceDescription { get; set; }=string.Empty;
|
||||
}
|
||||
}
|
13
Sto/STOContracts/BindingModels/SpareBindingModel.cs
Normal file
13
Sto/STOContracts/BindingModels/SpareBindingModel.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using STODataModels.Models;
|
||||
|
||||
namespace STOContracts.BindingModels
|
||||
{
|
||||
public class SpareBindingModel : ISpareModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public string Name { get; set; } = String.Empty;
|
||||
|
||||
public double Price { get; set; }
|
||||
}
|
||||
}
|
15
Sto/STOContracts/BindingModels/StorekeeperBindingModel.cs
Normal file
15
Sto/STOContracts/BindingModels/StorekeeperBindingModel.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using STODataModels.Models;
|
||||
|
||||
namespace STOContracts.BindingModels
|
||||
{
|
||||
public class StorekeeperBindingModel : IStorekeeperModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public string Login { get; set; } = String.Empty;
|
||||
|
||||
public string Password { get; set; } = String.Empty;
|
||||
|
||||
public string Email { get; set; } = String.Empty;
|
||||
}
|
||||
}
|
25
Sto/STOContracts/BindingModels/WorkBindingModel.cs
Normal file
25
Sto/STOContracts/BindingModels/WorkBindingModel.cs
Normal file
@ -0,0 +1,25 @@
|
||||
using STODataModels.Models;
|
||||
|
||||
namespace STOContracts.BindingModels
|
||||
{
|
||||
public class WorkBindingModel : IWorkModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public string Title { get; set; } = String.Empty;
|
||||
|
||||
public double Price { get; set; }
|
||||
|
||||
public int StorekeeperId { get; set; }
|
||||
|
||||
public int DurationId { get; set; }
|
||||
|
||||
public DateTime Date { get; set; } = DateTime.Now;
|
||||
|
||||
public Dictionary<int, (ISpareModel, int)> WorkSpares { get; set; } = new();
|
||||
|
||||
public Dictionary<int, (IMaintenanceModel, int)> WorkMaintences { get; set; } = new();
|
||||
|
||||
|
||||
}
|
||||
}
|
11
Sto/STOContracts/BindingModels/WorkDurationBindingModel.cs
Normal file
11
Sto/STOContracts/BindingModels/WorkDurationBindingModel.cs
Normal file
@ -0,0 +1,11 @@
|
||||
using STODataModels.Models;
|
||||
|
||||
namespace STOContracts.BindingModels
|
||||
{
|
||||
public class WorkDurationBindingModel : IWorkDurationModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public int Duration { get; set; }
|
||||
}
|
||||
}
|
15
Sto/STOContracts/BusinessLogicsContracts/ICarLogic.cs
Normal file
15
Sto/STOContracts/BusinessLogicsContracts/ICarLogic.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using STOContracts.BindingModels;
|
||||
using STOContracts.SearchModels;
|
||||
using STOContracts.ViewModels;
|
||||
|
||||
namespace STOContracts.BusinessLogicsContracts
|
||||
{
|
||||
public interface ICarLogic
|
||||
{
|
||||
List<CarViewModel>? ReadList(CarSearchModel? model);
|
||||
CarViewModel? ReadElement(CarSearchModel? model);
|
||||
bool Create(CarBindingModel model);
|
||||
bool Update(CarBindingModel model);
|
||||
bool Delete(CarBindingModel model);
|
||||
}
|
||||
}
|
15
Sto/STOContracts/BusinessLogicsContracts/IEmployerLogic.cs
Normal file
15
Sto/STOContracts/BusinessLogicsContracts/IEmployerLogic.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using STOContracts.BindingModels;
|
||||
using STOContracts.SearchModels;
|
||||
using STOContracts.ViewModels;
|
||||
|
||||
namespace STOContracts.BusinessLogicsContracts
|
||||
{
|
||||
public interface IEmployerLogic
|
||||
{
|
||||
List<EmployerViewModel>? ReadList(EmployerSearchModel? model);
|
||||
EmployerViewModel? ReadElement(EmployerSearchModel? model);
|
||||
bool Create(EmployerBindingModel model);
|
||||
bool Update(EmployerBindingModel model);
|
||||
bool Delete(EmployerBindingModel model);
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
using STOContracts.BindingModels;
|
||||
using STOContracts.SearchModels;
|
||||
using STOContracts.ViewModels;
|
||||
|
||||
namespace STOContracts.BusinessLogicsContracts
|
||||
{
|
||||
public interface IMaintenanceLogic
|
||||
{
|
||||
List<MaintenanceViewModel>? ReadList(MaintenanceSearchModel? model);
|
||||
MaintenanceViewModel? ReadElement(MaintenanceSearchModel? model);
|
||||
bool Create(MaintenanceBindingModel model);
|
||||
bool Update(MaintenanceBindingModel model);
|
||||
bool Delete(MaintenanceBindingModel model);
|
||||
}
|
||||
}
|
13
Sto/STOContracts/BusinessLogicsContracts/IReportLogic.cs
Normal file
13
Sto/STOContracts/BusinessLogicsContracts/IReportLogic.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using STOContracts.BindingModels;
|
||||
using STOContracts.ViewModels;
|
||||
|
||||
namespace STOContracts.BusinessLogicsContracts
|
||||
{
|
||||
public interface IReportLogic
|
||||
{
|
||||
List<ReportViewModel> GetSpares(ReportBindingModel model);
|
||||
void SaveToWordFile(ReportBindingModel model);
|
||||
void SaveToExcelFile(ReportBindingModel model);
|
||||
void SaveToPdfFile(ReportBindingModel model);
|
||||
}
|
||||
}
|
15
Sto/STOContracts/BusinessLogicsContracts/IServiceLogic.cs
Normal file
15
Sto/STOContracts/BusinessLogicsContracts/IServiceLogic.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using STOContracts.BindingModels;
|
||||
using STOContracts.SearchModels;
|
||||
using STOContracts.ViewModels;
|
||||
|
||||
namespace STOContracts.BusinessLogicsContracts
|
||||
{
|
||||
public interface IServiceLogic
|
||||
{
|
||||
List<ServiceViewModel>? ReadList(ServiceSearchModel? model);
|
||||
ServiceViewModel? ReadElement(ServiceSearchModel? model);
|
||||
bool Create(ServiceBindingModel model);
|
||||
bool Update(ServiceBindingModel model);
|
||||
bool Delete(ServiceBindingModel model);
|
||||
}
|
||||
}
|
15
Sto/STOContracts/BusinessLogicsContracts/ISpareLogic.cs
Normal file
15
Sto/STOContracts/BusinessLogicsContracts/ISpareLogic.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using STOContracts.BindingModels;
|
||||
using STOContracts.SearchModels;
|
||||
using STOContracts.ViewModels;
|
||||
|
||||
namespace STOContracts.BusinessLogicsContracts
|
||||
{
|
||||
public interface ISpareLogic
|
||||
{
|
||||
List<SpareViewModel>? ReadList(SpareSearchModel? model);
|
||||
SpareViewModel? ReadElement(SpareSearchModel? model);
|
||||
bool Create(SpareBindingModel model);
|
||||
bool Update(SpareBindingModel model);
|
||||
bool Delete(SpareBindingModel model);
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
using STOContracts.BindingModels;
|
||||
using STOContracts.SearchModels;
|
||||
using STOContracts.ViewModels;
|
||||
|
||||
namespace STOContracts.BusinessLogicsContracts
|
||||
{
|
||||
public interface IStorekeeperLogic
|
||||
{
|
||||
List<StorekeeperViewModel>? ReadList(StorekeeperSearchModel? model);
|
||||
StorekeeperViewModel? ReadElement(StorekeeperSearchModel? model);
|
||||
bool Create(StorekeeperBindingModel model);
|
||||
bool Update(StorekeeperBindingModel model);
|
||||
bool Delete(StorekeeperBindingModel model);
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
using STOContracts.BindingModels;
|
||||
using STOContracts.SearchModels;
|
||||
using STOContracts.ViewModels;
|
||||
|
||||
namespace STOContracts.BusinessLogicsContracts
|
||||
{
|
||||
public interface IWorkDurationLogic
|
||||
{
|
||||
List<WorkDurationViewModel>? ReadList(WorkDurationSearchModel? model);
|
||||
WorkDurationViewModel? ReadElement(WorkDurationSearchModel? model);
|
||||
bool Create(WorkDurationBindingModel model);
|
||||
bool Update(WorkDurationBindingModel model);
|
||||
bool Delete(WorkDurationBindingModel model);
|
||||
}
|
||||
}
|
15
Sto/STOContracts/BusinessLogicsContracts/IWorkLogic.cs
Normal file
15
Sto/STOContracts/BusinessLogicsContracts/IWorkLogic.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using STOContracts.BindingModels;
|
||||
using STOContracts.SearchModels;
|
||||
using STOContracts.ViewModels;
|
||||
|
||||
namespace STOContracts.BusinessLogicsContracts
|
||||
{
|
||||
public interface IWorkLogic
|
||||
{
|
||||
List<WorkViewModel>? ReadList(WorkSearchModel? model);
|
||||
WorkViewModel? ReadElement(WorkSearchModel? model);
|
||||
bool Create(WorkBindingModel model);
|
||||
bool Update(WorkBindingModel model);
|
||||
bool Delete(WorkBindingModel model);
|
||||
}
|
||||
}
|
13
Sto/STOContracts/STOContracts.csproj
Normal file
13
Sto/STOContracts/STOContracts.csproj
Normal file
@ -0,0 +1,13 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\STODataModels\STODataModels.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
10
Sto/STOContracts/SearchModels/CarSearchModel.cs
Normal file
10
Sto/STOContracts/SearchModels/CarSearchModel.cs
Normal file
@ -0,0 +1,10 @@
|
||||
namespace STOContracts.SearchModels
|
||||
{
|
||||
public class CarSearchModel
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
public string? Brand { get; set; }
|
||||
public string? Model { get; set; }
|
||||
public string? VIN { get; set; }
|
||||
}
|
||||
}
|
10
Sto/STOContracts/SearchModels/EmployerSearchModel.cs
Normal file
10
Sto/STOContracts/SearchModels/EmployerSearchModel.cs
Normal file
@ -0,0 +1,10 @@
|
||||
namespace STOContracts.SearchModels
|
||||
{
|
||||
public class EmployerSearchModel
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
public string? Login { get; set; }
|
||||
public string? Password { get; set; }
|
||||
public string? Email { get; set; }
|
||||
}
|
||||
}
|
10
Sto/STOContracts/SearchModels/MaintenanceSearchModel.cs
Normal file
10
Sto/STOContracts/SearchModels/MaintenanceSearchModel.cs
Normal file
@ -0,0 +1,10 @@
|
||||
namespace STOContracts.SearchModels
|
||||
{
|
||||
public class MaintenanceSearchModel
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
public int? EmployerId { get; set; }
|
||||
public double? Cost { get; set; }
|
||||
public DateTime? Date { get; set; }
|
||||
}
|
||||
}
|
8
Sto/STOContracts/SearchModels/ServiceSearchModel.cs
Normal file
8
Sto/STOContracts/SearchModels/ServiceSearchModel.cs
Normal file
@ -0,0 +1,8 @@
|
||||
namespace STOContracts.SearchModels
|
||||
{
|
||||
public class ServiceSearchModel
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
public string? ServiceDescription { get; set; }
|
||||
}
|
||||
}
|
13
Sto/STOContracts/SearchModels/SpareSearchModel.cs
Normal file
13
Sto/STOContracts/SearchModels/SpareSearchModel.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using STODataModels.Models;
|
||||
|
||||
namespace STOContracts.SearchModels
|
||||
{
|
||||
public class SpareSearchModel
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
|
||||
public string? Name { get; set; }
|
||||
|
||||
public double? Price { get; set; }
|
||||
}
|
||||
}
|
15
Sto/STOContracts/SearchModels/StorekeeperSearchModel.cs
Normal file
15
Sto/STOContracts/SearchModels/StorekeeperSearchModel.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using STODataModels.Models;
|
||||
|
||||
namespace STOContracts.SearchModels
|
||||
{
|
||||
public class StorekeeperSearchModel
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
|
||||
public string? Login { get; set; }
|
||||
|
||||
public string? Password { get; set; }
|
||||
|
||||
public string? Email { get; set; }
|
||||
}
|
||||
}
|
11
Sto/STOContracts/SearchModels/WorkDurationSearchModel.cs
Normal file
11
Sto/STOContracts/SearchModels/WorkDurationSearchModel.cs
Normal file
@ -0,0 +1,11 @@
|
||||
using STODataModels.Models;
|
||||
|
||||
namespace STOContracts.SearchModels
|
||||
{
|
||||
public class WorkDurationSearchModel
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
|
||||
public int? Duration { get; set; }
|
||||
}
|
||||
}
|
24
Sto/STOContracts/SearchModels/WorkSearchModel.cs
Normal file
24
Sto/STOContracts/SearchModels/WorkSearchModel.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using STODataModels.Models;
|
||||
|
||||
namespace STOContracts.SearchModels
|
||||
{
|
||||
public class WorkSearchModel
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
|
||||
public string? Title { get; set; }
|
||||
|
||||
public double? Price { get; set; }
|
||||
|
||||
public int? StorekeeperId { get; set; }
|
||||
|
||||
public int? DurationId { get; set; }
|
||||
|
||||
public DateTime? DateTo { get; set; }
|
||||
|
||||
public DateTime? DateFrom { get; set; }
|
||||
public Dictionary<int, (ISpareModel, int)>? WorkSpares { get; set; }
|
||||
|
||||
public Dictionary<int, (IMaintenanceModel, int)>? WorkMaintenances { get; set; }
|
||||
}
|
||||
}
|
18
Sto/STOContracts/StoragesContracts/ICarStorage.cs
Normal file
18
Sto/STOContracts/StoragesContracts/ICarStorage.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using STOContracts.BindingModels;
|
||||
using STOContracts.SearchModels;
|
||||
using STOContracts.ViewModels;
|
||||
|
||||
namespace STOContracts.StoragesContracts
|
||||
{
|
||||
public interface ICarStorage
|
||||
{
|
||||
List<CarViewModel> GetFullList();
|
||||
List<CarViewModel> GetFilteredList(CarSearchModel model);
|
||||
CarViewModel? GetElement(CarSearchModel model);
|
||||
CarViewModel? Insert(CarBindingModel model);
|
||||
CarViewModel? Update(CarBindingModel model);
|
||||
CarViewModel? Delete(CarBindingModel model);
|
||||
|
||||
|
||||
}
|
||||
}
|
16
Sto/STOContracts/StoragesContracts/IEmployerStorage.cs
Normal file
16
Sto/STOContracts/StoragesContracts/IEmployerStorage.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using STOContracts.BindingModels;
|
||||
using STOContracts.SearchModels;
|
||||
using STOContracts.ViewModels;
|
||||
|
||||
namespace STOContracts.StoragesContracts
|
||||
{
|
||||
public interface IEmployerStorage
|
||||
{
|
||||
List<EmployerViewModel> GetFullList();
|
||||
List<EmployerViewModel> GetFilteredList(EmployerSearchModel model);
|
||||
EmployerViewModel? GetElement(EmployerSearchModel model);
|
||||
EmployerViewModel? Insert(EmployerBindingModel model);
|
||||
EmployerViewModel? Update(EmployerBindingModel model);
|
||||
EmployerViewModel? Delete(EmployerBindingModel model);
|
||||
}
|
||||
}
|
16
Sto/STOContracts/StoragesContracts/IMaintenanceStorage.cs
Normal file
16
Sto/STOContracts/StoragesContracts/IMaintenanceStorage.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using STOContracts.BindingModels;
|
||||
using STOContracts.SearchModels;
|
||||
using STOContracts.ViewModels;
|
||||
|
||||
namespace STOContracts.StoragesContracts
|
||||
{
|
||||
public interface IMaintenanceStorage
|
||||
{
|
||||
List<MaintenanceViewModel> GetFullList();
|
||||
List<MaintenanceViewModel> GetFilteredList(MaintenanceSearchModel model);
|
||||
MaintenanceViewModel? GetElement(MaintenanceSearchModel model);
|
||||
MaintenanceViewModel? Insert(MaintenanceBindingModel model);
|
||||
MaintenanceViewModel? Update(MaintenanceBindingModel model);
|
||||
MaintenanceViewModel? Delete(MaintenanceBindingModel model);
|
||||
}
|
||||
}
|
16
Sto/STOContracts/StoragesContracts/IServiceStorage.cs
Normal file
16
Sto/STOContracts/StoragesContracts/IServiceStorage.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using STOContracts.BindingModels;
|
||||
using STOContracts.SearchModels;
|
||||
using STOContracts.ViewModels;
|
||||
|
||||
namespace STOContracts.StoragesContracts
|
||||
{
|
||||
public interface IServiceStorage
|
||||
{
|
||||
List<ServiceViewModel> GetFullList();
|
||||
List<ServiceViewModel> GetFilteredList(ServiceSearchModel model);
|
||||
ServiceViewModel? GetElement(ServiceSearchModel model);
|
||||
ServiceViewModel? Insert(ServiceBindingModel model);
|
||||
ServiceViewModel? Update(ServiceBindingModel model);
|
||||
ServiceViewModel? Delete(ServiceBindingModel model);
|
||||
}
|
||||
}
|
16
Sto/STOContracts/StoragesContracts/ISpareStorage.cs
Normal file
16
Sto/STOContracts/StoragesContracts/ISpareStorage.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using STOContracts.BindingModels;
|
||||
using STOContracts.SearchModels;
|
||||
using STOContracts.ViewModels;
|
||||
|
||||
namespace STOContracts.StoragesContracts
|
||||
{
|
||||
public interface ISpareStorage
|
||||
{
|
||||
List<SpareViewModel> GetFullList();
|
||||
List<SpareViewModel> GetFilteredList(SpareSearchModel model);
|
||||
SpareViewModel? GetElement(SpareSearchModel model);
|
||||
SpareViewModel? Insert(SpareBindingModel model);
|
||||
SpareViewModel? Update(SpareBindingModel model);
|
||||
SpareViewModel? Delete(SpareBindingModel model);
|
||||
}
|
||||
}
|
16
Sto/STOContracts/StoragesContracts/IStorekeeperStorage.cs
Normal file
16
Sto/STOContracts/StoragesContracts/IStorekeeperStorage.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using STOContracts.BindingModels;
|
||||
using STOContracts.SearchModels;
|
||||
using STOContracts.ViewModels;
|
||||
|
||||
namespace STOContracts.StoragesContracts
|
||||
{
|
||||
public interface IStorekeeperStorage
|
||||
{
|
||||
List<StorekeeperViewModel> GetFullList();
|
||||
List<StorekeeperViewModel> GetFilteredList(StorekeeperSearchModel model);
|
||||
StorekeeperViewModel? GetElement(StorekeeperSearchModel model);
|
||||
StorekeeperViewModel? Insert(StorekeeperBindingModel model);
|
||||
StorekeeperViewModel? Update(StorekeeperBindingModel model);
|
||||
StorekeeperViewModel? Delete(StorekeeperBindingModel model);
|
||||
}
|
||||
}
|
16
Sto/STOContracts/StoragesContracts/IWorkDurationStorage.cs
Normal file
16
Sto/STOContracts/StoragesContracts/IWorkDurationStorage.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using STOContracts.BindingModels;
|
||||
using STOContracts.SearchModels;
|
||||
using STOContracts.ViewModels;
|
||||
|
||||
namespace STOContracts.StoragesContracts
|
||||
{
|
||||
public interface IWorkDurationStorage
|
||||
{
|
||||
List<WorkDurationViewModel> GetFullList();
|
||||
List<WorkDurationViewModel> GetFilteredList(WorkDurationSearchModel model);
|
||||
WorkDurationViewModel? GetElement(WorkDurationSearchModel model);
|
||||
WorkDurationViewModel? Insert(WorkDurationBindingModel model);
|
||||
WorkDurationViewModel? Update(WorkDurationBindingModel model);
|
||||
WorkDurationViewModel? Delete(WorkDurationBindingModel model);
|
||||
}
|
||||
}
|
16
Sto/STOContracts/StoragesContracts/IWorkStorage.cs
Normal file
16
Sto/STOContracts/StoragesContracts/IWorkStorage.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using STOContracts.BindingModels;
|
||||
using STOContracts.SearchModels;
|
||||
using STOContracts.ViewModels;
|
||||
|
||||
namespace STOContracts.StoragesContracts
|
||||
{
|
||||
public interface IWorkStorage
|
||||
{
|
||||
List<WorkViewModel> GetFullList();
|
||||
List<WorkViewModel> GetFilteredList(WorkSearchModel model);
|
||||
WorkViewModel? GetElement(WorkSearchModel model);
|
||||
WorkViewModel? Insert(WorkBindingModel model);
|
||||
WorkViewModel? Update(WorkBindingModel model);
|
||||
WorkViewModel? Delete(WorkBindingModel model);
|
||||
}
|
||||
}
|
20
Sto/STOContracts/ViewModels/CarViewModel.cs
Normal file
20
Sto/STOContracts/ViewModels/CarViewModel.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using STODataModels.Models;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace STOContracts.ViewModels
|
||||
{
|
||||
public class CarViewModel : ICarModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
[DisplayName("Название бренда")]
|
||||
public string Brand { get; set; } = string.Empty;
|
||||
|
||||
[DisplayName("Название модели")]
|
||||
public string Model { get; set; } = string.Empty;
|
||||
|
||||
[DisplayName("VIN номер")]
|
||||
public string VIN { get; set; } = string.Empty;
|
||||
public Dictionary<int, (ISpareModel, int)> CarSpares { get; set; } = new();
|
||||
}
|
||||
}
|
16
Sto/STOContracts/ViewModels/EmployerViewModel.cs
Normal file
16
Sto/STOContracts/ViewModels/EmployerViewModel.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using STODataModels.Models;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace STOContracts.ViewModels
|
||||
{
|
||||
public class EmployerViewModel : IEmployerModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
[DisplayName("Логин")]
|
||||
public string Login { get; set; } = string.Empty;
|
||||
[DisplayName("Пароль")]
|
||||
public string Password { get; set; } = string.Empty;
|
||||
[DisplayName("Почта")]
|
||||
public string Email { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
16
Sto/STOContracts/ViewModels/MaintenanceViewModel.cs
Normal file
16
Sto/STOContracts/ViewModels/MaintenanceViewModel.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using STODataModels.Models;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace STOContracts.ViewModels
|
||||
{
|
||||
public class MaintenanceViewModel : IMaintenanceModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int EmployerId { get; set; }
|
||||
[DisplayName("Стоимость")]
|
||||
public double Cost { get; set; }
|
||||
[DisplayName("Дата создания")]
|
||||
public DateTime DateCreate { get; set; }
|
||||
public Dictionary<int, (ICarModel, int)> MaintenanceCars { get; set; } = new();
|
||||
}
|
||||
}
|
15
Sto/STOContracts/ViewModels/ReportViewModel.cs
Normal file
15
Sto/STOContracts/ViewModels/ReportViewModel.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace STOContracts.ViewModels
|
||||
{
|
||||
public class ReportViewModel
|
||||
{
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
public List<string> Spares { get; set; } = new();
|
||||
}
|
||||
}
|
12
Sto/STOContracts/ViewModels/ServiceViewModel.cs
Normal file
12
Sto/STOContracts/ViewModels/ServiceViewModel.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using STODataModels.Models;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace STOContracts.ViewModels
|
||||
{
|
||||
public class ServiceViewModel : IServiceModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
[DisplayName("Описание сервиса")]
|
||||
public string ServiceDescription { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
15
Sto/STOContracts/ViewModels/SpareViewModel.cs
Normal file
15
Sto/STOContracts/ViewModels/SpareViewModel.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using STODataModels.Models;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace STOContracts.ViewModels
|
||||
{
|
||||
public class SpareViewModel : ISpareModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
[DisplayName("Название")]
|
||||
public string Name { get; set; } = String.Empty;
|
||||
[DisplayName("Цена")]
|
||||
public double Price { get; set; }
|
||||
}
|
||||
}
|
16
Sto/STOContracts/ViewModels/StorekeeperViewModel.cs
Normal file
16
Sto/STOContracts/ViewModels/StorekeeperViewModel.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using STODataModels.Models;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace STOContracts.ViewModels
|
||||
{
|
||||
public class StorekeeperViewModel : IStorekeeperModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
[DisplayName("Логин")]
|
||||
public string Login { get; set; } = String.Empty;
|
||||
[DisplayName("Пароль")]
|
||||
public string Password { get; set; } = String.Empty;
|
||||
[DisplayName("Почта")]
|
||||
public string Email { get; set; } = String.Empty;
|
||||
}
|
||||
}
|
12
Sto/STOContracts/ViewModels/WorkDurationViewModel.cs
Normal file
12
Sto/STOContracts/ViewModels/WorkDurationViewModel.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using STODataModels.Models;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace STOContracts.ViewModels
|
||||
{
|
||||
public class WorkDurationViewModel : IWorkDurationModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
[DisplayName("Длительность")]
|
||||
public int Duration { get; set; }
|
||||
}
|
||||
}
|
24
Sto/STOContracts/ViewModels/WorkViewModel.cs
Normal file
24
Sto/STOContracts/ViewModels/WorkViewModel.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using STODataModels.Models;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace STOContracts.ViewModels
|
||||
{
|
||||
public class WorkViewModel : IWorkModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
[DisplayName("Название")]
|
||||
public string Title { get; set; } = String.Empty;
|
||||
[DisplayName("Цена")]
|
||||
public double Price { get; set; }
|
||||
public int DurationId { get; set; }
|
||||
public int StorekeeperId { get; set; }
|
||||
|
||||
public DateTime Date { get; set; } = DateTime.Now;
|
||||
|
||||
public Dictionary<int, (ISpareModel, int)> WorkSpares { get; set; } = new();
|
||||
|
||||
public Dictionary<int, (IMaintenanceModel, int)> WorkMaintences { get; set; } = new();
|
||||
|
||||
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user