From 1ec31b773b07e1a7550b60dc44e49d2a201fa367 Mon Sep 17 00:00:00 2001 From: K Date: Sun, 2 Jun 2024 13:17:51 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BF=D0=BE=D1=87=D1=82=D0=B0=20=D0=BD=D0=B5?= =?UTF-8?q?=20=D0=B2=D0=BE=D1=80=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BusinessLogic/ReportStorekeeperLogic.cs | 6 ++-- .../AbstractSaveToPdfStorekeeper.cs | 2 +- .../AbstractSaveToWordStorekeeper.cs | 33 +++++++++---------- .../BeautySalonDatabase.cs | 2 +- BeautySalonView/ClientWebApp/appsettings.json | 8 ++++- 5 files changed, 28 insertions(+), 23 deletions(-) diff --git a/BeautySalonView/BeautySalonBusinesLogic/BusinessLogic/ReportStorekeeperLogic.cs b/BeautySalonView/BeautySalonBusinesLogic/BusinessLogic/ReportStorekeeperLogic.cs index f8d208f..000cafd 100644 --- a/BeautySalonView/BeautySalonBusinesLogic/BusinessLogic/ReportStorekeeperLogic.cs +++ b/BeautySalonView/BeautySalonBusinesLogic/BusinessLogic/ReportStorekeeperLogic.cs @@ -65,6 +65,7 @@ namespace BeautySalonBusinesLogic.BusinessLogics .Select(x => new ReportServicesViewModel { Id = x.Id, + ServiceName = x.ServiceName, Cosmetics = x.ServiceCosmetics, Procedures = x.ServiceProcedures, ServicePrice = x.ServiceProcedures.Sum(kv => kv.Value.Item1.ProcedurePrice) + @@ -94,12 +95,13 @@ namespace BeautySalonBusinesLogic.BusinessLogics public void SaveServicesToPdfFile(ReportServiceBindingModel model) { - _saveToPdf.CreateReport(new PdfInfo + var report = new PdfInfo { FileName = model.FileName, Title = "Список услуг", Services = GetServices(model) - }); + }; + _saveToPdf.CreateReport(report); } } } diff --git a/BeautySalonView/BeautySalonBusinesLogic/OfficePackage/AbstractSaveToPdfStorekeeper.cs b/BeautySalonView/BeautySalonBusinesLogic/OfficePackage/AbstractSaveToPdfStorekeeper.cs index 56c274f..801fc3b 100644 --- a/BeautySalonView/BeautySalonBusinesLogic/OfficePackage/AbstractSaveToPdfStorekeeper.cs +++ b/BeautySalonView/BeautySalonBusinesLogic/OfficePackage/AbstractSaveToPdfStorekeeper.cs @@ -79,7 +79,7 @@ namespace BeautySalonBusinesLogics.OfficePackage string procedure = (i < procedures.Count) ? procedures[i] : ""; CreateRow(new PdfRowParameters { - Texts = new List { "", cosmetic, procedure }, + Texts = new List { "", procedure, cosmetic }, Style = "Normal", ParagraphAlignment = PdfParagraphAlignmentType.Left }); diff --git a/BeautySalonView/BeautySalonBusinesLogic/OfficePackage/AbstractSaveToWordStorekeeper.cs b/BeautySalonView/BeautySalonBusinesLogic/OfficePackage/AbstractSaveToWordStorekeeper.cs index b34146d..e73371a 100644 --- a/BeautySalonView/BeautySalonBusinesLogic/OfficePackage/AbstractSaveToWordStorekeeper.cs +++ b/BeautySalonView/BeautySalonBusinesLogic/OfficePackage/AbstractSaveToWordStorekeeper.cs @@ -28,7 +28,7 @@ namespace BeatySalonBusinesLogic.OfficePackage CreateParagraph(new WordParagraph { Texts = new List<(string, WordTextProperties)> { - (cp.CosmeticName + " :", new WordTextProperties { Size = "24", Bold = true, }), + (cp.CosmeticName + " : ", new WordTextProperties { Size = "24", Bold = true, }), }, TextProperties = new WordTextProperties { @@ -36,25 +36,22 @@ namespace BeatySalonBusinesLogic.OfficePackage JustificationType = WordJustificationType.Both } }); - foreach (var procedure in cp.Procedures) - { - CreateParagraph(new WordParagraph - { - Texts = new List<(string, WordTextProperties)> + foreach (var procedure in cp.Procedures) + { + CreateParagraph(new WordParagraph + { + Texts = new List<(string, WordTextProperties)> { - // Пустая строка для смещения во вторую колонку - (string.Empty, new WordTextProperties { Size = "24" }), - // Наименование косметики - (procedure, new WordTextProperties { Size = "24" }) + (" " + procedure, new WordTextProperties { Size = "24" }) // Добавляем отступ в виде Tab }, - TextProperties = new WordTextProperties - { - Size = "24", - JustificationType = WordJustificationType.Both - } - }); - } - } + TextProperties = new WordTextProperties + { + Size = "24", + JustificationType = WordJustificationType.Both + } + }); + } + } SaveWord(info); } //Создание док-файла diff --git a/BeautySalonView/BeautySalonDatabaseImplement/BeautySalonDatabase.cs b/BeautySalonView/BeautySalonDatabaseImplement/BeautySalonDatabase.cs index c3b4366..e59352d 100644 --- a/BeautySalonView/BeautySalonDatabaseImplement/BeautySalonDatabase.cs +++ b/BeautySalonView/BeautySalonDatabaseImplement/BeautySalonDatabase.cs @@ -17,7 +17,7 @@ namespace BeautySalonDatabaseImplement { if (optionsBuilder.IsConfigured == false) { - optionsBuilder.UseSqlServer(@"Data Source=ALYONA\;Initial Catalog=BeautySalonDatabase2;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True"); + optionsBuilder.UseSqlServer(@"Data Source=PRETTYNAME;Initial Catalog=BeautySalonDatabase2;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True"); } base.OnConfiguring(optionsBuilder); } diff --git a/BeautySalonView/ClientWebApp/appsettings.json b/BeautySalonView/ClientWebApp/appsettings.json index 10f68b8..b009a38 100644 --- a/BeautySalonView/ClientWebApp/appsettings.json +++ b/BeautySalonView/ClientWebApp/appsettings.json @@ -5,5 +5,11 @@ "Microsoft.AspNetCore": "Warning" } }, - "AllowedHosts": "*" + "AllowedHosts": "*", + "SmtpClientHost": "smtp.gmail.com", + "SmtpClientPort": "587", + "PopHost": "pop.gmail.com", + "PopPort": "995", + "MailLogin": "theredguy13@gmail.com", + "MailPassword": "gcok utyv qyce qfre" }