From 2bcf267d1e3e92f5055cb23cb8ec4660b30b440b Mon Sep 17 00:00:00 2001 From: "nikbel2004@outlook.com" Date: Sat, 11 May 2024 01:31:20 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FurnitureAssemblyBusinessLogic.csproj | 3 +-- .../OfficePackage/Implements/SaveToExcel.cs | 4 ++-- .../OfficePackage/Implements/SaveToWord.cs | 3 ++- .../BindingModels/OrderBindingModel.cs | 4 ++-- .../SearchModels/ClientSearchModel.cs | 6 +++--- .../SearchModels/OrderSearchModel.cs | 2 ++ .../ViewModels/OrderViewModel.cs | 10 +++++----- .../FurnitureAssemblyDataModels/Models/IClientModel.cs | 1 + .../FurnitureAssemblyDatabase.cs | 5 ++--- .../Implements/ShopStorage.cs | 2 +- .../FurnitureAssemblyDatabaseImplement/Models/Shop.cs | 4 +--- .../Models/ShopFurniture.cs | 2 +- 12 files changed, 23 insertions(+), 23 deletions(-) diff --git a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/FurnitureAssemblyBusinessLogic.csproj b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/FurnitureAssemblyBusinessLogic.csproj index df8a606..b222f5e 100644 --- a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/FurnitureAssemblyBusinessLogic.csproj +++ b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/FurnitureAssemblyBusinessLogic.csproj @@ -11,8 +11,7 @@ - - + diff --git a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/Implements/SaveToExcel.cs b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/Implements/SaveToExcel.cs index 2166c20..1e38296 100644 --- a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/Implements/SaveToExcel.cs +++ b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/Implements/SaveToExcel.cs @@ -310,7 +310,7 @@ namespace FurnitureAssemblyBusinessLogic.OfficePackage.Implements else { // Все ячейки должны быть последовательно друг за другом расположены - // нужно определить, после какой вставлять + // Нужно определить, после какой вставлять Cell? refCell = null; foreach (Cell rowCell in row.Elements()) @@ -385,7 +385,7 @@ namespace FurnitureAssemblyBusinessLogic.OfficePackage.Implements } _spreadsheetDocument.WorkbookPart!.Workbook.Save(); - _spreadsheetDocument.Close(); + _spreadsheetDocument.Dispose(); } } } diff --git a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/Implements/SaveToWord.cs b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/Implements/SaveToWord.cs index 38b8f58..652ad5c 100644 --- a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/Implements/SaveToWord.cs +++ b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/Implements/SaveToWord.cs @@ -114,6 +114,7 @@ namespace FurnitureAssemblyBusinessLogic.OfficePackage.Implements var docRun = new Run(); var properties = new RunProperties(); + // Задание свойств текста - размер и жирность properties.AppendChild(new FontSize { Val = run.Item2.Size }); if (run.Item2.Bold) @@ -145,7 +146,7 @@ namespace FurnitureAssemblyBusinessLogic.OfficePackage.Implements // Сохраняем документ _wordDocument.MainDocumentPart!.Document.Save(); - _wordDocument.Close(); + _wordDocument.Dispose(); } protected override void CreateTable(WordParagraph paragraph) diff --git a/FurnitureAssembly/FurnitureAssemblyContracts/BindingModels/OrderBindingModel.cs b/FurnitureAssembly/FurnitureAssemblyContracts/BindingModels/OrderBindingModel.cs index 496af93..d1e91f8 100644 --- a/FurnitureAssembly/FurnitureAssemblyContracts/BindingModels/OrderBindingModel.cs +++ b/FurnitureAssembly/FurnitureAssemblyContracts/BindingModels/OrderBindingModel.cs @@ -12,10 +12,10 @@ namespace FurnitureAssemblyContracts.BindingModels { public int Id { get; set; } - public int FurnitureId { get; set; } - public int ClientId { get; set; } + public int FurnitureId { get; set; } + public int Count { get; set; } public double Sum { get; set; } diff --git a/FurnitureAssembly/FurnitureAssemblyContracts/SearchModels/ClientSearchModel.cs b/FurnitureAssembly/FurnitureAssemblyContracts/SearchModels/ClientSearchModel.cs index f349856..2fddaab 100644 --- a/FurnitureAssembly/FurnitureAssemblyContracts/SearchModels/ClientSearchModel.cs +++ b/FurnitureAssembly/FurnitureAssemblyContracts/SearchModels/ClientSearchModel.cs @@ -6,15 +6,15 @@ using System.Threading.Tasks; namespace FurnitureAssemblyContracts.SearchModels { - // Модель для поиска клиентов + // Модель для поиска клиента public class ClientSearchModel { public int? Id { get; set; } - public string? ClientFIO { get; set; } - public string? Email { get; set; } + public string? ClientFIO { get; set; } + public string? Password { get; set; } } } diff --git a/FurnitureAssembly/FurnitureAssemblyContracts/SearchModels/OrderSearchModel.cs b/FurnitureAssembly/FurnitureAssemblyContracts/SearchModels/OrderSearchModel.cs index 42c47de..c2542d1 100644 --- a/FurnitureAssembly/FurnitureAssemblyContracts/SearchModels/OrderSearchModel.cs +++ b/FurnitureAssembly/FurnitureAssemblyContracts/SearchModels/OrderSearchModel.cs @@ -12,8 +12,10 @@ namespace FurnitureAssemblyContracts.SearchModels // для поиска по идентификатору public int? Id { get; set; } + // для поиска по клиенту public int? ClientId { get; set; } + // Два поля для возможности производить выборку public DateTime? DateFrom { get; set; } public DateTime? DateTo { get; set; } diff --git a/FurnitureAssembly/FurnitureAssemblyContracts/ViewModels/OrderViewModel.cs b/FurnitureAssembly/FurnitureAssemblyContracts/ViewModels/OrderViewModel.cs index fb886d7..418eee7 100644 --- a/FurnitureAssembly/FurnitureAssemblyContracts/ViewModels/OrderViewModel.cs +++ b/FurnitureAssembly/FurnitureAssemblyContracts/ViewModels/OrderViewModel.cs @@ -15,16 +15,16 @@ namespace FurnitureAssemblyContracts.ViewModels [DisplayName("Номер")] public int Id { get; set; } - public int FurnitureId { get; set; } - - [DisplayName("Изделие")] - public string FurnitureName { get; set; } = string.Empty; - public int ClientId { get; set; } [DisplayName("ФИО клиента")] public string ClientFIO { get; set; } = string.Empty; + public int FurnitureId { get; set; } + + [DisplayName("Изделие")] + public string FurnitureName { get; set; } = string.Empty; + [DisplayName("Количество")] public int Count { get; set; } diff --git a/FurnitureAssembly/FurnitureAssemblyDataModels/Models/IClientModel.cs b/FurnitureAssembly/FurnitureAssemblyDataModels/Models/IClientModel.cs index 58b5610..13bb7ee 100644 --- a/FurnitureAssembly/FurnitureAssemblyDataModels/Models/IClientModel.cs +++ b/FurnitureAssembly/FurnitureAssemblyDataModels/Models/IClientModel.cs @@ -6,6 +6,7 @@ using System.Threading.Tasks; namespace FurnitureAssemblyDataModels.Models { + // Интерфейс, отвечающий за клиента public interface IClientModel : IId { string ClientFIO { get; } diff --git a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/FurnitureAssemblyDatabase.cs b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/FurnitureAssemblyDatabase.cs index e48fa51..d9fb09e 100644 --- a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/FurnitureAssemblyDatabase.cs +++ b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/FurnitureAssemblyDatabase.cs @@ -1,5 +1,4 @@ -using BlacksmithWorkshopDatabaseImplement.Models; -using FurnitureAssemblyDatabaseImplement.Models; +using FurnitureAssemblyDatabaseImplement.Models; using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; @@ -15,7 +14,7 @@ namespace FurnitureAssemblyDatabaseImplement { if (optionsBuilder.IsConfigured == false) { - optionsBuilder.UseSqlServer(@"Data Source=KatanaNik\SQLEXPRESS;Initial Catalog=FurnitureAssemblyDatabaseFull;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True"); + optionsBuilder.UseSqlServer(@"Data Source=localhost\SQLEXPRESS;Initial Catalog=FurnitureAssemblyDatabaseFull;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True"); } base.OnConfiguring(optionsBuilder); diff --git a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Implements/ShopStorage.cs b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Implements/ShopStorage.cs index 6425e20..719f3cb 100644 --- a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Implements/ShopStorage.cs +++ b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Implements/ShopStorage.cs @@ -1,4 +1,4 @@ -using BlacksmithWorkshopDatabaseImplement.Models; +using FurnitureAssemblyDatabaseImplement.Models; using FurnitureAssemblyContracts.BindingModels; using FurnitureAssemblyContracts.SearchModels; using FurnitureAssemblyContracts.StoragesContracts; diff --git a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/Shop.cs b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/Shop.cs index 593f6d5..c3261b1 100644 --- a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/Shop.cs +++ b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/Shop.cs @@ -1,7 +1,5 @@ using FurnitureAssemblyContracts.BindingModels; using FurnitureAssemblyContracts.ViewModels; -using FurnitureAssemblyDatabaseImplement; -using FurnitureAssemblyDatabaseImplement.Models; using FurnitureAssemblyDataModels.Models; using System; using System.Collections.Generic; @@ -11,7 +9,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace BlacksmithWorkshopDatabaseImplement.Models +namespace FurnitureAssemblyDatabaseImplement.Models { public class Shop : IShopModel { diff --git a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/ShopFurniture.cs b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/ShopFurniture.cs index 8d83e90..5d1cc11 100644 --- a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/ShopFurniture.cs +++ b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/ShopFurniture.cs @@ -1,4 +1,4 @@ -using BlacksmithWorkshopDatabaseImplement.Models; +using FurnitureAssemblyDatabaseImplement.Models; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations;