diff --git a/TravelCompany/TracelCompanyFileImplement/Implements/OrderStorage.cs b/TravelCompany/TracelCompanyFileImplement/Implements/OrderStorage.cs index a6ed4b8..ae7e29c 100644 --- a/TravelCompany/TracelCompanyFileImplement/Implements/OrderStorage.cs +++ b/TravelCompany/TracelCompanyFileImplement/Implements/OrderStorage.cs @@ -31,10 +31,17 @@ namespace TravelCompanyFileImplement.Implements public List GetFilteredList(OrderSearchModel model) { - if (!model.Id.HasValue) + if (!model.Id.HasValue && !model.DateFrom.HasValue) { return new(); } + if (model.DateFrom.HasValue) + { + return source.Orders + .Where(x => x.DateCreate >= model.DateFrom && x.DateCreate <= model.DateTo) + .Select(x => x.GetViewModel) + .ToList(); + } return source.Orders.Where(x => x.Id == model.Id).Select(x => GetViewModel(x)).ToList(); } diff --git a/TravelCompany/TravelCompany/FormMain.cs b/TravelCompany/TravelCompany/FormMain.cs index 62279bc..b903296 100644 --- a/TravelCompany/TravelCompany/FormMain.cs +++ b/TravelCompany/TravelCompany/FormMain.cs @@ -162,7 +162,7 @@ namespace TravelCompanyView using var dialog = new SaveFileDialog { Filter = "docx|*.docx" }; if (dialog.ShowDialog() == DialogResult.OK) { - _reportLogic.SaveTravelsToWordFile(new ReportBindingModel + _reportLogic.SaveComponentsToWordFile(new ReportBindingModel { FileName = dialog.FileName }); diff --git a/TravelCompany/TravelCompany/FormReportOrders.Designer.cs b/TravelCompany/TravelCompany/FormReportOrders.Designer.cs index 5cdc827..ce42d26 100644 --- a/TravelCompany/TravelCompany/FormReportOrders.Designer.cs +++ b/TravelCompany/TravelCompany/FormReportOrders.Designer.cs @@ -113,7 +113,7 @@ // AutoScaleDimensions = new SizeF(7F, 15F); AutoScaleMode = AutoScaleMode.Font; - ClientSize = new Size(861, 338); + ClientSize = new Size(861, 505); Controls.Add(panel); Margin = new Padding(3, 2, 3, 2); Name = "FormReportOrders"; diff --git a/TravelCompany/TravelCompany/FormReportOrders.cs b/TravelCompany/TravelCompany/FormReportOrders.cs index 1892910..f46c718 100644 --- a/TravelCompany/TravelCompany/FormReportOrders.cs +++ b/TravelCompany/TravelCompany/FormReportOrders.cs @@ -52,7 +52,7 @@ namespace TravelCompanyView var source = new ReportDataSource("DataSetOrders", dataSource); reportViewer.LocalReport.DataSources.Clear(); reportViewer.LocalReport.DataSources.Add(source); - var parameters = new[] { new ReportParameter("ReportParameterPeriod", $"c{dateTimePickerStart.Value.ToShortDateString()} по {dateTimePickerEnd.Value.ToShortDateString()}") }; + var parameters = new[] { new ReportParameter("ReportParameterPeriod", $"c {dateTimePickerStart.Value.ToShortDateString()} по {dateTimePickerEnd.Value.ToShortDateString()}") }; reportViewer.LocalReport.SetParameters(parameters); reportViewer.RefreshReport(); _logger.LogInformation("Загрузка списка заказов на период {From}-{ To}", dateTimePickerStart.Value.ToShortDateString(), dateTimePickerEnd.Value.ToShortDateString()); diff --git a/TravelCompany/TravelCompany/ReportOrders.rdlc b/TravelCompany/TravelCompany/ReportOrders.rdlc index 54e1ac3..ab76d64 100644 --- a/TravelCompany/TravelCompany/ReportOrders.rdlc +++ b/TravelCompany/TravelCompany/ReportOrders.rdlc @@ -1,19 +1,90 @@ + 0 + + + + System.Data.DataSet + /* Local Connection */ + + 10791c83-cee8-4a38-bbd0-245fc17cefb3 + + - - + TravelCompanyContractsViewModels + /* Local Query */ + + + Id + System.Int32 + + + DateCreate + System.DateTime + + + TravelName + System.String + + + Sum + System.Decimal + + + Status + System.String + + + + TravelCompanyContracts.ViewModels + ReportOrdersViewModel + TravelCompanyContracts.ViewModels.ReportOrdersViewModel, TravelCompanyContracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + - + + true + true + + + + + =Parameters!ReportParameterPeriod.Value + + + + + + + ReportParameterPeriod + 1cm + 1cm + 21cm + + + Middle + 2pt + 2pt + 2pt + 2pt + + + true true @@ -32,9 +103,9 @@ - Textbox2 - 0.9937cm - 16.51cm + 1cm + 21cm + 1 @@ -46,11 +117,452 @@ 2pt + + + + + 2.5cm + + + 3.21438cm + + + 8.23317cm + + + 2.5cm + + + 2.5cm + + + + + 0.6cm + + + + + true + true + + + + + Номер + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Дата создания + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Путевка + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Сумма + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Статус + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + =Fields!Id.Value + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!DateCreate.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!TravelName.Value + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Sum.Value + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Status.Value + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + After + + + + + + + DataSetOrders + 2.48391cm + 0.55245cm + 1.2cm + 18.94755cm + 2 + + + + + + true + true + + + + + Итого: + + + + + + + 4cm + 12cm + 0.6cm + 2.5cm + 3 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Sum(Fields!Sum.Value, "DataSetOrders") + + + + + + + 4cm + 14.5cm + 0.6cm + 2.5cm + 4 + + + 2pt + 2pt + 2pt + 2pt + + - 2in + 5.72875cm