diff --git a/BeautySaloon/BeautySaloon.sln b/BeautySaloon/BeautySaloon.sln index 346cccf..4c7abb8 100644 --- a/BeautySaloon/BeautySaloon.sln +++ b/BeautySaloon/BeautySaloon.sln @@ -3,9 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.3.32929.385 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BeautySaloonView", "BeautySaloonView\BeautySaloonView.csproj", "{4098AFA1-025D-4259-A4FD-4546A533DE60}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BeautySaloonView", "BeautySaloonView\BeautySaloonView.csproj", "{4098AFA1-025D-4259-A4FD-4546A533DE60}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BeautySaloonDataModels", "BeautySaloonDataModels\BeautySaloonDataModels.csproj", "{A83AC6FD-F6BD-4BD2-AC69-3BB5BA30FF7D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BeautySaloonDataModels", "BeautySaloonDataModels\BeautySaloonDataModels.csproj", "{A83AC6FD-F6BD-4BD2-AC69-3BB5BA30FF7D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BeautySaloonContracts", "BeautySaloonContracts\BeautySaloonContracts.csproj", "{7494D3AF-2581-4128-9183-BB87A9DC4B10}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -21,6 +23,10 @@ Global {A83AC6FD-F6BD-4BD2-AC69-3BB5BA30FF7D}.Debug|Any CPU.Build.0 = Debug|Any CPU {A83AC6FD-F6BD-4BD2-AC69-3BB5BA30FF7D}.Release|Any CPU.ActiveCfg = Release|Any CPU {A83AC6FD-F6BD-4BD2-AC69-3BB5BA30FF7D}.Release|Any CPU.Build.0 = Release|Any CPU + {7494D3AF-2581-4128-9183-BB87A9DC4B10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7494D3AF-2581-4128-9183-BB87A9DC4B10}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7494D3AF-2581-4128-9183-BB87A9DC4B10}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7494D3AF-2581-4128-9183-BB87A9DC4B10}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/BeautySaloon/BeautySaloonContracts/BeautySaloonContracts.csproj b/BeautySaloon/BeautySaloonContracts/BeautySaloonContracts.csproj new file mode 100644 index 0000000..d72f66d --- /dev/null +++ b/BeautySaloon/BeautySaloonContracts/BeautySaloonContracts.csproj @@ -0,0 +1,17 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + diff --git a/BeautySaloon/BeautySaloonContracts/BindingModels/ClientBindingModel.cs b/BeautySaloon/BeautySaloonContracts/BindingModels/ClientBindingModel.cs new file mode 100644 index 0000000..9d3b169 --- /dev/null +++ b/BeautySaloon/BeautySaloonContracts/BindingModels/ClientBindingModel.cs @@ -0,0 +1,13 @@ +using BeautySaloonDataModels; + +namespace BeautySaloonContracts.BindingModels +{ + public class ClientBindingModel : IClientModel + { + public int Id { get; set; } + public string Name { get; set; } = string.Empty; + public string Surname { get; set; } = string.Empty; + public string Patronymic { get; set; } = string.Empty; + public string Phone { get; set; } = string.Empty; + } +} diff --git a/BeautySaloon/BeautySaloonContracts/BindingModels/EmployeeBindingModel.cs b/BeautySaloon/BeautySaloonContracts/BindingModels/EmployeeBindingModel.cs new file mode 100644 index 0000000..b9a28fd --- /dev/null +++ b/BeautySaloon/BeautySaloonContracts/BindingModels/EmployeeBindingModel.cs @@ -0,0 +1,14 @@ +using BeautySaloonDataModels; + +namespace BeautySaloonContracts.BindingModels +{ + public class EmployeeBindingModel : IEmployeeModel + { + public int Id { get; set; } + public string Name { get; set; } = string.Empty; + public string Surname { get; set; } = string.Empty; + public string Patronymic { get; set; } = string.Empty; + public string Phone { get; set; } = string.Empty; + public int PositionId { get; set; } + } +} diff --git a/BeautySaloon/BeautySaloonContracts/BindingModels/OrderBindingModel.cs b/BeautySaloon/BeautySaloonContracts/BindingModels/OrderBindingModel.cs new file mode 100644 index 0000000..f951e04 --- /dev/null +++ b/BeautySaloon/BeautySaloonContracts/BindingModels/OrderBindingModel.cs @@ -0,0 +1,18 @@ +using BeautySaloonDataModels; + +namespace BeautySaloonContracts.BindingModels +{ + public class OrderBindingModel : IOrderModel + { + public int Id { get; set; } + public DateTime Date { get; set; } = DateTime.Now; + public double Sum { get; set; } + public int ClientId { get; set; } + public int EmployeeId { get; set; } + public Dictionary OrderServices + { + get; + set; + } = new(); + } +} diff --git a/BeautySaloon/BeautySaloonContracts/BindingModels/PositionBindingModel.cs b/BeautySaloon/BeautySaloonContracts/BindingModels/PositionBindingModel.cs new file mode 100644 index 0000000..42f8437 --- /dev/null +++ b/BeautySaloon/BeautySaloonContracts/BindingModels/PositionBindingModel.cs @@ -0,0 +1,11 @@ + +using BeautySaloonDataModels; + +namespace BeautySaloonContracts.BindingModels +{ + public class PositionBindingModel : IPositionModel + { + public int Id { get; set; } + public string Name { get; set; } = string.Empty; + } +} diff --git a/BeautySaloon/BeautySaloonContracts/BindingModels/ServiceBindingModel.cs b/BeautySaloon/BeautySaloonContracts/BindingModels/ServiceBindingModel.cs new file mode 100644 index 0000000..de25086 --- /dev/null +++ b/BeautySaloon/BeautySaloonContracts/BindingModels/ServiceBindingModel.cs @@ -0,0 +1,11 @@ +using BeautySaloonDataModels; + +namespace BeautySaloonContracts.BindingModels +{ + public class ServiceBindingModel : IServiceModel + { + public int Id { get; set; } + public string Name { get; set; } = string.Empty; + public double Price { get; set; } + } +} diff --git a/BeautySaloon/BeautySaloonContracts/BusinessLogicsContracts/IClientLogic.cs b/BeautySaloon/BeautySaloonContracts/BusinessLogicsContracts/IClientLogic.cs new file mode 100644 index 0000000..8899956 --- /dev/null +++ b/BeautySaloon/BeautySaloonContracts/BusinessLogicsContracts/IClientLogic.cs @@ -0,0 +1,19 @@ +using BeautySaloonContracts.BindingModels; +using BeautySaloonContracts.SearchModels; +using BeautySaloonContracts.ViewModels; + +namespace BeautySaloonContracts.BusinessLogicsContracts +{ + public interface IClientLogic + { + List? ReadList(ClientSearchModel? model); + + ClientViewModel? ReadElement(ClientSearchModel model); + + bool Create(ClientBindingModel model); + + bool Update(ClientBindingModel model); + + bool Delete(ClientBindingModel model); + } +} diff --git a/BeautySaloon/BeautySaloonContracts/BusinessLogicsContracts/IEmployeeLogic.cs b/BeautySaloon/BeautySaloonContracts/BusinessLogicsContracts/IEmployeeLogic.cs new file mode 100644 index 0000000..de2e93d --- /dev/null +++ b/BeautySaloon/BeautySaloonContracts/BusinessLogicsContracts/IEmployeeLogic.cs @@ -0,0 +1,19 @@ +using BeautySaloonContracts.BindingModels; +using BeautySaloonContracts.SearchModels; +using BeautySaloonContracts.ViewModels; + +namespace BeautySaloonContracts.BusinessLogicsContracts +{ + public interface IEmployeeLogic + { + List? ReadList(EmployeeSearchModel? model); + + EmployeeViewModel? ReadElement(EmployeeSearchModel model); + + bool Create(EmployeeBindingModel model); + + bool Update(EmployeeBindingModel model); + + bool Delete(EmployeeBindingModel model); + } +} diff --git a/BeautySaloon/BeautySaloonContracts/BusinessLogicsContracts/IOrderLogic.cs b/BeautySaloon/BeautySaloonContracts/BusinessLogicsContracts/IOrderLogic.cs new file mode 100644 index 0000000..8c365eb --- /dev/null +++ b/BeautySaloon/BeautySaloonContracts/BusinessLogicsContracts/IOrderLogic.cs @@ -0,0 +1,13 @@ +using BeautySaloonContracts.BindingModels; +using BeautySaloonContracts.SearchModels; +using BeautySaloonContracts.ViewModels; + +namespace BeautySaloonContracts.BusinessLogicsContracts +{ + public interface IOrderLogic + { + List? ReadList(OrderSearchModel? model); + + bool CreateOrder(OrderBindingModel model); + } +} diff --git a/BeautySaloon/BeautySaloonContracts/BusinessLogicsContracts/IPositionLogic.cs b/BeautySaloon/BeautySaloonContracts/BusinessLogicsContracts/IPositionLogic.cs new file mode 100644 index 0000000..123c6ff --- /dev/null +++ b/BeautySaloon/BeautySaloonContracts/BusinessLogicsContracts/IPositionLogic.cs @@ -0,0 +1,19 @@ +using BeautySaloonContracts.BindingModels; +using BeautySaloonContracts.SearchModels; +using BeautySaloonContracts.ViewModels; + +namespace BeautySaloonContracts.BusinessLogicsContracts +{ + public interface IPositionLogic + { + List? ReadList(PositionSearchModel? model); + + PositionViewModel? ReadElement(PositionSearchModel model); + + bool Create(PositionBindingModel model); + + bool Update(PositionBindingModel model); + + bool Delete(PositionBindingModel model); + } +} diff --git a/BeautySaloon/BeautySaloonContracts/BusinessLogicsContracts/IServiceLogic.cs b/BeautySaloon/BeautySaloonContracts/BusinessLogicsContracts/IServiceLogic.cs new file mode 100644 index 0000000..d51b64b --- /dev/null +++ b/BeautySaloon/BeautySaloonContracts/BusinessLogicsContracts/IServiceLogic.cs @@ -0,0 +1,19 @@ +using BeautySaloonContracts.BindingModels; +using BeautySaloonContracts.SearchModels; +using BeautySaloonContracts.ViewModels; + +namespace BeautySaloonContracts.BusinessLogicsContracts +{ + public interface IServiceLogic + { + List? ReadList(ServiceSearchModel? model); + + ServiceViewModel? ReadElement(ServiceSearchModel model); + + bool Create(ServiceBindingModel model); + + bool Update(ServiceBindingModel model); + + bool Delete(ServiceBindingModel model); + } +} diff --git a/BeautySaloon/BeautySaloonContracts/SearchModels/ClientSearchModel.cs b/BeautySaloon/BeautySaloonContracts/SearchModels/ClientSearchModel.cs new file mode 100644 index 0000000..f875bb0 --- /dev/null +++ b/BeautySaloon/BeautySaloonContracts/SearchModels/ClientSearchModel.cs @@ -0,0 +1,11 @@ +namespace BeautySaloonContracts.SearchModels +{ + public class ClientSearchModel + { + public int? Id { get; set; } + public string? Name { get; set; } + public string? Surname { get; set; } + public string? Patronymic { get; set; } + public string? Phone { get; set; } + } +} diff --git a/BeautySaloon/BeautySaloonContracts/SearchModels/EmployeeSearchModel.cs b/BeautySaloon/BeautySaloonContracts/SearchModels/EmployeeSearchModel.cs new file mode 100644 index 0000000..1a1762e --- /dev/null +++ b/BeautySaloon/BeautySaloonContracts/SearchModels/EmployeeSearchModel.cs @@ -0,0 +1,12 @@ +namespace BeautySaloonContracts.SearchModels +{ + public class EmployeeSearchModel + { + public int? Id { get; set; } + public string? Name { get; set; } + public string? Surname { get; set; } + public string? Patronymic { get; set; } + public string? Phone { get; set; } + public int? PositionId { get; set; } + } +} diff --git a/BeautySaloon/BeautySaloonContracts/SearchModels/OrderSearchModel.cs b/BeautySaloon/BeautySaloonContracts/SearchModels/OrderSearchModel.cs new file mode 100644 index 0000000..a1b519c --- /dev/null +++ b/BeautySaloon/BeautySaloonContracts/SearchModels/OrderSearchModel.cs @@ -0,0 +1,10 @@ +namespace BeautySaloonContracts.SearchModels +{ + public class OrderSearchModel + { + public int? Id { get; set; } + public DateTime? Date { get; set; } + public int? Client_Id { get; set; } + public int? Employee_Id { get; set; } + } +} diff --git a/BeautySaloon/BeautySaloonContracts/SearchModels/PositionSearchModel.cs b/BeautySaloon/BeautySaloonContracts/SearchModels/PositionSearchModel.cs new file mode 100644 index 0000000..2b6f618 --- /dev/null +++ b/BeautySaloon/BeautySaloonContracts/SearchModels/PositionSearchModel.cs @@ -0,0 +1,8 @@ +namespace BeautySaloonContracts.SearchModels +{ + public class PositionSearchModel + { + public int? Id { get; set; } + public string? Name { get; set; } + } +} diff --git a/BeautySaloon/BeautySaloonContracts/SearchModels/ServiceSearchModel.cs b/BeautySaloon/BeautySaloonContracts/SearchModels/ServiceSearchModel.cs new file mode 100644 index 0000000..88f8cc5 --- /dev/null +++ b/BeautySaloon/BeautySaloonContracts/SearchModels/ServiceSearchModel.cs @@ -0,0 +1,8 @@ +namespace BeautySaloonContracts.SearchModels +{ + public class ServiceSearchModel + { + public int? Id { get; set; } + public string? Name { get; set; } + } +} diff --git a/BeautySaloon/BeautySaloonContracts/ViewModels/ClientViewModel.cs b/BeautySaloon/BeautySaloonContracts/ViewModels/ClientViewModel.cs new file mode 100644 index 0000000..cb0de11 --- /dev/null +++ b/BeautySaloon/BeautySaloonContracts/ViewModels/ClientViewModel.cs @@ -0,0 +1,18 @@ +using BeautySaloonDataModels; +using System.ComponentModel; + +namespace BeautySaloonContracts.ViewModels +{ + public class ClientViewModel : IClientModel + { + public int Id { get; set; } + [DisplayName("Имя")] + public string Name { get; set; } = string.Empty; + [DisplayName("Фамилия")] + public string Surname { get; set; } = string.Empty; + [DisplayName("Отчество")] + public string Patronymic { get; set; } = string.Empty; + [DisplayName("Телефон")] + public string Phone { get; set; } = string.Empty; + } +} diff --git a/BeautySaloon/BeautySaloonContracts/ViewModels/EmployeeViewModel.cs b/BeautySaloon/BeautySaloonContracts/ViewModels/EmployeeViewModel.cs new file mode 100644 index 0000000..df015e6 --- /dev/null +++ b/BeautySaloon/BeautySaloonContracts/ViewModels/EmployeeViewModel.cs @@ -0,0 +1,21 @@ +using BeautySaloonDataModels; +using System.ComponentModel; + +namespace BeautySaloonContracts.ViewModels +{ + public class EmployeeViewModel : IEmployeeModel + { + public int Id { get; set; } + public int PositionId { get; set; } + [DisplayName("Должность")] + public string PositionName { get; set; } = string.Empty; + [DisplayName("Имя")] + public string Name { get; set; } = string.Empty; + [DisplayName("Фамилия")] + public string Surname { get; set; } = string.Empty; + [DisplayName("Отчество")] + public string Patronymic { get; set; } = string.Empty; + [DisplayName("Телефон")] + public string Phone { get; set; } = string.Empty; + } +} diff --git a/BeautySaloon/BeautySaloonContracts/ViewModels/OrderViewModel.cs b/BeautySaloon/BeautySaloonContracts/ViewModels/OrderViewModel.cs new file mode 100644 index 0000000..0f249f0 --- /dev/null +++ b/BeautySaloon/BeautySaloonContracts/ViewModels/OrderViewModel.cs @@ -0,0 +1,22 @@ +using BeautySaloonDataModels; +using System.ComponentModel; + +namespace BeautySaloonContracts.ViewModels +{ + public class OrderViewModel : IOrderModel + { + [DisplayName("Номер")] + public int Id { get; set; } + [DisplayName("Дата заказа")] + public DateTime Date { get; set; } = DateTime.Now; + [DisplayName("Сумма")] + public double Sum { get; set; } + public int ClientId { get; set; } + [DisplayName("Клиент")] + public string ClientName { get; set; } = string.Empty; + public int EmployeeId { get; set; } + [DisplayName("Продавец")] + public string EmployeeName { get; set; } = string.Empty; + public Dictionary OrderServices { get; set; } = new(); + } +} diff --git a/BeautySaloon/BeautySaloonContracts/ViewModels/PositionViewModel.cs b/BeautySaloon/BeautySaloonContracts/ViewModels/PositionViewModel.cs new file mode 100644 index 0000000..eb51de7 --- /dev/null +++ b/BeautySaloon/BeautySaloonContracts/ViewModels/PositionViewModel.cs @@ -0,0 +1,12 @@ +using BeautySaloonDataModels; +using System.ComponentModel; + +namespace BeautySaloonContracts.ViewModels +{ + public class PositionViewModel : IPositionModel + { + public int Id { get; set; } + [DisplayName("Должность")] + public string Name { get; set; } = string.Empty; + } +} diff --git a/BeautySaloon/BeautySaloonContracts/ViewModels/ServiceViewModel.cs b/BeautySaloon/BeautySaloonContracts/ViewModels/ServiceViewModel.cs new file mode 100644 index 0000000..35b9dd0 --- /dev/null +++ b/BeautySaloon/BeautySaloonContracts/ViewModels/ServiceViewModel.cs @@ -0,0 +1,14 @@ +using BeautySaloonDataModels; +using System.ComponentModel; + +namespace BeautySaloonContracts.ViewModels +{ + public class ServiceViewModel : IServiceModel + { + public int Id { get; set; } + [DisplayName("Услуга")] + public string Name { get; set; } = string.Empty; + [DisplayName("Цена")] + public double Price { get; set; } + } +} diff --git a/BeautySaloon/BeautySaloonDataModels/Models/IClientModel.cs b/BeautySaloon/BeautySaloonDataModels/IClientModel.cs similarity index 70% rename from BeautySaloon/BeautySaloonDataModels/Models/IClientModel.cs rename to BeautySaloon/BeautySaloonDataModels/IClientModel.cs index f7385c4..5c39baa 100644 --- a/BeautySaloon/BeautySaloonDataModels/Models/IClientModel.cs +++ b/BeautySaloon/BeautySaloonDataModels/IClientModel.cs @@ -1,4 +1,4 @@ -namespace BeautySaloonDataModels.Models +namespace BeautySaloonDataModels { public interface IClientModel { @@ -7,6 +7,5 @@ string Surname { get; } string Patronymic { get; } string Phone { get; } - List Orders { get; } } } diff --git a/BeautySaloon/BeautySaloonDataModels/Models/IEmployeeModel.cs b/BeautySaloon/BeautySaloonDataModels/IEmployeeModel.cs similarity index 84% rename from BeautySaloon/BeautySaloonDataModels/Models/IEmployeeModel.cs rename to BeautySaloon/BeautySaloonDataModels/IEmployeeModel.cs index 2893bb5..7abd71a 100644 --- a/BeautySaloon/BeautySaloonDataModels/Models/IEmployeeModel.cs +++ b/BeautySaloon/BeautySaloonDataModels/IEmployeeModel.cs @@ -1,4 +1,4 @@ -namespace BeautySaloonDataModels.Models +namespace BeautySaloonDataModels { public interface IEmployeeModel { diff --git a/BeautySaloon/BeautySaloonDataModels/Models/IOrderModel.cs b/BeautySaloon/BeautySaloonDataModels/IOrderModel.cs similarity index 58% rename from BeautySaloon/BeautySaloonDataModels/Models/IOrderModel.cs rename to BeautySaloon/BeautySaloonDataModels/IOrderModel.cs index a4ec9a0..b2bbaf2 100644 --- a/BeautySaloon/BeautySaloonDataModels/Models/IOrderModel.cs +++ b/BeautySaloon/BeautySaloonDataModels/IOrderModel.cs @@ -1,4 +1,4 @@ -namespace BeautySaloonDataModels.Models +namespace BeautySaloonDataModels { public interface IOrderModel { @@ -6,6 +6,7 @@ DateTime Date { get; } double Sum { get; } int ClientId { get; } - Dictionary OrderServices { get; } + int EmployeeId { get; } + Dictionary OrderServices { get; } } } diff --git a/BeautySaloon/BeautySaloonDataModels/IPositionModel.cs b/BeautySaloon/BeautySaloonDataModels/IPositionModel.cs new file mode 100644 index 0000000..b6be31e --- /dev/null +++ b/BeautySaloon/BeautySaloonDataModels/IPositionModel.cs @@ -0,0 +1,8 @@ +namespace BeautySaloonDataModels +{ + public interface IPositionModel + { + int Id { get; } + string Name { get; } + } +} diff --git a/BeautySaloon/BeautySaloonDataModels/Models/IServiceModel.cs b/BeautySaloon/BeautySaloonDataModels/IServiceModel.cs similarity index 75% rename from BeautySaloon/BeautySaloonDataModels/Models/IServiceModel.cs rename to BeautySaloon/BeautySaloonDataModels/IServiceModel.cs index 54801f8..a02a44b 100644 --- a/BeautySaloon/BeautySaloonDataModels/Models/IServiceModel.cs +++ b/BeautySaloon/BeautySaloonDataModels/IServiceModel.cs @@ -1,4 +1,4 @@ -namespace BeautySaloonDataModels.Models +namespace BeautySaloonDataModels { public interface IServiceModel { diff --git a/BeautySaloon/BeautySaloonDataModels/Models/IPositionModel.cs b/BeautySaloon/BeautySaloonDataModels/Models/IPositionModel.cs deleted file mode 100644 index b712b80..0000000 --- a/BeautySaloon/BeautySaloonDataModels/Models/IPositionModel.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace BeautySaloonDataModels.Models -{ - public interface IPositionModel - { - int Id { get; } - string Name { get; } - } -}