Merge pull request 'Создание_моделей_и_контрактов' (#2) from Создание_моделей_и_контрактов into main
Reviewed-on: #2
This commit is contained in:
commit
6f306859b9
@ -0,0 +1,24 @@
|
||||
using ServiceStationDataModels.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ServiceStationContracts.BindingModels
|
||||
{
|
||||
public class CarBindingModel : ICarModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public string CarNumber { get; set; } = string.Empty;
|
||||
|
||||
public string CarBrand { get; set; } = string.Empty;
|
||||
|
||||
public int ExecutorId { get; set; }
|
||||
|
||||
public Dictionary<int, IDefectModel> CarDefects { get; set; } = new();
|
||||
|
||||
public Dictionary<int, ITechnicalWorkModel> CarTechnicalWorks { get; set; } = new();
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
using ServiceStationDataModels.Enums;
|
||||
using ServiceStationDataModels.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ServiceStationContracts.BindingModels
|
||||
{
|
||||
public class DefectBindingModel : IDefectModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public string DefectType { get; set; } = string.Empty;
|
||||
|
||||
public double DefectPrice { get; set; }
|
||||
|
||||
public int ExecutorId { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
using ServiceStationDataModels.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ServiceStationContracts.BindingModels
|
||||
{
|
||||
public class ExecutorBindingModel : IExecutorModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public string ExecutorFIO { get; set; } = string.Empty;
|
||||
|
||||
public string ExecutorEmail { get; set; } = string.Empty;
|
||||
|
||||
public string ExecutorPassword { get; set; } = string.Empty;
|
||||
|
||||
public string ExecutorNumber { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
using ServiceStationDataModels.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ServiceStationContracts.BindingModels
|
||||
{
|
||||
public class TechnicalWorkBindingModel : ITechnicalWorkModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public string WorkType { get; set; } = string.Empty;
|
||||
|
||||
public DateTime DateLastWork { get; set; } = DateTime.Now;
|
||||
|
||||
public double WorkPrice { get; set; }
|
||||
|
||||
public int ExecutorId { get; set; }
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
using ServiceStationContracts.BindingModels;
|
||||
using ServiceStationContracts.SearchModels;
|
||||
using ServiceStationContracts.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ServiceStationContracts.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);
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
using ServiceStationContracts.BindingModels;
|
||||
using ServiceStationContracts.SearchModels;
|
||||
using ServiceStationContracts.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ServiceStationContracts.BusinessLogicsContracts
|
||||
{
|
||||
public interface IDefectLogic
|
||||
{
|
||||
List<DefectViewModel>? ReadList(DefectSearchModel? model);
|
||||
DefectViewModel? ReadElement(DefectSearchModel? model);
|
||||
|
||||
bool Create(DefectBindingModel model);
|
||||
bool Update(DefectBindingModel model);
|
||||
bool Delete(DefectBindingModel model);
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
using ServiceStationContracts.BindingModels;
|
||||
using ServiceStationContracts.SearchModels;
|
||||
using ServiceStationContracts.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ServiceStationContracts.BusinessLogicsContracts
|
||||
{
|
||||
public interface IExecutorLogic
|
||||
{
|
||||
List<ExecutorViewModel>? ReadList(ExecutorSearchModel? model);
|
||||
ExecutorViewModel? ReadElement(ExecutorSearchModel? model);
|
||||
|
||||
bool Create(ExecutorBindingModel model);
|
||||
bool Update(ExecutorBindingModel model);
|
||||
bool Delete(ExecutorBindingModel model);
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
using ServiceStationContracts.BindingModels;
|
||||
using ServiceStationContracts.SearchModels;
|
||||
using ServiceStationContracts.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ServiceStationContracts.BusinessLogicsContracts
|
||||
{
|
||||
public interface ITechnicalWorkLogic
|
||||
{
|
||||
List<TechnicalWorkViewModel>? ReadList(TechnicalWorkSearchModel? model);
|
||||
TechnicalWorkViewModel? ReadElement(TechnicalWorkSearchModel? model);
|
||||
|
||||
bool Create(TechnicalWorkBindingModel model);
|
||||
bool Update(TechnicalWorkBindingModel model);
|
||||
bool Delete(TechnicalWorkBindingModel model);
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ServiceStationContracts.SearchModels
|
||||
{
|
||||
public class CarSearchModel
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
public string? CarNumber { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ServiceStationContracts.SearchModels
|
||||
{
|
||||
public class DefectSearchModel
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
public string? DefectType { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ServiceStationContracts.SearchModels
|
||||
{
|
||||
public class ExecutorSearchModel
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
public string? ExecutorFIO { get; set; }
|
||||
public string? ExecutorEmail { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ServiceStationContracts.SearchModels
|
||||
{
|
||||
public class TechnicalWorkSearchModel
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
public string? WorkType { get; set; }
|
||||
}
|
||||
}
|
@ -7,11 +7,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="BindingModels\" />
|
||||
<Folder Include="BusinessLogicsContracts\" />
|
||||
<Folder Include="SearchModels\" />
|
||||
<Folder Include="StoragesContracts\" />
|
||||
<Folder Include="ViewModels\" />
|
||||
<ProjectReference Include="..\ServiceStationDataModels\ServiceStationDataModels.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@ -0,0 +1,22 @@
|
||||
using ServiceStationContracts.BindingModels;
|
||||
using ServiceStationContracts.SearchModels;
|
||||
using ServiceStationContracts.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ServiceStationContracts.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);
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
using ServiceStationContracts.BindingModels;
|
||||
using ServiceStationContracts.SearchModels;
|
||||
using ServiceStationContracts.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ServiceStationContracts.StoragesContracts
|
||||
{
|
||||
public interface IDefectStorage
|
||||
{
|
||||
List<DefectViewModel> GetFullList();
|
||||
List<DefectViewModel> GetFilteredList(DefectSearchModel model);
|
||||
|
||||
DefectViewModel? GetElement(DefectSearchModel model);
|
||||
DefectViewModel? Insert(DefectBindingModel model);
|
||||
DefectViewModel? Update(DefectBindingModel model);
|
||||
DefectViewModel? Delete(DefectBindingModel model);
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
using ServiceStationContracts.BindingModels;
|
||||
using ServiceStationContracts.SearchModels;
|
||||
using ServiceStationContracts.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ServiceStationContracts.StoragesContracts
|
||||
{
|
||||
public interface IExecutorStorage
|
||||
{
|
||||
List<ExecutorViewModel> GetFullList();
|
||||
List<ExecutorViewModel> GetFilteredList(ExecutorSearchModel model);
|
||||
|
||||
ExecutorViewModel? GetElement(ExecutorSearchModel model);
|
||||
ExecutorViewModel? Insert(ExecutorBindingModel model);
|
||||
ExecutorViewModel? Update(ExecutorBindingModel model);
|
||||
ExecutorViewModel? Delete(ExecutorBindingModel model);
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
using ServiceStationContracts.BindingModels;
|
||||
using ServiceStationContracts.SearchModels;
|
||||
using ServiceStationContracts.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ServiceStationContracts.StoragesContracts
|
||||
{
|
||||
public interface ITechnicalWorkStorage
|
||||
{
|
||||
List<TechnicalWorkViewModel> GetFullList();
|
||||
List<TechnicalWorkViewModel> GetFilteredList(TechnicalWorkSearchModel model);
|
||||
|
||||
TechnicalWorkViewModel? GetElement(TechnicalWorkSearchModel model);
|
||||
TechnicalWorkViewModel? Insert(TechnicalWorkBindingModel model);
|
||||
TechnicalWorkViewModel? Update(TechnicalWorkBindingModel model);
|
||||
TechnicalWorkViewModel? Delete(TechnicalWorkBindingModel model);
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
using ServiceStationDataModels.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ServiceStationContracts.ViewModels
|
||||
{
|
||||
public class CarViewModel : ICarModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
[DisplayName("Номер машины")]
|
||||
public string CarNumber { get; set; } = string.Empty;
|
||||
|
||||
[DisplayName("Бренд машины")]
|
||||
public string CarBrand { get; set; } = string.Empty;
|
||||
|
||||
public int ExecutorId { get; set; }
|
||||
|
||||
public Dictionary<int, IDefectModel> CarDefects { get; set; } = new();
|
||||
|
||||
public Dictionary<int, ITechnicalWorkModel> CarTechnicalWorks { get; set; } = new();
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
using ServiceStationDataModels.Enums;
|
||||
using ServiceStationDataModels.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ServiceStationContracts.ViewModels
|
||||
{
|
||||
public class DefectViewModel : IDefectModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
[DisplayName("Тип неисправности")]
|
||||
public string DefectType { get; set; } = string.Empty;
|
||||
|
||||
[DisplayName("Цена неисправности")]
|
||||
public double DefectPrice { get; set; }
|
||||
|
||||
public int ExecutorId { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
using ServiceStationDataModels.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ServiceStationContracts.ViewModels
|
||||
{
|
||||
public class ExecutorViewModel : IExecutorModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
[DisplayName("ФИО исполнителя")]
|
||||
public string ExecutorFIO { get; set; } = string.Empty;
|
||||
[DisplayName("Почти исполнителя(логин)")]
|
||||
public string ExecutorEmail { get; set; } = string.Empty;
|
||||
[DisplayName("Пароль исполнителя")]
|
||||
public string ExecutorPassword { get; set; } = string.Empty;
|
||||
[DisplayName("Номер телефона исполнителя")]
|
||||
public string ExecutorNumber { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
using ServiceStationDataModels.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ServiceStationContracts.ViewModels
|
||||
{
|
||||
public class TechnicalWorkViewModel : ITechnicalWorkModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
[DisplayName("Тип ТО")]
|
||||
public string WorkType { get; set; } = string.Empty;
|
||||
[DisplayName("Дата последнего ТО")]
|
||||
public DateTime DateLastWork { get; set; } = DateTime.Now;
|
||||
[DisplayName("Цена ТО")]
|
||||
public double WorkPrice { get; set; }
|
||||
|
||||
public int ExecutorId { get; set; }
|
||||
}
|
||||
}
|
@ -10,7 +10,6 @@ namespace ServiceStationDataModels.Models
|
||||
public interface IDefectModel : IId
|
||||
{
|
||||
string DefectType { get; }
|
||||
Status DefectStatus { get; }
|
||||
double DefectPrice { get; }
|
||||
int ExecutorId { get; }
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user