сделала contracts
This commit is contained in:
parent
2dc266ad03
commit
40ba0f646b
CarCenter
CarCenterContracts
BindingModels
BusinessLogicsContracts
CarCenterContracts.csprojSearchModels
StoragesContracts
ViewModels
CarCenterDataModels/Models
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using CarCenterDataModels.Models;
|
||||||
|
|
||||||
namespace CarCenterContracts.BindingModels
|
namespace CarCenterContracts.BindingModels
|
||||||
{
|
{
|
||||||
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using CarCenterDataModels.Models;
|
||||||
|
|
||||||
namespace CarCenterContracts.BindingModels
|
namespace CarCenterContracts.BindingModels
|
||||||
{
|
{
|
||||||
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using CarCenterDataModels.Models;
|
||||||
|
|
||||||
namespace CarCenterContracts.BindingModels
|
namespace CarCenterContracts.BindingModels
|
||||||
{
|
{
|
||||||
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using CarCenterDataModels.Models;
|
||||||
|
|
||||||
namespace CarCenterContracts.BindingModels
|
namespace CarCenterContracts.BindingModels
|
||||||
{
|
{
|
||||||
|
@ -0,0 +1,20 @@
|
|||||||
|
using CarCenterContracts.BindingModels;
|
||||||
|
using CarCenterContracts.ViewModels;
|
||||||
|
using CarCenterContracts.SearchModels;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace CarCenterContracts.BusinessLogicsContracts
|
||||||
|
{
|
||||||
|
public interface IAdministratorLogic
|
||||||
|
{
|
||||||
|
List<AdministratorViewModel>? ReadList(AdministratorSearchModel? model);
|
||||||
|
AdministratorViewModel? ReadElement(AdministratorSearchModel model);
|
||||||
|
bool Create(AdministratorBindingModel model);
|
||||||
|
bool Update(AdministratorBindingModel model);
|
||||||
|
bool Delete(AdministratorBindingModel model);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
using CarCenterContracts.BindingModels;
|
||||||
|
using CarCenterContracts.SearchModels;
|
||||||
|
using CarCenterContracts.ViewModels;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace CarCenterContracts.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,22 @@
|
|||||||
|
using CarCenterContracts.BindingModels;
|
||||||
|
using CarCenterContracts.SearchModels;
|
||||||
|
using CarCenterContracts.ViewModels;
|
||||||
|
using CarCenterDataModels.Models;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace CarCenterContracts.BusinessLogicsContracts
|
||||||
|
{
|
||||||
|
public interface IEquipmentLogic
|
||||||
|
{
|
||||||
|
List<EquipmentViewModel>? ReadList(EquipmentSearchModel? model);
|
||||||
|
EquipmentViewModel? ReadElement(EquipmentSearchModel model);
|
||||||
|
bool AddDinnerToRoom(EquipmentSearchModel model, IEquipmentModel dinner);
|
||||||
|
bool Create(EquipmentBindingModel model);
|
||||||
|
bool Update(EquipmentBindingModel model);
|
||||||
|
bool Delete(EquipmentBindingModel model);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
using CarCenterContracts.BindingModels;
|
||||||
|
using CarCenterContracts.SearchModels;
|
||||||
|
using CarCenterContracts.ViewModels;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace CarCenterContracts.BusinessLogicsContracts
|
||||||
|
{
|
||||||
|
public interface IInspectionLogic
|
||||||
|
{
|
||||||
|
List<InspectionViewModel>? ReadList(InspectionSearchModel? model);
|
||||||
|
InspectionViewModel? ReadElement(InspectionSearchModel model);
|
||||||
|
bool Create(InspectionBindingModel model);
|
||||||
|
bool Update(InspectionBindingModel model);
|
||||||
|
bool Delete(InspectionBindingModel model);
|
||||||
|
}
|
||||||
|
}
|
@ -6,13 +6,6 @@
|
|||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="BusinessLogicsContracts\" />
|
|
||||||
<Folder Include="SearchModels\" />
|
|
||||||
<Folder Include="StoragesContracts\" />
|
|
||||||
<Folder Include="ViewModels\" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\CarCenterDataModels\CarCenterDataModels.csproj" />
|
<ProjectReference Include="..\CarCenterDataModels\CarCenterDataModels.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@ -0,0 +1,17 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace CarCenterContracts.SearchModels
|
||||||
|
{
|
||||||
|
public class AdministratorSearchModel
|
||||||
|
{
|
||||||
|
public int? Id { get; set; }
|
||||||
|
public string? AdministratorFIO { get; set; }
|
||||||
|
public string? AdministratorLogin { get; set; }
|
||||||
|
public string? AdministratorEmail { get; set; }
|
||||||
|
public string? AdministratorPassword { get; set; }
|
||||||
|
}
|
||||||
|
}
|
16
CarCenter/CarCenterContracts/SearchModels/CarSearchModel.cs
Normal file
16
CarCenter/CarCenterContracts/SearchModels/CarSearchModel.cs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace CarCenterContracts.SearchModels
|
||||||
|
{
|
||||||
|
public class CarSearchModel
|
||||||
|
{
|
||||||
|
public int? Id { get; set; }
|
||||||
|
public string? BrandCar { get; set; }
|
||||||
|
public string? Model { get; set; }
|
||||||
|
public int? AdministratorId { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace CarCenterContracts.SearchModels
|
||||||
|
{
|
||||||
|
public class EquipmentSearchModel
|
||||||
|
{
|
||||||
|
public int? Id { get; set; }
|
||||||
|
public string? EquipmentName { get; set; }
|
||||||
|
public int? AdministratorId { get; set; }
|
||||||
|
public int? PreSaleWorkId { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
using CarCenterDataModels.Models;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace CarCenterContracts.SearchModels
|
||||||
|
{
|
||||||
|
public class InspectionSearchModel
|
||||||
|
{
|
||||||
|
public int? Id { get; set; }
|
||||||
|
public string? InspectionName { get; set; }
|
||||||
|
public DateTime? InspectionDate { get; set; }
|
||||||
|
public int? AdministratorId { get; set; }
|
||||||
|
public int? EmployeeId { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
using CarCenterContracts.BindingModels;
|
||||||
|
using CarCenterContracts.SearchModels;
|
||||||
|
using CarCenterContracts.ViewModels;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace CarCenterContracts.StoragesContracts
|
||||||
|
{
|
||||||
|
public interface IAdministratorStorage
|
||||||
|
{
|
||||||
|
List<AdministratorViewModel> GetFullList();
|
||||||
|
|
||||||
|
List<AdministratorViewModel> GetFilteredList(AdministratorSearchModel model);
|
||||||
|
|
||||||
|
AdministratorViewModel? GetElement(AdministratorSearchModel model);
|
||||||
|
|
||||||
|
AdministratorViewModel? Insert(AdministratorBindingModel model);
|
||||||
|
|
||||||
|
AdministratorViewModel? Update(AdministratorBindingModel model);
|
||||||
|
|
||||||
|
AdministratorViewModel? Delete(AdministratorBindingModel model);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
using CarCenterContracts.BindingModels;
|
||||||
|
using CarCenterContracts.SearchModels;
|
||||||
|
using CarCenterContracts.ViewModels;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace CarCenterContracts.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,26 @@
|
|||||||
|
using CarCenterContracts.BindingModels;
|
||||||
|
using CarCenterContracts.SearchModels;
|
||||||
|
using CarCenterContracts.ViewModels;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace CarCenterContracts.StoragesContracts
|
||||||
|
{
|
||||||
|
public interface IEquipmentStorage
|
||||||
|
{
|
||||||
|
List<EquipmentViewModel> GetFullList();
|
||||||
|
|
||||||
|
List<EquipmentViewModel> GetFilteredList(EquipmentSearchModel model);
|
||||||
|
|
||||||
|
EquipmentViewModel? GetElement(EquipmentSearchModel model);
|
||||||
|
|
||||||
|
EquipmentViewModel? Insert(EquipmentBindingModel model);
|
||||||
|
|
||||||
|
EquipmentViewModel? Update(EquipmentBindingModel model);
|
||||||
|
|
||||||
|
EquipmentViewModel? Delete(EquipmentBindingModel model);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
using CarCenterContracts.BindingModels;
|
||||||
|
using CarCenterContracts.SearchModels;
|
||||||
|
using CarCenterContracts.ViewModels;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace CarCenterContracts.StoragesContracts
|
||||||
|
{
|
||||||
|
public interface IInspectionStorage
|
||||||
|
{
|
||||||
|
List<InspectionViewModel> GetFullList();
|
||||||
|
|
||||||
|
List<InspectionViewModel> GetFilteredList(InspectionSearchModel model);
|
||||||
|
|
||||||
|
InspectionViewModel? GetElement(InspectionSearchModel model);
|
||||||
|
|
||||||
|
InspectionViewModel? Insert(InspectionBindingModel model);
|
||||||
|
|
||||||
|
InspectionViewModel? Update(InspectionBindingModel model);
|
||||||
|
|
||||||
|
InspectionViewModel? Delete(InspectionBindingModel model);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
using CarCenterDataModels.Models;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace CarCenterContracts.ViewModels
|
||||||
|
{
|
||||||
|
public class AdministratorViewModel : IAdministratorModel
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
[DisplayName("ФИО администратора")]
|
||||||
|
public string AdministratorFIO { get; } = string.Empty;
|
||||||
|
|
||||||
|
[DisplayName("Телефон администратора")]
|
||||||
|
public string AdministratorNumber { get; } = string.Empty;
|
||||||
|
|
||||||
|
[DisplayName("Логин администратора")]
|
||||||
|
public string AdministratorLogin { get; } = string.Empty;
|
||||||
|
|
||||||
|
[DisplayName("Mail администратора")]
|
||||||
|
public string AdministratorEmail { get; } = string.Empty;
|
||||||
|
|
||||||
|
[DisplayName("Пароль администратора")]
|
||||||
|
public string AdministratorPassword { get; } = string.Empty;
|
||||||
|
}
|
||||||
|
}
|
22
CarCenter/CarCenterContracts/ViewModels/CarViewModel.cs
Normal file
22
CarCenter/CarCenterContracts/ViewModels/CarViewModel.cs
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
using CarCenterDataModels.Models;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace CarCenterContracts.ViewModels
|
||||||
|
{
|
||||||
|
public class CarViewModel : ICarModel
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
[DisplayName("Бренд машины")]
|
||||||
|
public string BrandCar { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
[DisplayName("Модель машины")]
|
||||||
|
public string Model { get; set; } = string.Empty;
|
||||||
|
public int AdministratorId { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
using CarCenterDataModels.Models;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace CarCenterContracts.ViewModels
|
||||||
|
{
|
||||||
|
public class EquipmentViewModel : IEquipmentModel
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
[DisplayName("Название комплектации")]
|
||||||
|
public string EquipmentName { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
[DisplayName("Цена комплектации")]
|
||||||
|
public double EquipmentPrice { get; set; }
|
||||||
|
public int AdministratorId { get; set; }
|
||||||
|
public int? PreSaleWorkId { get; set; }
|
||||||
|
public Dictionary<int, ICarModel> EquipmentCars { get; set; } = new();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
using CarCenterDataModels.Models;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace CarCenterContracts.ViewModels
|
||||||
|
{
|
||||||
|
public class InspectionViewModel : IInspectionModel
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
[DisplayName("Название осмотра")]
|
||||||
|
public string InspectionName { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
[DisplayName("Дата осмотра")]
|
||||||
|
public DateTime? InspectionDate { get; set; }
|
||||||
|
public int AdministratorId { get; set; }
|
||||||
|
public int? EmployeeId { get; set; }
|
||||||
|
public Dictionary<int, ICarModel> InspectionCars { get; set; } = new();
|
||||||
|
}
|
||||||
|
}
|
@ -9,7 +9,7 @@ namespace CarCenterDataModels.Models
|
|||||||
public interface IInspectionModel : IId
|
public interface IInspectionModel : IId
|
||||||
{
|
{
|
||||||
string InspectionName { get; }
|
string InspectionName { get; }
|
||||||
DateTime InspectionDate { get; }
|
DateTime? InspectionDate { get; }
|
||||||
int AdministratorId { get; }
|
int AdministratorId { get; }
|
||||||
int? EmployeeId { get; }
|
int? EmployeeId { get; }
|
||||||
public Dictionary<int, ICarModel> InspectionCars { get; }
|
public Dictionary<int, ICarModel> InspectionCars { get; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user