+ contracts
This commit is contained in:
parent
7a774b8c86
commit
3998ed4bf8
@ -6,7 +6,7 @@ namespace CarCenterContracts.BindingModels
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public DateTime SaleDate { get; set; } = DateTime.Empty;
|
||||
public DateTime? SaleDate { get; set; } = DateTime.Now;
|
||||
|
||||
public string SalePrice { get; set; } = string.Empty;
|
||||
|
||||
|
@ -0,0 +1,17 @@
|
||||
using CarCenterContracts.BindingModels;
|
||||
using CarCenterContracts.SearchModels;
|
||||
using CarCenterContracts.ViewModels;
|
||||
using CarCenterDataModels.Models;
|
||||
|
||||
namespace CarCenterContracts.BusinessLogicsContracts
|
||||
{
|
||||
public interface IEmployeeLogic
|
||||
{
|
||||
List<EmployeeViewModel>? ReadList(EmployeeSearchModel? model);
|
||||
EmployeeViewModel? ReadElement(EmployeeSearchModel model);
|
||||
bool AddSaleToEmployee(EmployeeSearchModel model, ISaleModel Sale);
|
||||
bool Create(EmployeeBindingModel model);
|
||||
bool Update(EmployeeBindingModel model);
|
||||
bool Delete(EmployeeBindingModel model);
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
using CarCenterContracts.BindingModels;
|
||||
using CarCenterContracts.SearchModels;
|
||||
using CarCenterContracts.ViewModels;
|
||||
|
||||
namespace CarCenterContracts.BusinessLogicsContracts
|
||||
{
|
||||
public interface IManagerLogic
|
||||
{
|
||||
List<ManagerViewModel>? ReadList(ManagerSearchModel? model);
|
||||
ManagerViewModel? ReadElement(ManagerSearchModel model);
|
||||
bool Create(ManagerBindingModel model);
|
||||
bool Update(ManagerBindingModel model);
|
||||
bool Delete(ManagerBindingModel model);
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
using CarCenterContracts.BindingModels;
|
||||
using CarCenterContracts.SearchModels;
|
||||
using CarCenterContracts.ViewModels;
|
||||
using CarCenterDataModels.Models;
|
||||
|
||||
namespace CarCenterContracts.BusinessLogicsContracts
|
||||
{
|
||||
public interface IPreSaleWorkLogic
|
||||
{
|
||||
List<PreSaleWorkModel>? ReadList(PreSaleWorkSearchModel? model);
|
||||
PreSaleWorkModel? ReadElement(PreSaleWorkSearchModel model);
|
||||
bool AddSaleToPreSaleWork(PreSaleWorkSearchModel model, ISaleModel Sale);
|
||||
bool Create(PreSaleWorkBindingModel model);
|
||||
bool Update(PreSaleWorkBindingModel model);
|
||||
bool Delete(PreSaleWorkBindingModel model);
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
using CarCenterContracts.BindingModels;
|
||||
using CarCenterContracts.SearchModels;
|
||||
using CarCenterContracts.ViewModels;
|
||||
|
||||
namespace CarCenterContracts.BusinessLogicsContracts
|
||||
{
|
||||
public interface ISaleLogic
|
||||
{
|
||||
List<SaleViewModel>? ReadList(SaleSearchModel? model);
|
||||
SaleViewModel? ReadElement(SaleSearchModel model);
|
||||
bool Create(SaleBindingModel model);
|
||||
bool Update(SaleBindingModel model);
|
||||
bool Delete(SaleBindingModel model);
|
||||
}
|
||||
}
|
@ -6,6 +6,10 @@
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\CarCenterDataModels\CarCenterDataModels.csproj" />
|
||||
</ItemGroup>
|
||||
|
@ -0,0 +1,12 @@
|
||||
namespace CarCenterContracts.SearchModels
|
||||
{
|
||||
public class EmployeeSearchModel
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
public string? EmployeeFIO { get; set; }
|
||||
public string? Specialization { get; set; }
|
||||
public int? ManagerId { get; set; }
|
||||
public DateTime? DateFrom { get; set; }
|
||||
public DateTime? DateTo { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
namespace CarCenterContracts.SearchModels
|
||||
{
|
||||
public class ManagerSearchModel
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
public string? ManagerFIO { get; set; }
|
||||
public string? ManagerLogin { get; set; }
|
||||
public string? ManagerEmail { get; set; }
|
||||
public string? ManagerPassword { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
namespace CarCenterContracts.SearchModels
|
||||
{
|
||||
public class PreSaleWorkSearchModel
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
public string? PreSaleWorkType { get; set; }
|
||||
public int? ManagerId { get; set; }
|
||||
public DateTime? DateFrom { get; set; }
|
||||
public DateTime? DateTo { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
namespace CarCenterContracts.SearchModels
|
||||
{
|
||||
public class SaleSearchModel
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
public DateTime? SaleDate { get; set; }
|
||||
public int? ManagerId { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
using CarCenterContracts.BindingModels;
|
||||
using CarCenterContracts.SearchModels;
|
||||
using CarCenterContracts.ViewModels;
|
||||
|
||||
namespace CarCenterContracts.StoragesContracts
|
||||
{
|
||||
public interface IEmployeeStorage
|
||||
{
|
||||
List<EmployeeViewModel> GetFullList();
|
||||
|
||||
List<EmployeeViewModel> GetFilteredList(EmployeeSearchModel model);
|
||||
|
||||
EmployeeViewModel? GetElement(EmployeeSearchModel model);
|
||||
|
||||
EmployeeViewModel? Insert(EmployeeBindingModel model);
|
||||
|
||||
EmployeeViewModel? Update(EmployeeBindingModel model);
|
||||
|
||||
EmployeeViewModel? Delete(EmployeeBindingModel model);
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
using CarCenterContracts.BindingModels;
|
||||
using CarCenterContracts.SearchModels;
|
||||
using CarCenterContracts.ViewModels;
|
||||
|
||||
namespace CarCenterContracts.StoragesContracts
|
||||
{
|
||||
public interface IManagerStorage
|
||||
{
|
||||
List<ManagerViewModel> GetFullList();
|
||||
|
||||
List<ManagerViewModel> GetFilteredList(ManagerSearchModel model);
|
||||
|
||||
ManagerViewModel? GetElement(ManagerSearchModel model);
|
||||
|
||||
ManagerViewModel? Insert(ManagerBindingModel model);
|
||||
|
||||
ManagerViewModel? Update(ManagerBindingModel model);
|
||||
|
||||
ManagerViewModel? Delete(ManagerBindingModel model);
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
using CarCenterContracts.BindingModels;
|
||||
using CarCenterContracts.SearchModels;
|
||||
using CarCenterContracts.ViewModels;
|
||||
|
||||
namespace CarCenterContracts.StoragesContracts
|
||||
{
|
||||
public interface IPreSaleWorkStorage
|
||||
{
|
||||
List<PreSaleWorkModel> GetFullList();
|
||||
|
||||
List<PreSaleWorkModel> GetFilteredList(PreSaleWorkSearchModel model);
|
||||
|
||||
PreSaleWorkModel? GetElement(PreSaleWorkSearchModel model);
|
||||
|
||||
PreSaleWorkModel? Insert(PreSaleWorkBindingModel model);
|
||||
|
||||
PreSaleWorkModel? Update(PreSaleWorkBindingModel model);
|
||||
|
||||
PreSaleWorkModel? Delete(PreSaleWorkBindingModel model);
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
using CarCenterContracts.BindingModels;
|
||||
using CarCenterContracts.SearchModels;
|
||||
using CarCenterContracts.ViewModels;
|
||||
|
||||
namespace CarCenterContracts.StoragesContracts
|
||||
{
|
||||
public interface ISaleStorage
|
||||
{
|
||||
List<SaleViewModel> GetFullList();
|
||||
|
||||
List<SaleViewModel> GetFilteredList(SaleSearchModel model);
|
||||
|
||||
SaleViewModel? GetElement(SaleSearchModel model);
|
||||
|
||||
SaleViewModel? Insert(SaleBindingModel model);
|
||||
|
||||
SaleViewModel? Update(SaleBindingModel model);
|
||||
|
||||
SaleViewModel? Delete(SaleBindingModel model);
|
||||
}
|
||||
}
|
29
CarCenter/CarCenterContracts/ViewModels/EmployeeViewModel.cs
Normal file
29
CarCenter/CarCenterContracts/ViewModels/EmployeeViewModel.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using CarCenterDataModels.Models;
|
||||
using System.ComponentModel;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace CarCenterContracts.ViewModels
|
||||
{
|
||||
public class EmployeeViewModel : IEmployeeModel
|
||||
{
|
||||
[DisplayName("ФИО Сотрудника")]
|
||||
public string EmployeeFIO { get; set; } = string.Empty;
|
||||
|
||||
[DisplayName("Специализация")]
|
||||
public string Specialization { get; set; } = string.Empty;
|
||||
|
||||
public int ManagerId { get; set; }
|
||||
|
||||
public int Id { get; set; }
|
||||
public Dictionary<int, ISaleModel> EmployeeSales { get; set; } = new();
|
||||
public Dictionary<int, IEmployeeBookingModel> EmployeeEmployeeBooking { get; set; }
|
||||
|
||||
public EmployeeViewModel() { }
|
||||
|
||||
[JsonConstructor]
|
||||
public EmployeeViewModel(Dictionary<int, SaleViewModel> EmployeeSales)
|
||||
{
|
||||
this.EmployeeSales = EmployeeSales.ToDictionary(x => x.Key, x => x.Value as ISaleModel);
|
||||
}
|
||||
}
|
||||
}
|
25
CarCenter/CarCenterContracts/ViewModels/ManagerViewModel.cs
Normal file
25
CarCenter/CarCenterContracts/ViewModels/ManagerViewModel.cs
Normal file
@ -0,0 +1,25 @@
|
||||
using CarCenterDataModels.Models;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace CarCenterContracts.ViewModels
|
||||
{
|
||||
public class ManagerViewModel : IManagerModel
|
||||
{
|
||||
[DisplayName("ФИО менеджера")]
|
||||
public string ManagerFIO { get; set; } = string.Empty;
|
||||
|
||||
[DisplayName("Номер телефона менеджера")]
|
||||
public string ManagerNumber { get; set; } = string.Empty;
|
||||
|
||||
[DisplayName("Логин менеджера")]
|
||||
public string ManagerLogin { get; set; } = string.Empty;
|
||||
|
||||
[DisplayName("Эл. почта менеджера")]
|
||||
public string ManagerEmail { get; set; } = string.Empty;
|
||||
|
||||
[DisplayName("Пароль менеджера")]
|
||||
public string ManagerPassword { get; set; } = string.Empty;
|
||||
|
||||
public int Id { get; set; }
|
||||
}
|
||||
}
|
31
CarCenter/CarCenterContracts/ViewModels/PreSaleWorkModel.cs
Normal file
31
CarCenter/CarCenterContracts/ViewModels/PreSaleWorkModel.cs
Normal file
@ -0,0 +1,31 @@
|
||||
using CarCenterDataModels.Models;
|
||||
using System.ComponentModel;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace CarCenterContracts.ViewModels
|
||||
{
|
||||
public class PreSaleWorkModel : IPreSaleWorkModel
|
||||
{
|
||||
[DisplayName("Тип предпродажной работы")]
|
||||
public string PreSaleWorkType { get; set; } = string.Empty;
|
||||
|
||||
[DisplayName("Стоимость предпродажной работы")]
|
||||
public double PreSaleWorkPrice { get; set; }
|
||||
|
||||
public int ManagerId { get; set; }
|
||||
|
||||
public int Id { get; set; }
|
||||
|
||||
public Dictionary<int, ISaleModel> PreSaleWorkSale { get; set; } = new();
|
||||
public Dictionary<int, ICarModel> PreSaleWorkCars { get; set; } = new();
|
||||
|
||||
public PreSaleWorkModel() { }
|
||||
|
||||
[JsonConstructor]
|
||||
public PreSaleWorkModel(Dictionary<int, SaleViewModel> PreSaleWorkSales, Dictionary<int, CarViewModel> PreSaleWorkCars)
|
||||
{
|
||||
this.PreSaleWorkSale = PreSaleWorkSales.ToDictionary(x => x.Key, x => x.Value as ISaleModel);
|
||||
this.PreSaleWorkCars = PreSaleWorkCars.ToDictionary(x => x.Key, x => x.Value as ICarModel);
|
||||
}
|
||||
}
|
||||
}
|
18
CarCenter/CarCenterContracts/ViewModels/SaleViewModel.cs
Normal file
18
CarCenter/CarCenterContracts/ViewModels/SaleViewModel.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using CarCenterDataModels.Models;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace CarCenterContracts.ViewModels
|
||||
{
|
||||
public class SaleViewModel : ISaleModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
[DisplayName("Дата продажи")]
|
||||
public DateTime? SaleDate { get; set; }
|
||||
|
||||
[DisplayName("Цена продажи")]
|
||||
public string SalePrice { get; set; } = string.Empty;
|
||||
|
||||
public int ManagerId { get; set; }
|
||||
}
|
||||
}
|
@ -2,7 +2,7 @@
|
||||
{
|
||||
public interface ISaleModel : IId
|
||||
{
|
||||
DateTime SaleDate { get; }
|
||||
DateTime? SaleDate { get; }
|
||||
string SalePrice { get; }
|
||||
int ManagerId { get; }
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user