From baa61f38d4de4cb3fcabd867e2996ca3e315c169 Mon Sep 17 00:00:00 2001 From: AnnZhimol Date: Fri, 19 May 2023 12:30:20 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A2=D0=B0=D0=B1=D0=BB=D0=B8=D1=86=D0=B0=20?= =?UTF-8?q?=D1=81=20=D0=BF=D1=80=D0=B5=D0=B4=D0=B2=D0=B0=D1=80=D0=B8=D1=82?= =?UTF-8?q?=D0=B5=D0=BB=D1=8C=D0=BD=D1=8B=D0=BC=20=D0=BF=D1=80=D0=BE=D1=81?= =?UTF-8?q?=D0=BC=D0=BE=D1=82=D1=80=D0=BE=D0=BC=20=D0=BF=D0=B4=D1=84=20?= =?UTF-8?q?=D0=BF=D1=80=D0=B8=D0=B2=D0=B5=D0=B4=D0=B5=D0=BD=D0=B0=20=D0=B2?= =?UTF-8?q?=20=D0=BF=D0=BE=D1=80=D1=8F=D0=B4=D0=BE=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hotel/HotelDataBaseImplement/HotelDataBase.cs | 2 +- .../Controllers/HomeController.cs | 49 +++++++++------ .../Views/Home/ListMembersToPdfFile.cshtml | 59 ++++++++++++------- 3 files changed, 69 insertions(+), 41 deletions(-) diff --git a/Hotel/HotelDataBaseImplement/HotelDataBase.cs b/Hotel/HotelDataBaseImplement/HotelDataBase.cs index 7141379..6d7ccea 100644 --- a/Hotel/HotelDataBaseImplement/HotelDataBase.cs +++ b/Hotel/HotelDataBaseImplement/HotelDataBase.cs @@ -9,7 +9,7 @@ namespace HotelDataBaseImplement { if (optionsBuilder.IsConfigured == false) { - optionsBuilder.UseSqlServer(@"Data Source=DESKTOP-V0ON61E\SQLEXPRESS;Initial Catalog=HotelDataBaseFull;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True"); + optionsBuilder.UseSqlServer(@"Data Source=DESKTOP-VG5USAH\SQLEXPRESS;Initial Catalog=HotelDataBaseFull;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True"); } base.OnConfiguring(optionsBuilder); } diff --git a/Hotel/HotelOrganiserApp/Controllers/HomeController.cs b/Hotel/HotelOrganiserApp/Controllers/HomeController.cs index f6a2a79..5eb9e17 100644 --- a/Hotel/HotelOrganiserApp/Controllers/HomeController.cs +++ b/Hotel/HotelOrganiserApp/Controllers/HomeController.cs @@ -9,6 +9,8 @@ using System.Web.Helpers; using System.Reflection; using HotelBusinessLogic.BusinessLogics; using HotelContracts.BusinessLogicsContracts; +using System.Linq; +using DocumentFormat.OpenXml.Wordprocessing; namespace HotelOrganiserApp.Controllers { @@ -152,30 +154,41 @@ namespace HotelOrganiserApp.Controllers _logger.LogError(ex, "Ошибка создания отчета"); throw; } + double sum = 0; string table = ""; + table += $"

Предварительный отчет

"; + table += $""; + table += ""; + table += ""; + table += ""; + table += ""; + table += ""; + table += ""; + table += ""; + table += ""; + table += ""; + table += $""; + table += $""; + table += $""; + table += $""; + table += $""; + table += ""; + table += ""; foreach (var report in result) { - table += $"

{report.MemberFIO}

"; - table += $"
УчастникКонференцияДата начала конференцииПлан питанияСтоимость плана питания
"; - table += ""; - table += ""; - table += $""; - table += $""; - table += $""; - table += $""; - table += ""; - table += ""; - table += ""; - table += ""; - table += $""; - table += $""; - table += $""; - table += $""; + table += ""; + table += ""; + table += $""; + table += $""; + table += $""; + table += $""; + table += $""; table += ""; table += ""; - table += "
КонференцияДата начала конференцииПлан питанияСтоимость плана питания
{report.ConferenceName}{report.StartDate}{report.MealPlanName}{report.MealPlanPrice}
{report.MemberFIO}{report.ConferenceName}{report.StartDate}{report.MealPlanName}{report.MealPlanPrice}
"; + sum+= report.MealPlanPrice; } - //table += $"

Итого: {result.Item2}

"; + table += ""; + table += $"

Итого: {sum}

"; return table; } diff --git a/Hotel/HotelOrganiserApp/Views/Home/ListMembersToPdfFile.cshtml b/Hotel/HotelOrganiserApp/Views/Home/ListMembersToPdfFile.cshtml index 6be9f34..84b1dcb 100644 --- a/Hotel/HotelOrganiserApp/Views/Home/ListMembersToPdfFile.cshtml +++ b/Hotel/HotelOrganiserApp/Views/Home/ListMembersToPdfFile.cshtml @@ -3,36 +3,51 @@ @{ ViewData["Title"] = "ListMembersToPdfFile"; } + + +
-

Отчет по участникам за период

+

Отчет по участникам за период

@{
-
-
- - -
-
- - -
-
-
- Ваш email - - -
-
+ + +
+ + +
+
+
+
+
+
- +
+
+
+
}