добавлены контракты
This commit is contained in:
parent
8705e36039
commit
768f3b6b36
@ -5,6 +5,10 @@ VisualStudioVersion = 17.3.32825.248
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BeautySalon", "BeautySalon.csproj", "{1D636E61-E3F0-4B64-998C-730FC76731F1}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BeautySalonDataModels", "..\BeautySalonDataModels\BeautySalonDataModels.csproj", "{3BE3FEC4-6794-4EA7-83BE-D382996DB168}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BeautySalonContracts", "..\BeauySalonContracts\BeautySalonContracts.csproj", "{8CBBB8D6-5615-417B-82C5-B069EA84AB3C}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@ -15,6 +19,14 @@ Global
|
||||
{1D636E61-E3F0-4B64-998C-730FC76731F1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1D636E61-E3F0-4B64-998C-730FC76731F1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1D636E61-E3F0-4B64-998C-730FC76731F1}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{3BE3FEC4-6794-4EA7-83BE-D382996DB168}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{3BE3FEC4-6794-4EA7-83BE-D382996DB168}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{3BE3FEC4-6794-4EA7-83BE-D382996DB168}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{3BE3FEC4-6794-4EA7-83BE-D382996DB168}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{8CBBB8D6-5615-417B-82C5-B069EA84AB3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{8CBBB8D6-5615-417B-82C5-B069EA84AB3C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{8CBBB8D6-5615-417B-82C5-B069EA84AB3C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{8CBBB8D6-5615-417B-82C5-B069EA84AB3C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
9
BeautySalonDataModels/BeautySalonDataModels.csproj
Normal file
9
BeautySalonDataModels/BeautySalonDataModels.csproj
Normal file
@ -0,0 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
7
BeautySalonDataModels/IId.cs
Normal file
7
BeautySalonDataModels/IId.cs
Normal file
@ -0,0 +1,7 @@
|
||||
namespace BeautySalonDataModels
|
||||
{
|
||||
public interface IId
|
||||
{
|
||||
int Id { get; }
|
||||
}
|
||||
}
|
8
BeautySalonDataModels/Models/IClientModel.cs
Normal file
8
BeautySalonDataModels/Models/IClientModel.cs
Normal file
@ -0,0 +1,8 @@
|
||||
namespace BeautySalonDataModels.Models
|
||||
{
|
||||
public interface IClientModel : IId
|
||||
{
|
||||
string ClientFIO { get; }
|
||||
string PhoneNumber { get; }
|
||||
}
|
||||
}
|
9
BeautySalonDataModels/Models/IMasterModel.cs
Normal file
9
BeautySalonDataModels/Models/IMasterModel.cs
Normal file
@ -0,0 +1,9 @@
|
||||
namespace BeautySalonDataModels.Models
|
||||
{
|
||||
public interface IMasterModel : IId
|
||||
{
|
||||
string MasterFIO { get; }
|
||||
string Specialization { get; }
|
||||
public Dictionary<int, (IServiceModel, int)> MasterServices { get; }
|
||||
}
|
||||
}
|
8
BeautySalonDataModels/Models/IServiceModel.cs
Normal file
8
BeautySalonDataModels/Models/IServiceModel.cs
Normal file
@ -0,0 +1,8 @@
|
||||
namespace BeautySalonDataModels.Models
|
||||
{
|
||||
public interface IServiceModel : IId
|
||||
{
|
||||
string ServiceName { get; }
|
||||
double Cost { get; }
|
||||
}
|
||||
}
|
10
BeautySalonDataModels/Models/IVisitModel.cs
Normal file
10
BeautySalonDataModels/Models/IVisitModel.cs
Normal file
@ -0,0 +1,10 @@
|
||||
namespace BeautySalonDataModels.Models
|
||||
{
|
||||
public interface IVisitModel : IId
|
||||
{
|
||||
DateTime DateOfVisit { get; }
|
||||
int ClientId { get; }
|
||||
int MasterId { get; }
|
||||
int ServiceId { get; }
|
||||
}
|
||||
}
|
13
BeauySalonContracts/BeautySalonContracts.csproj
Normal file
13
BeauySalonContracts/BeautySalonContracts.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="..\BeautySalonDataModels\BeautySalonDataModels.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
11
BeauySalonContracts/BindingModels/ClientBindingModel.cs
Normal file
11
BeauySalonContracts/BindingModels/ClientBindingModel.cs
Normal file
@ -0,0 +1,11 @@
|
||||
using BeautySalonDataModels.Models;
|
||||
|
||||
namespace BeautySalonContracts.BindingModels
|
||||
{
|
||||
public class ClientBindingModel : IClientModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string ClientFIO { get; set; } = string.Empty;
|
||||
public string PhoneNumber { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
11
BeauySalonContracts/BindingModels/MasterBindingModel.cs
Normal file
11
BeauySalonContracts/BindingModels/MasterBindingModel.cs
Normal file
@ -0,0 +1,11 @@
|
||||
using BeautySalonDataModels.Models;
|
||||
|
||||
namespace BeautySalonContracts.BindingModels
|
||||
{
|
||||
public class MasterBindingModel : IMasterModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string MasterFIO { get; set; } = string.Empty;
|
||||
public string Specialization { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
11
BeauySalonContracts/BindingModels/ServiceBindingModel.cs
Normal file
11
BeauySalonContracts/BindingModels/ServiceBindingModel.cs
Normal file
@ -0,0 +1,11 @@
|
||||
using BeautySalonDataModels.Models;
|
||||
|
||||
namespace BeautySalonContracts.BindingModels
|
||||
{
|
||||
public class ServiceBindingModel : IServiceModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string ServiceName { get; set; } = string.Empty;
|
||||
public double Cost { get; set; }
|
||||
}
|
||||
}
|
13
BeauySalonContracts/BindingModels/VisitBindingModel.cs
Normal file
13
BeauySalonContracts/BindingModels/VisitBindingModel.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using BeautySalonDataModels.Models;
|
||||
|
||||
namespace BeautySalonContracts.BindingModels
|
||||
{
|
||||
public class VisitBindingModel : IVisitModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public DateTime DateOfVisit { get; set; }
|
||||
public int ClientId { get; set; }
|
||||
public int MasterId { get; set; }
|
||||
public int ServiceId { get; set; }
|
||||
}
|
||||
}
|
15
BeauySalonContracts/BusinessLogicsContracts/IClientLogic.cs
Normal file
15
BeauySalonContracts/BusinessLogicsContracts/IClientLogic.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using BeautySalonContracts.BindingModels;
|
||||
using BeautySalonContracts.SearchModels;
|
||||
using BeautySalonContracts.ViewModels;
|
||||
|
||||
namespace BeautySalonContracts.BusinessLogicsContracts
|
||||
{
|
||||
public interface IClientLogic
|
||||
{
|
||||
List<ClientViewModel>? ReadList(ClientSearchModel? model);
|
||||
ClientViewModel? ReadElement(ClientSearchModel model);
|
||||
bool Create(ClientBindingModel model);
|
||||
bool Update(ClientBindingModel model);
|
||||
bool Delete(ClientBindingModel model);
|
||||
}
|
||||
}
|
15
BeauySalonContracts/BusinessLogicsContracts/IMasterLogic.cs
Normal file
15
BeauySalonContracts/BusinessLogicsContracts/IMasterLogic.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using BeautySalonContracts.BindingModels;
|
||||
using BeautySalonContracts.SearchModels;
|
||||
using BeautySalonContracts.ViewModels;
|
||||
|
||||
namespace BeautySalonContracts.BusinessLogicsContracts
|
||||
{
|
||||
public interface IMasterLogic
|
||||
{
|
||||
List<MasterViewModel>? ReadList(MasterSearchModel? model);
|
||||
MasterViewModel? ReadElement(MasterSearchModel model);
|
||||
bool Create(MasterBindingModel model);
|
||||
bool Update(MasterBindingModel model);
|
||||
bool Delete(MasterBindingModel model);
|
||||
}
|
||||
}
|
15
BeauySalonContracts/BusinessLogicsContracts/IServiceLogic.cs
Normal file
15
BeauySalonContracts/BusinessLogicsContracts/IServiceLogic.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using BeautySalonContracts.BindingModels;
|
||||
using BeautySalonContracts.SearchModels;
|
||||
using BeautySalonContracts.ViewModels;
|
||||
|
||||
namespace BeautySalonContracts.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
BeauySalonContracts/BusinessLogicsContracts/IVisitLogic.cs
Normal file
15
BeauySalonContracts/BusinessLogicsContracts/IVisitLogic.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using BeautySalonContracts.BindingModels;
|
||||
using BeautySalonContracts.SearchModels;
|
||||
using BeautySalonContracts.ViewModels;
|
||||
|
||||
namespace BeautySalonContracts.BusinessLogicsContracts
|
||||
{
|
||||
public interface IVisitLogic
|
||||
{
|
||||
List<VisitViewModel>? ReadList(VisitSearchModel? model);
|
||||
VisitViewModel? ReadElement(VisitSearchModel model);
|
||||
bool Create(VisitBindingModel model);
|
||||
bool Update(VisitBindingModel model);
|
||||
bool Delete(VisitBindingModel model);
|
||||
}
|
||||
}
|
9
BeauySalonContracts/SearchModels/ClientSearchModel.cs
Normal file
9
BeauySalonContracts/SearchModels/ClientSearchModel.cs
Normal file
@ -0,0 +1,9 @@
|
||||
namespace BeautySalonContracts.SearchModels
|
||||
{
|
||||
public class ClientSearchModel
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
public string? ClientFIO { get; set; }
|
||||
public string? PhoneNumber { get; set; }
|
||||
}
|
||||
}
|
9
BeauySalonContracts/SearchModels/MasterSearchModel.cs
Normal file
9
BeauySalonContracts/SearchModels/MasterSearchModel.cs
Normal file
@ -0,0 +1,9 @@
|
||||
namespace BeautySalonContracts.SearchModels
|
||||
{
|
||||
public class MasterSearchModel
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
public string? MasterFIO { get; set; }
|
||||
public string? Specilization { get; set; }
|
||||
}
|
||||
}
|
8
BeauySalonContracts/SearchModels/ServiceSearchModel.cs
Normal file
8
BeauySalonContracts/SearchModels/ServiceSearchModel.cs
Normal file
@ -0,0 +1,8 @@
|
||||
namespace BeautySalonContracts.SearchModels
|
||||
{
|
||||
public class ServiceSearchModel
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
public string? ServiceName { get; set; }
|
||||
}
|
||||
}
|
7
BeauySalonContracts/SearchModels/VisitSearchModel.cs
Normal file
7
BeauySalonContracts/SearchModels/VisitSearchModel.cs
Normal file
@ -0,0 +1,7 @@
|
||||
namespace BeautySalonContracts.SearchModels
|
||||
{
|
||||
public class VisitSearchModel
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
}
|
||||
}
|
16
BeauySalonContracts/StoragesContracts/IClientStorage.cs
Normal file
16
BeauySalonContracts/StoragesContracts/IClientStorage.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using BeautySalonContracts.BindingModels;
|
||||
using BeautySalonContracts.SearchModels;
|
||||
using BeautySalonContracts.ViewModels;
|
||||
|
||||
namespace BeautySalonContracts.StoragesContracts
|
||||
{
|
||||
public interface IClientStorage
|
||||
{
|
||||
List<ClientViewModel> GetFullList();
|
||||
List<ClientViewModel> GetFilteredList(ClientSearchModel model);
|
||||
ClientViewModel? GetElement(ClientSearchModel model);
|
||||
ClientViewModel? Insert(ClientBindingModel model);
|
||||
ClientViewModel? Update(ClientBindingModel model);
|
||||
ClientViewModel? Delete(ClientBindingModel model);
|
||||
}
|
||||
}
|
16
BeauySalonContracts/StoragesContracts/IMasterStorage.cs
Normal file
16
BeauySalonContracts/StoragesContracts/IMasterStorage.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using BeautySalonContracts.BindingModels;
|
||||
using BeautySalonContracts.SearchModels;
|
||||
using BeautySalonContracts.ViewModels;
|
||||
|
||||
namespace BeautySalonContracts.StoragesContracts
|
||||
{
|
||||
public interface IMasterStorage
|
||||
{
|
||||
List<MasterViewModel> GetFullList();
|
||||
List<MasterViewModel> GetFilteredList(MasterSearchModel model);
|
||||
MasterViewModel? GetElement(MasterSearchModel model);
|
||||
MasterViewModel? Insert(MasterBindingModel model);
|
||||
MasterViewModel? Update(MasterBindingModel model);
|
||||
MasterViewModel? Delete(MasterBindingModel model);
|
||||
}
|
||||
}
|
16
BeauySalonContracts/StoragesContracts/IServiceStorage.cs
Normal file
16
BeauySalonContracts/StoragesContracts/IServiceStorage.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using BeautySalonContracts.BindingModels;
|
||||
using BeautySalonContracts.SearchModels;
|
||||
using BeautySalonContracts.ViewModels;
|
||||
|
||||
namespace BeautySalonContracts.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
BeauySalonContracts/StoragesContracts/IVisitStorage.cs
Normal file
16
BeauySalonContracts/StoragesContracts/IVisitStorage.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using BeautySalonContracts.BindingModels;
|
||||
using BeautySalonContracts.SearchModels;
|
||||
using BeautySalonContracts.ViewModels;
|
||||
|
||||
namespace BeautySalonContracts.StoragesContracts
|
||||
{
|
||||
public interface IVisitStorage
|
||||
{
|
||||
List<VisitViewModel> GetFullList();
|
||||
List<VisitViewModel> GetFilteredList(VisitSearchModel model);
|
||||
VisitViewModel? GetElement(VisitSearchModel model);
|
||||
VisitViewModel? Insert(VisitBindingModel model);
|
||||
VisitViewModel? Update(VisitBindingModel model);
|
||||
VisitViewModel? Delete(VisitBindingModel model);
|
||||
}
|
||||
}
|
14
BeauySalonContracts/ViewModels/ClientViewModel.cs
Normal file
14
BeauySalonContracts/ViewModels/ClientViewModel.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using BeautySalonDataModels.Models;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace BeautySalonContracts.ViewModels
|
||||
{
|
||||
public class ClientViewModel : IClientModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
[DisplayName("ФИО клиента")]
|
||||
public string ClientFIO { get; set; } = string.Empty;
|
||||
[DisplayName("Номер телефона")]
|
||||
public string PhoneNumber { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
15
BeauySalonContracts/ViewModels/MasterViewModel.cs
Normal file
15
BeauySalonContracts/ViewModels/MasterViewModel.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using BeautySalonDataModels.Models;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace BeautySalonContracts.ViewModels
|
||||
{
|
||||
public class MasterViewModel : IMasterModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
[DisplayName("ФИО мастера")]
|
||||
public string MasterFIO { get; set; } = string.Empty;
|
||||
[DisplayName("Специализация")]
|
||||
public string Specialization { get; set; } = string.Empty;
|
||||
public Dictionary<int, (IServiceModel, int)> MasterServices { get; set; } = new();
|
||||
}
|
||||
}
|
14
BeauySalonContracts/ViewModels/ServiceViewModel.cs
Normal file
14
BeauySalonContracts/ViewModels/ServiceViewModel.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using BeautySalonDataModels.Models;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace BeautySalonContracts.ViewModels
|
||||
{
|
||||
public class ServiceViewModel : IServiceModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
[DisplayName("Название услуги")]
|
||||
public string ServiceName { get; set; } = string.Empty;
|
||||
[DisplayName("Цена")]
|
||||
public double Cost { get; set; }
|
||||
}
|
||||
}
|
13
BeauySalonContracts/ViewModels/VisitViewModel.cs
Normal file
13
BeauySalonContracts/ViewModels/VisitViewModel.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using BeautySalonDataModels.Models;
|
||||
|
||||
namespace BeautySalonContracts.ViewModels
|
||||
{
|
||||
public class VisitViewModel : IVisitModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public DateTime DateOfVisit { get; set; }
|
||||
public int ClientId { get; set; }
|
||||
public int MasterId { get; set; }
|
||||
public int ServiceId { get; set; }
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user