diff --git a/SoftwareInstallation/SoftwareInstallationBusinessLogic/BusinessLogics/ReportLogic.cs b/SoftwareInstallation/SoftwareInstallationBusinessLogic/BusinessLogics/ReportLogic.cs index fadee0a..e3198ac 100644 --- a/SoftwareInstallation/SoftwareInstallationBusinessLogic/BusinessLogics/ReportLogic.cs +++ b/SoftwareInstallation/SoftwareInstallationBusinessLogic/BusinessLogics/ReportLogic.cs @@ -40,7 +40,7 @@ namespace SoftwareInstallationBusinessLogic.BusinessLogics { var record = new ReportPackageComponentViewModel { - SoftwareName = Software.PackageName, + PackageName = Software.PackageName, Components = new List<(string Component, int Count)>(), TotalCount = 0 }; @@ -68,7 +68,7 @@ namespace SoftwareInstallationBusinessLogic.BusinessLogics { Id = x.Id, DateCreate = x.DateCreate, - SoftwareName = x.PackageName, + PackageName = x.PackageName, Sum = x.Sum, Status = x.Status.ToString(), }) @@ -80,7 +80,7 @@ namespace SoftwareInstallationBusinessLogic.BusinessLogics _saveToWord.CreateDoc(new WordInfo { FileName = model.FileName, - Title = "Список ЖИ", + Title = "Список компонентов", Softwares = _PackageStorage.GetFullList() }); } @@ -89,7 +89,7 @@ namespace SoftwareInstallationBusinessLogic.BusinessLogics _saveToExcel.CreateReport(new ExcelInfo { FileName = model.FileName, - Title = "Список ЖИ", + Title = "Список компонентов", SoftwareComponents = GetSoftwareComponents() }); } diff --git a/SoftwareInstallation/SoftwareInstallationBusinessLogic/OfficePackage/AbstractSaveToExcel.cs b/SoftwareInstallation/SoftwareInstallationBusinessLogic/OfficePackage/AbstractSaveToExcel.cs index 353d0d7..e1b0d89 100644 --- a/SoftwareInstallation/SoftwareInstallationBusinessLogic/OfficePackage/AbstractSaveToExcel.cs +++ b/SoftwareInstallation/SoftwareInstallationBusinessLogic/OfficePackage/AbstractSaveToExcel.cs @@ -32,7 +32,7 @@ namespace SoftwareInstallationBusinessLogic.OfficePackage { ColumnName = "A", RowIndex = rowIndex, - Text = pc.SoftwareName, + Text = pc.PackageName, StyleInfo = ExcelStyleInfoType.Text }); rowIndex++; diff --git a/SoftwareInstallation/SoftwareInstallationBusinessLogic/OfficePackage/AbstractSaveToPdf.cs b/SoftwareInstallation/SoftwareInstallationBusinessLogic/OfficePackage/AbstractSaveToPdf.cs index 26db6b5..bd6d4e7 100644 --- a/SoftwareInstallation/SoftwareInstallationBusinessLogic/OfficePackage/AbstractSaveToPdf.cs +++ b/SoftwareInstallation/SoftwareInstallationBusinessLogic/OfficePackage/AbstractSaveToPdf.cs @@ -36,7 +36,7 @@ namespace SoftwareInstallationBusinessLogic.OfficePackage { CreateRow(new PdfRowParameters { - Texts = new List { order.Id.ToString(), order.DateCreate.ToShortDateString(), order.SoftwareName, order.Sum.ToString(), order.Status }, + Texts = new List { order.Id.ToString(), order.DateCreate.ToShortDateString(), order.PackageName, order.Sum.ToString(), order.Status }, Style = "Normal", ParagraphAlignment = PdfParagraphAlignmentType.Left }); diff --git a/SoftwareInstallation/SoftwareInstallationBusinessLogic/OfficePackage/AbstractSaveToWord.cs b/SoftwareInstallation/SoftwareInstallationBusinessLogic/OfficePackage/AbstractSaveToWord.cs index f110b82..c042a2a 100644 --- a/SoftwareInstallation/SoftwareInstallationBusinessLogic/OfficePackage/AbstractSaveToWord.cs +++ b/SoftwareInstallation/SoftwareInstallationBusinessLogic/OfficePackage/AbstractSaveToWord.cs @@ -27,8 +27,8 @@ namespace SoftwareInstallationBusinessLogic.OfficePackage CreateParagraph(new WordParagraph { Texts = new List<(string, WordTextProperties)> - {(Software.PackageName + " - ", new WordTextProperties { Size = "24", Bold = true}), - (Software.Price.ToString(), new WordTextProperties { Size = "24", })}, + { (Software.PackageName + " - ", new WordTextProperties { Size = "24", Bold = true }), + (" стоит " + Software.Price.ToString() + " рублей", new WordTextProperties { Size = "24", })}, TextProperties = new WordTextProperties { diff --git a/SoftwareInstallation/SoftwareInstallationContracts/ViewModels/ReportOrdersViewModel.cs b/SoftwareInstallation/SoftwareInstallationContracts/ViewModels/ReportOrdersViewModel.cs index 8aa26e4..f057363 100644 --- a/SoftwareInstallation/SoftwareInstallationContracts/ViewModels/ReportOrdersViewModel.cs +++ b/SoftwareInstallation/SoftwareInstallationContracts/ViewModels/ReportOrdersViewModel.cs @@ -10,7 +10,7 @@ namespace SoftwareInstallationContracts.ViewModels { public int Id { get; set; } public DateTime DateCreate { get; set; } - public string SoftwareName { get; set; } = string.Empty; + public string PackageName { get; set; } = string.Empty; public double Sum { get; set; } public string Status { get; set; } = string.Empty; } diff --git a/SoftwareInstallation/SoftwareInstallationContracts/ViewModels/ReportPackageComponentViewModel.cs b/SoftwareInstallation/SoftwareInstallationContracts/ViewModels/ReportPackageComponentViewModel.cs index ff913b5..fab67cb 100644 --- a/SoftwareInstallation/SoftwareInstallationContracts/ViewModels/ReportPackageComponentViewModel.cs +++ b/SoftwareInstallation/SoftwareInstallationContracts/ViewModels/ReportPackageComponentViewModel.cs @@ -8,7 +8,7 @@ namespace SoftwareInstallationContracts.ViewModels { public class ReportPackageComponentViewModel { - public string SoftwareName { get; set; } = string.Empty; + public string PackageName { get; set; } = string.Empty; public int TotalCount { get; set; } public List<(string Component, int Count)> Components { get; set; } = new(); diff --git a/SoftwareInstallation/SoftwareInstallationDatabaseImplement/OrderStorage.cs b/SoftwareInstallation/SoftwareInstallationDatabaseImplement/OrderStorage.cs index 3ce8c29..997f457 100644 --- a/SoftwareInstallation/SoftwareInstallationDatabaseImplement/OrderStorage.cs +++ b/SoftwareInstallation/SoftwareInstallationDatabaseImplement/OrderStorage.cs @@ -24,11 +24,19 @@ namespace SoftwareInstallationDatabaseImplement public List GetFilteredList(OrderSearchModel model) { - if (!model.Id.HasValue) + if (!model.Id.HasValue && !model.DateFrom.HasValue) { return new(); } using var context = new SoftwareInstallationDatabase(); + if (model.DateFrom.HasValue) + { + return context.Orders + .Include(x => x.Package) + .Where(x => x.DateCreate >= model.DateFrom && x.DateCreate <= model.DateTo) + .Select(x => x.GetViewModel) + .ToList(); + } return context.Orders .Include(x => x.Package) .Where(x => x.Id == model.Id) diff --git a/SoftwareInstallation/SoftwareInstallationView/FormReportOrders.Designer.cs b/SoftwareInstallation/SoftwareInstallationView/FormReportOrders.Designer.cs index b2f3b99..4b2fa02 100644 --- a/SoftwareInstallation/SoftwareInstallationView/FormReportOrders.Designer.cs +++ b/SoftwareInstallation/SoftwareInstallationView/FormReportOrders.Designer.cs @@ -46,7 +46,8 @@ panel.Controls.Add(dateTimePickerStart); panel.Controls.Add(labelEnd); panel.Controls.Add(labelStart); - panel.Location = new Point(1, 0); + panel.Dock = DockStyle.Top; + panel.Location = new Point(0, 0); panel.Name = "panel"; panel.Size = new Size(800, 77); panel.TabIndex = 0; diff --git a/SoftwareInstallation/SoftwareInstallationView/FormReportOrders.cs b/SoftwareInstallation/SoftwareInstallationView/FormReportOrders.cs index 70b1dc7..0c82b35 100644 --- a/SoftwareInstallation/SoftwareInstallationView/FormReportOrders.cs +++ b/SoftwareInstallation/SoftwareInstallationView/FormReportOrders.cs @@ -28,7 +28,7 @@ namespace SoftwareInstallationView { Dock = DockStyle.Fill }; - reportViewer.LocalReport.LoadReportDefinition(new FileStream("ReportOrders.rdlc", FileMode.Open)); + reportViewer.LocalReport.LoadReportDefinition(new FileStream("D:\\RPP\\SoftwareInstallation\\SoftwareInstallationView\\ReportOrders.rdlc", FileMode.Open)); Controls.Clear(); Controls.Add(reportViewer); Controls.Add(panel); diff --git a/SoftwareInstallation/SoftwareInstallationView/FormReportPackageComponents.Designer.cs b/SoftwareInstallation/SoftwareInstallationView/FormReportPackageComponents.Designer.cs index 25fa64a..bead421 100644 --- a/SoftwareInstallation/SoftwareInstallationView/FormReportPackageComponents.Designer.cs +++ b/SoftwareInstallation/SoftwareInstallationView/FormReportPackageComponents.Designer.cs @@ -79,6 +79,7 @@ Controls.Add(buttonSaveToExcel); Name = "FormReportPackageComponents"; Text = "Компоненты по изделиям"; + Load += FormReportPackageComponents_Load; ((System.ComponentModel.ISupportInitialize)dataGridView).EndInit(); ResumeLayout(false); } diff --git a/SoftwareInstallation/SoftwareInstallationView/FormReportPackageComponents.cs b/SoftwareInstallation/SoftwareInstallationView/FormReportPackageComponents.cs index 01ef712..98cfdf9 100644 --- a/SoftwareInstallation/SoftwareInstallationView/FormReportPackageComponents.cs +++ b/SoftwareInstallation/SoftwareInstallationView/FormReportPackageComponents.cs @@ -56,7 +56,7 @@ namespace SoftwareInstallationView dataGridView.Rows.Clear(); foreach (var elem in dict) { - dataGridView.Rows.Add(new object[] { elem.SoftwareName, "", "" }); + dataGridView.Rows.Add(new object[] { elem.PackageName, "", "" }); foreach (var listElem in elem.Components) { dataGridView.Rows.Add(new object[] { "", listElem.Item1, listElem.Item2 }); diff --git a/SoftwareInstallation/SoftwareInstallationView/SoftwareInstallationView.csproj b/SoftwareInstallation/SoftwareInstallationView/SoftwareInstallationView.csproj index 9ffe13f..f7a7b55 100644 --- a/SoftwareInstallation/SoftwareInstallationView/SoftwareInstallationView.csproj +++ b/SoftwareInstallation/SoftwareInstallationView/SoftwareInstallationView.csproj @@ -9,14 +9,13 @@ - - + all runtime; build; native; contentfiles; analyzers; buildtransitive - +