diff --git a/SewingFactory/SewingFactory.sln b/SewingFactory/SewingFactory.sln index 1ceeb29..89e29f8 100644 --- a/SewingFactory/SewingFactory.sln +++ b/SewingFactory/SewingFactory.sln @@ -3,7 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.11.35219.272 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SewingFactoryView", "SewingFactoryView\SewingFactoryView.csproj", "{4FD708C9-AC45-40B8-B464-98163FFFD90A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SewingFactoryView", "SewingFactoryView\SewingFactoryView.csproj", "{4FD708C9-AC45-40B8-B464-98163FFFD90A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SewingFactoryDataModels", "SewingFactoryDataModels\SewingFactoryDataModels.csproj", "{35061EB7-0B45-4A96-ACEF-3EA7FEAA57C4}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SewingFactoryContracts", "SewingFactoryContracts\SewingFactoryContracts.csproj", "{D979DF0C-B534-4563-97E5-04389DB2F6B9}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -15,6 +19,14 @@ Global {4FD708C9-AC45-40B8-B464-98163FFFD90A}.Debug|Any CPU.Build.0 = Debug|Any CPU {4FD708C9-AC45-40B8-B464-98163FFFD90A}.Release|Any CPU.ActiveCfg = Release|Any CPU {4FD708C9-AC45-40B8-B464-98163FFFD90A}.Release|Any CPU.Build.0 = Release|Any CPU + {35061EB7-0B45-4A96-ACEF-3EA7FEAA57C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {35061EB7-0B45-4A96-ACEF-3EA7FEAA57C4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {35061EB7-0B45-4A96-ACEF-3EA7FEAA57C4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {35061EB7-0B45-4A96-ACEF-3EA7FEAA57C4}.Release|Any CPU.Build.0 = Release|Any CPU + {D979DF0C-B534-4563-97E5-04389DB2F6B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D979DF0C-B534-4563-97E5-04389DB2F6B9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D979DF0C-B534-4563-97E5-04389DB2F6B9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D979DF0C-B534-4563-97E5-04389DB2F6B9}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/SewingFactory/SewingFactoryContracts/BindingModels/ComponentBindingModel.cs b/SewingFactory/SewingFactoryContracts/BindingModels/ComponentBindingModel.cs new file mode 100644 index 0000000..5c08072 --- /dev/null +++ b/SewingFactory/SewingFactoryContracts/BindingModels/ComponentBindingModel.cs @@ -0,0 +1,18 @@ +using SewingFactoryDataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SewingFactoryContracts.BindingModels +{ + public class ComponentBindingModel : IComponentModel + { + public int Id { get; set; } + + public string ComponentName { get; set; } = string.Empty; + + public double Cost { get; set; } + } +} diff --git a/SewingFactory/SewingFactoryContracts/BindingModels/OrderBindingModel.cs b/SewingFactory/SewingFactoryContracts/BindingModels/OrderBindingModel.cs new file mode 100644 index 0000000..8a2169f --- /dev/null +++ b/SewingFactory/SewingFactoryContracts/BindingModels/OrderBindingModel.cs @@ -0,0 +1,24 @@ +using SewingFactoryDataModels.Enums; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SewingFactoryContracts.BindingModels +{ + public class OrderBindingModel + { + public int TextileID { get; set; } + + public int Count { get; set; } + + public double Sum { get; set; } + + public OrderStatus Status { get; set; } = OrderStatus.Неизвестен; + + DateTime DateCreate { get; set; } = DateTime.Now; + + DateTime? DateImplement { get; set; } + } +} diff --git a/SewingFactory/SewingFactoryContracts/BindingModels/TextileBindingModel.cs b/SewingFactory/SewingFactoryContracts/BindingModels/TextileBindingModel.cs new file mode 100644 index 0000000..9bc4341 --- /dev/null +++ b/SewingFactory/SewingFactoryContracts/BindingModels/TextileBindingModel.cs @@ -0,0 +1,21 @@ +using SewingFactoryDataModels; +using SewingFactoryDataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SewingFactoryContracts.BindingModels +{ + public class TextileBindingModel : ITextileModel + { + public int Id { get; set; } + + public string TextileName { get; set; } = string.Empty; + + public double Price { get; set; } + + public Dictionary TextileComponents { get; set; } = new(); + } +} \ No newline at end of file diff --git a/SewingFactory/SewingFactoryContracts/BusinessLogicContracts/IComponentLogic.cs b/SewingFactory/SewingFactoryContracts/BusinessLogicContracts/IComponentLogic.cs new file mode 100644 index 0000000..6022b60 --- /dev/null +++ b/SewingFactory/SewingFactoryContracts/BusinessLogicContracts/IComponentLogic.cs @@ -0,0 +1,24 @@ +using SewingFactoryContracts.BindingModels; +using SewingFactoryContracts.SearchModels; +using SewingFactoryContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SewingFactoryContracts.BusinessLogicContracts +{ + public interface IComponentLogic + { + List? ReadList(ComponentSearchModel? model); + + ComponentViewModel? ReadElement(ComponentSearchModel model); + + bool Create(ComponentBindingModel model); + + bool Update(ComponentBindingModel model); + + bool Delete(ComponentBindingModel model); + } +} diff --git a/SewingFactory/SewingFactoryContracts/BusinessLogicContracts/IOrderLogic.cs b/SewingFactory/SewingFactoryContracts/BusinessLogicContracts/IOrderLogic.cs new file mode 100644 index 0000000..4d09595 --- /dev/null +++ b/SewingFactory/SewingFactoryContracts/BusinessLogicContracts/IOrderLogic.cs @@ -0,0 +1,25 @@ +using SewingFactoryContracts.BindingModels; +using SewingFactoryContracts.SearchModels; +using SewingFactoryContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SewingFactoryContracts.BusinessLogicContracts +{ + public interface IOrderLogic + { + List? ReadList(OrderSearchModel? model); + + bool CreateOrder(OrderBindingModel model); + + bool TakeOrderInWork(OrderBindingModel model); + + bool FinishOrder(OrderBindingModel model); + + bool DeliveryOrder(OrderBindingModel model); + + } +} diff --git a/SewingFactory/SewingFactoryContracts/BusinessLogicContracts/ITextileLogic.cs b/SewingFactory/SewingFactoryContracts/BusinessLogicContracts/ITextileLogic.cs new file mode 100644 index 0000000..2239086 --- /dev/null +++ b/SewingFactory/SewingFactoryContracts/BusinessLogicContracts/ITextileLogic.cs @@ -0,0 +1,24 @@ +using SewingFactoryContracts.BindingModels; +using SewingFactoryContracts.SearchModels; +using SewingFactoryContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SewingFactoryContracts.BusinessLogicContracts +{ + public interface ITextileLogic + { + List? ReadList(TextileSearchModel? model); + + TextileViewModel? ReadElement(TextileSearchModel model); + + bool Create(TextileBindingModel model); + + bool Update(TextileBindingModel model); + + bool Delete(TextileBindingModel model); + } +} diff --git a/SewingFactory/SewingFactoryContracts/SearchModels/ComponentSearchModel.cs b/SewingFactory/SewingFactoryContracts/SearchModels/ComponentSearchModel.cs new file mode 100644 index 0000000..f014b24 --- /dev/null +++ b/SewingFactory/SewingFactoryContracts/SearchModels/ComponentSearchModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SewingFactoryContracts.SearchModels +{ + public class ComponentSearchModel + { + public int Id { get; set; } + + public string? ComponentName { get; set; } + } +} diff --git a/SewingFactory/SewingFactoryContracts/SearchModels/OrderSearchModel.cs b/SewingFactory/SewingFactoryContracts/SearchModels/OrderSearchModel.cs new file mode 100644 index 0000000..9c84409 --- /dev/null +++ b/SewingFactory/SewingFactoryContracts/SearchModels/OrderSearchModel.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SewingFactoryContracts.SearchModels +{ + public class OrderSearchModel + { + public int? Id { get; set; } + } +} diff --git a/SewingFactory/SewingFactoryContracts/SearchModels/TextileSearchModel.cs b/SewingFactory/SewingFactoryContracts/SearchModels/TextileSearchModel.cs new file mode 100644 index 0000000..3d9a2f6 --- /dev/null +++ b/SewingFactory/SewingFactoryContracts/SearchModels/TextileSearchModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SewingFactoryContracts.SearchModels +{ + public class TextileSearchModel + { + public int? Id { get; set; } + + public string? TextileName { get; set; } + } +} diff --git a/SewingFactory/SewingFactoryContracts/SewingFactoryContracts.csproj b/SewingFactory/SewingFactoryContracts/SewingFactoryContracts.csproj new file mode 100644 index 0000000..7708066 --- /dev/null +++ b/SewingFactory/SewingFactoryContracts/SewingFactoryContracts.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + + + + + + + + diff --git a/SewingFactory/SewingFactoryContracts/StoragesContracts/IComponentStorage.cs b/SewingFactory/SewingFactoryContracts/StoragesContracts/IComponentStorage.cs new file mode 100644 index 0000000..25c8c80 --- /dev/null +++ b/SewingFactory/SewingFactoryContracts/StoragesContracts/IComponentStorage.cs @@ -0,0 +1,21 @@ +using SewingFactoryContracts.BindingModels; +using SewingFactoryContracts.SearchModels; +using SewingFactoryContracts.ViewModels; + +namespace SewingFactoryContracts.StoragesContracts +{ + public interface IComponentStorage + { + List GetFullList(); + + List GetFilteredList(ComponentSearchModel model); + + ComponentViewModel? GetElement(ComponentSearchModel model); + + ComponentViewModel? Insert(ComponentBindingModel model); + + ComponentViewModel? Update(ComponentBindingModel model); + + ComponentViewModel? Delete(ComponentBindingModel model); + } +} \ No newline at end of file diff --git a/SewingFactory/SewingFactoryContracts/StoragesContracts/IOrderStorage.cs b/SewingFactory/SewingFactoryContracts/StoragesContracts/IOrderStorage.cs new file mode 100644 index 0000000..0c1d7e9 --- /dev/null +++ b/SewingFactory/SewingFactoryContracts/StoragesContracts/IOrderStorage.cs @@ -0,0 +1,21 @@ +using SewingFactoryContracts.BindingModels; +using SewingFactoryContracts.SearchModels; +using SewingFactoryContracts.ViewModels; + +namespace SewingFactoryContracts.StoragesContracts +{ + internal interface IOrderStorage + { + List GetFullList(); + + List GetFilteredList(OrderSearchModel model); + + OrderViewModel? GetElement(OrderSearchModel model); + + OrderViewModel? Insert(OrderBindingModel model); + + OrderViewModel? Update(OrderBindingModel model); + + OrderViewModel? Delete(OrderBindingModel model); + } +} \ No newline at end of file diff --git a/SewingFactory/SewingFactoryContracts/StoragesContracts/ITextileStorage.cs b/SewingFactory/SewingFactoryContracts/StoragesContracts/ITextileStorage.cs new file mode 100644 index 0000000..f4a7c17 --- /dev/null +++ b/SewingFactory/SewingFactoryContracts/StoragesContracts/ITextileStorage.cs @@ -0,0 +1,21 @@ +using SewingFactoryContracts.BindingModels; +using SewingFactoryContracts.SearchModels; +using SewingFactoryContracts.ViewModels; + +namespace SewingFactoryContracts.StoragesContracts +{ + public interface ITextileStorage + { + List GetFullList(); + + List GetFilteredList(TextileSearchModel model); + + TextileViewModel? GetElement(TextileSearchModel model); + + TextileViewModel? Insert(TextileBindingModel model); + + TextileViewModel? Update(TextileBindingModel model); + + TextileViewModel? Delete(TextileBindingModel model); + } +} \ No newline at end of file diff --git a/SewingFactory/SewingFactoryContracts/ViewModels/ComponentViewModel.cs b/SewingFactory/SewingFactoryContracts/ViewModels/ComponentViewModel.cs new file mode 100644 index 0000000..6649e4f --- /dev/null +++ b/SewingFactory/SewingFactoryContracts/ViewModels/ComponentViewModel.cs @@ -0,0 +1,23 @@ +using SewingFactoryDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SewingFactoryContracts.ViewModels +{ + public class ComponentViewModel : IComponentModel + { + public int Id { get; set; } + + [DisplayName("Название компонента")] + + public string ComponentName { get; set; } = string.Empty; + + [DisplayName("Цена")] + + public double Cost { get; set; } + } +} diff --git a/SewingFactory/SewingFactoryContracts/ViewModels/OrderViewModel.cs b/SewingFactory/SewingFactoryContracts/ViewModels/OrderViewModel.cs new file mode 100644 index 0000000..f74d924 --- /dev/null +++ b/SewingFactory/SewingFactoryContracts/ViewModels/OrderViewModel.cs @@ -0,0 +1,35 @@ +using SewingFactoryDataModels; +using SewingFactoryDataModels.Enums; +using SewingFactoryDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; + +namespace SewingFactoryContracts.ViewModels +{ + public class OrderViewModel : IOrderModel + { + [DisplayName("Номер")] + public int Id { get; set; } + + public int TextileID { get; set; } + + [DisplayName("Изделие")] + public string TextileName { get; set; } = string.Empty; + + [DisplayName("Количество")] + public int Count { get; set; } + + [DisplayName("Сумма")] + public double Sum { get; set; } + + [DisplayName("Статус")] + public OrderStatus Status { get; set; } = OrderStatus.Неизвестен; + + [DisplayName("Дата создания")] + public DateTime DateCreate { get; set; } = DateTime.Now; + + [DisplayName("Дата выполнения")] + public DateTime? DateImplement { get; set; } + } +} \ No newline at end of file diff --git a/SewingFactory/SewingFactoryContracts/ViewModels/TextileViewModel.cs b/SewingFactory/SewingFactoryContracts/ViewModels/TextileViewModel.cs new file mode 100644 index 0000000..bd33552 --- /dev/null +++ b/SewingFactory/SewingFactoryContracts/ViewModels/TextileViewModel.cs @@ -0,0 +1,26 @@ +using SewingFactoryDataModels; +using SewingFactoryDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SewingFactoryContracts.ViewModels +{ + public class TextileViewModel : ITextileModel + { + public int Id { get; set; } + + [DisplayName("Название изделия")] + + public string TextileName { get; set; } = string.Empty; + + [DisplayName("Цена")] + + public double Price { get; set; } + + public Dictionary TextileComponents { get; set; } = new(); + } +} diff --git a/SewingFactory/SewingFactoryDataModels/Enums/OrderStatus.cs b/SewingFactory/SewingFactoryDataModels/Enums/OrderStatus.cs new file mode 100644 index 0000000..8e625f7 --- /dev/null +++ b/SewingFactory/SewingFactoryDataModels/Enums/OrderStatus.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SewingFactoryDataModels.Enums +{ + public enum OrderStatus + { + Неизвестен = -1, + + Принят = 0, + + Выполняется = 1, + + Готов = 2, + + Выдан = 3 + } +} diff --git a/SewingFactory/SewingFactoryDataModels/IId.cs b/SewingFactory/SewingFactoryDataModels/IId.cs new file mode 100644 index 0000000..5814768 --- /dev/null +++ b/SewingFactory/SewingFactoryDataModels/IId.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SewingFactoryDataModels +{ + public interface IId + { + int Id { get; } + } +} diff --git a/SewingFactory/SewingFactoryDataModels/Models/IComponentModel.cs b/SewingFactory/SewingFactoryDataModels/Models/IComponentModel.cs new file mode 100644 index 0000000..5f55619 --- /dev/null +++ b/SewingFactory/SewingFactoryDataModels/Models/IComponentModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SewingFactoryDataModels.Models +{ + public interface IComponentModel : IId + { + string ComponentName { get; } + + double Cost { get; } + } +} diff --git a/SewingFactory/SewingFactoryDataModels/Models/IOrderModel.cs b/SewingFactory/SewingFactoryDataModels/Models/IOrderModel.cs new file mode 100644 index 0000000..8e90866 --- /dev/null +++ b/SewingFactory/SewingFactoryDataModels/Models/IOrderModel.cs @@ -0,0 +1,24 @@ +using SewingFactoryDataModels.Enums; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SewingFactoryDataModels.Models +{ + public interface IOrderModel : IId + { + int TextileID { get; } + + int Count { get; } + + double Sum { get; } + + OrderStatus Status { get; } + + DateTime DateCreate { get; } + + DateTime? DateImplement { get; } + } +} diff --git a/SewingFactory/SewingFactoryDataModels/Models/ITextileModel.cs b/SewingFactory/SewingFactoryDataModels/Models/ITextileModel.cs new file mode 100644 index 0000000..74d01de --- /dev/null +++ b/SewingFactory/SewingFactoryDataModels/Models/ITextileModel.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SewingFactoryDataModels.Models +{ + public interface ITextileModel : IId + { + string TextileName { get; } + + double Price { get; } + + Dictionary TextileComponents { get; } + } +} diff --git a/SewingFactory/SewingFactoryDataModels/SewingFactoryDataModels.csproj b/SewingFactory/SewingFactoryDataModels/SewingFactoryDataModels.csproj new file mode 100644 index 0000000..27ac386 --- /dev/null +++ b/SewingFactory/SewingFactoryDataModels/SewingFactoryDataModels.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + +