Первые 3 проекта / Первый этап Lab_1

This commit is contained in:
Максим Егоров 2024-10-16 19:56:17 +04:00
parent 563a8d88f3
commit f48e352abe
23 changed files with 452 additions and 1 deletions

View File

@ -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

View File

@ -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; }
}
}

View File

@ -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; }
}
}

View File

@ -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<int, (IComponentModel, int)> TextileComponents { get; set; } = new();
}
}

View File

@ -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<ComponentViewModel>? ReadList(ComponentSearchModel? model);
ComponentViewModel? ReadElement(ComponentSearchModel model);
bool Create(ComponentBindingModel model);
bool Update(ComponentBindingModel model);
bool Delete(ComponentBindingModel model);
}
}

View File

@ -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<OrderViewModel>? ReadList(OrderSearchModel? model);
bool CreateOrder(OrderBindingModel model);
bool TakeOrderInWork(OrderBindingModel model);
bool FinishOrder(OrderBindingModel model);
bool DeliveryOrder(OrderBindingModel model);
}
}

View File

@ -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<TextileViewModel>? ReadList(TextileSearchModel? model);
TextileViewModel? ReadElement(TextileSearchModel model);
bool Create(TextileBindingModel model);
bool Update(TextileBindingModel model);
bool Delete(TextileBindingModel model);
}
}

View File

@ -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; }
}
}

View File

@ -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; }
}
}

View File

@ -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; }
}
}

View File

@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\SewingFactoryDataModels\SewingFactoryDataModels.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,21 @@
using SewingFactoryContracts.BindingModels;
using SewingFactoryContracts.SearchModels;
using SewingFactoryContracts.ViewModels;
namespace SewingFactoryContracts.StoragesContracts
{
public interface IComponentStorage
{
List<ComponentViewModel> GetFullList();
List<ComponentViewModel> GetFilteredList(ComponentSearchModel model);
ComponentViewModel? GetElement(ComponentSearchModel model);
ComponentViewModel? Insert(ComponentBindingModel model);
ComponentViewModel? Update(ComponentBindingModel model);
ComponentViewModel? Delete(ComponentBindingModel model);
}
}

View File

@ -0,0 +1,21 @@
using SewingFactoryContracts.BindingModels;
using SewingFactoryContracts.SearchModels;
using SewingFactoryContracts.ViewModels;
namespace SewingFactoryContracts.StoragesContracts
{
internal interface IOrderStorage
{
List<OrderViewModel> GetFullList();
List<OrderViewModel> GetFilteredList(OrderSearchModel model);
OrderViewModel? GetElement(OrderSearchModel model);
OrderViewModel? Insert(OrderBindingModel model);
OrderViewModel? Update(OrderBindingModel model);
OrderViewModel? Delete(OrderBindingModel model);
}
}

View File

@ -0,0 +1,21 @@
using SewingFactoryContracts.BindingModels;
using SewingFactoryContracts.SearchModels;
using SewingFactoryContracts.ViewModels;
namespace SewingFactoryContracts.StoragesContracts
{
public interface ITextileStorage
{
List<TextileViewModel> GetFullList();
List<TextileViewModel> GetFilteredList(TextileSearchModel model);
TextileViewModel? GetElement(TextileSearchModel model);
TextileViewModel? Insert(TextileBindingModel model);
TextileViewModel? Update(TextileBindingModel model);
TextileViewModel? Delete(TextileBindingModel model);
}
}

View File

@ -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; }
}
}

View File

@ -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; }
}
}

View File

@ -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<int, (IComponentModel, int)> TextileComponents { get; set; } = new();
}
}

View File

@ -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
}
}

View File

@ -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; }
}
}

View File

@ -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; }
}
}

View File

@ -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; }
}
}

View File

@ -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<int, (IComponentModel, int)> TextileComponents { get; }
}
}

View File

@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>