diff --git a/ComputersShop/ComputersShopBusinessLogic/BusinessLogics/ReportLogic.cs b/ComputersShop/ComputersShopBusinessLogic/BusinessLogics/ReportLogic.cs
index a20ea35..904e069 100644
--- a/ComputersShop/ComputersShopBusinessLogic/BusinessLogics/ReportLogic.cs
+++ b/ComputersShop/ComputersShopBusinessLogic/BusinessLogics/ReportLogic.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -16,108 +17,88 @@ namespace ComputersShopBusinessLogic.BusinessLogics
{
public class ReportLogic : IReportLogic
{
- private readonly IComponentStorage _componentStorage;
private readonly IComputerStorage _computerStorage;
+
private readonly IOrderStorage _orderStorage;
+
private readonly AbstractSaveToExcel _saveToExcel;
+
private readonly AbstractSaveToWord _saveToWord;
+
private readonly AbstractSaveToPdf _saveToPdf;
- public ReportLogic(IComputerStorage computerStorage, IComponentStorage
- componentStorage, IOrderStorage orderStorage,
- AbstractSaveToExcel saveToExcel, AbstractSaveToWord saveToWord,
- AbstractSaveToPdf saveToPdf)
+
+ public ReportLogic(IComputerStorage computerStorage, IComponentStorage componentStorage, IOrderStorage orderStorage,
+ AbstractSaveToExcel saveToExcel, AbstractSaveToWord saveToWord, AbstractSaveToPdf saveToPdf)
{
_computerStorage = computerStorage;
- _componentStorage = componentStorage;
_orderStorage = orderStorage;
+
_saveToExcel = saveToExcel;
_saveToWord = saveToWord;
_saveToPdf = saveToPdf;
}
- ///
- /// Получение списка компонент с указанием, в каких изделиях используются
- ///
- ///
- public List GetComputerComponent()
+
+ public List GetComputerComponents()
{
- var components = _componentStorage.GetFullList();
+
var computers = _computerStorage.GetFullList();
+
var list = new List();
- foreach (var component in components)
+
+ foreach (var computer in computers)
{
var record = new ReportComputerComponentViewModel
{
- ComponentName = component.ComponentName,
- Computers = new List>(),
- TotalCount = 0
+ ComputerName = computer.ComputerName,
+ Components = new List<(string Component, int Count)>(),
+ TotalCount = 0,
};
- foreach (var computer in computers)
+ foreach (var component in computer.ComputerComponents)
{
- if (computer.ComputerComponents.ContainsKey(component.Id))
- {
- record.Computers.Add(new Tuple(computer.ComputerName, computer.ComputerComponents[component.Id].Item2));
- record.TotalCount +=
- computer.ComputerComponents[component.Id].Item2;
- }
+ record.Components.Add(new(component.Value.Item1.ComponentName, component.Value.Item2));
+ record.TotalCount += component.Value.Item2;
}
+
list.Add(record);
}
+
return list;
}
- ///
- /// Получение списка заказов за определенный период
- ///
- ///
- ///
+
public List GetOrders(ReportBindingModel model)
{
- return _orderStorage.GetFiltredList(new OrderSearchModel
- {
- DateFrom
- = model.DateFrom,
- DateTo = model.DateTo
- })
- .Select(x => new ReportOrdersViewModel
- {
- Id = x.Id,
- DateCreate = x.DateCreate,
- ComputerName = x.ComputerName,
- Sum = x.Sum,
- Status = x.Status.ToString(),
- })
- .ToList();
+ return _orderStorage.GetFiltredList(new OrderSearchModel { DateFrom = model.DateFrom, DateTo = model.DateTo })
+ .Select(x => new ReportOrdersViewModel
+ {
+ Id = x.Id,
+ DateCreate = x.DateCreate,
+ ComputerName = x.ComputerName,
+ Status = x.Status.ToString(),
+ Sum = x.Sum
+ })
+ .ToList();
}
- ///
- /// Сохранение компонент в файл-Word
- ///
- ///
+
public void SaveComputersToWordFile(ReportBindingModel model)
{
_saveToWord.CreateDoc(new WordInfo
{
FileName = model.FileName,
- Title = "Список компонент",
- Components = _componentStorage.GetFullList()
+ Title = "Список компонентов",
+ Computers = _computerStorage.GetFullList()
});
}
- ///
- /// Сохранение компонент с указаеним продуктов в файл-Excel
- ///
- ///
+
public void SaveComputerComponentToExcelFile(ReportBindingModel model)
{
_saveToExcel.CreateReport(new ExcelInfo
{
FileName = model.FileName,
- Title = "Список компонент",
- ComputerComponents = GetComputerComponent()
+ Title = "Список компонентов",
+ ComputerComponents = GetComputerComponents()
});
}
- ///
- /// Сохранение заказов в файл-Pdf
- ///
- ///
+
public void SaveOrdersToPdfFile(ReportBindingModel model)
{
_saveToPdf.CreateDoc(new PdfInfo
diff --git a/ComputersShop/ComputersShopBusinessLogic/ComputersShopBusinessLogic.csproj b/ComputersShop/ComputersShopBusinessLogic/ComputersShopBusinessLogic.csproj
index 8cab77d..1fee6c8 100644
--- a/ComputersShop/ComputersShopBusinessLogic/ComputersShopBusinessLogic.csproj
+++ b/ComputersShop/ComputersShopBusinessLogic/ComputersShopBusinessLogic.csproj
@@ -9,7 +9,7 @@
-
+
diff --git a/ComputersShop/ComputersShopBusinessLogic/OfficePackage/AbstractSaveToExcel.cs b/ComputersShop/ComputersShopBusinessLogic/OfficePackage/AbstractSaveToExcel.cs
index 69461ed..7dd9c95 100644
--- a/ComputersShop/ComputersShopBusinessLogic/OfficePackage/AbstractSaveToExcel.cs
+++ b/ComputersShop/ComputersShopBusinessLogic/OfficePackage/AbstractSaveToExcel.cs
@@ -36,11 +36,11 @@ namespace ComputersShopBusinessLogic.OfficePackage
{
ColumnName = "A",
RowIndex = rowIndex,
- Text = pc.ComponentName,
+ Text = pc.ComputerName,
StyleInfo = ExcelStyleInfoType.Text
});
rowIndex++;
- foreach (var computer in pc.Computers)
+ foreach (var computer in pc.Components)
{
InsertCellInWorksheet(new ExcelCellParameters
{
diff --git a/ComputersShop/ComputersShopBusinessLogic/OfficePackage/AbstractSaveToPdf.cs b/ComputersShop/ComputersShopBusinessLogic/OfficePackage/AbstractSaveToPdf.cs
index 75529d2..13068dc 100644
--- a/ComputersShop/ComputersShopBusinessLogic/OfficePackage/AbstractSaveToPdf.cs
+++ b/ComputersShop/ComputersShopBusinessLogic/OfficePackage/AbstractSaveToPdf.cs
@@ -25,10 +25,10 @@ namespace ComputersShopBusinessLogic.OfficePackage
Text = $"с { info.DateFrom.ToShortDateString() } по { info.DateTo.ToShortDateString() }", Style = "Normal",
ParagraphAlignment = PdfParagraphAlignmentType.Center
});
- CreateTable(new List { "2cm", "3cm", "6cm", "3cm" });
+ CreateTable(new List { "2cm", "3cm", "6cm", "3cm", "3cm" });
CreateRow(new PdfRowParameters
{
- Texts = new List { "Номер", "Дата заказа", "Изделие", "Сумма" },
+ Texts = new List { "Номер", "Дата заказа", "Изделие", "Сумма", "Статус" },
Style = "NormalTitle",
ParagraphAlignment = PdfParagraphAlignmentType.Center
});
@@ -36,7 +36,8 @@ namespace ComputersShopBusinessLogic.OfficePackage
{
CreateRow(new PdfRowParameters
{
- Texts = new List { order.Id.ToString(), order.DateCreate.ToShortDateString(), order.ComputerName, order.Sum.ToString() },
+ Texts = new List { order.Id.ToString(), order.DateCreate.ToShortDateString(), order.ComputerName, order.Sum.ToString(),
+ order.Status },
Style = "Normal",
ParagraphAlignment = PdfParagraphAlignmentType.Left
});
diff --git a/ComputersShop/ComputersShopBusinessLogic/OfficePackage/AbstractSaveToWord.cs b/ComputersShop/ComputersShopBusinessLogic/OfficePackage/AbstractSaveToWord.cs
index 86550d0..4aac59d 100644
--- a/ComputersShop/ComputersShopBusinessLogic/OfficePackage/AbstractSaveToWord.cs
+++ b/ComputersShop/ComputersShopBusinessLogic/OfficePackage/AbstractSaveToWord.cs
@@ -15,20 +15,19 @@ namespace ComputersShopBusinessLogic.OfficePackage
CreateWord(info);
CreateParagraph(new WordParagraph
{
- Texts = new List<(string, WordTextProperties)> { (info.Title, new
-WordTextProperties { Bold = true, Size = "24", }) },
+ Texts = new List<(string, WordTextProperties)> { (info.Title, new WordTextProperties { Bold = true, Size = "24", }) },
TextProperties = new WordTextProperties
{
Size = "24",
JustificationType = WordJustificationType.Center
}
});
- foreach (var component in info.Components)
+ foreach (var computer in info.Computers)
{
CreateParagraph(new WordParagraph
{
- Texts = new List<(string, WordTextProperties)> {
-(component.ComponentName, new WordTextProperties { Size = "24", }) },
+ Texts = new List<(string, WordTextProperties)> {(computer.ComputerName + " - ", new WordTextProperties { Size = "24", Bold = true}),
+ (computer.Price.ToString(), new WordTextProperties { Size = "24", })},
TextProperties = new WordTextProperties
{
Size = "24",
diff --git a/ComputersShop/ComputersShopBusinessLogic/OfficePackage/HelperModels/WordInfo.cs b/ComputersShop/ComputersShopBusinessLogic/OfficePackage/HelperModels/WordInfo.cs
index 225109c..f7012a3 100644
--- a/ComputersShop/ComputersShopBusinessLogic/OfficePackage/HelperModels/WordInfo.cs
+++ b/ComputersShop/ComputersShopBusinessLogic/OfficePackage/HelperModels/WordInfo.cs
@@ -12,7 +12,7 @@ namespace ComputersShopBusinessLogic.OfficePackage.HelperModels
{
public string FileName { get; set; } = string.Empty;
public string Title { get; set; } = string.Empty;
- public List Components { get; set; } = new();
+ public List Computers { get; set; } = new();
}
}
diff --git a/ComputersShop/ComputersShopContracts/BusinessLogicsContracts/IReportLogic.cs b/ComputersShop/ComputersShopContracts/BusinessLogicsContracts/IReportLogic.cs
index f999fe8..e4e0c25 100644
--- a/ComputersShop/ComputersShopContracts/BusinessLogicsContracts/IReportLogic.cs
+++ b/ComputersShop/ComputersShopContracts/BusinessLogicsContracts/IReportLogic.cs
@@ -12,10 +12,14 @@ namespace ComputersShopContracts.BusinessLogicsContracts
{
public interface IReportLogic
{
- List GetComputerComponent();
+ List GetComputerComponents();
+
List GetOrders(ReportBindingModel model);
+
void SaveComputersToWordFile(ReportBindingModel model);
+
void SaveComputerComponentToExcelFile(ReportBindingModel model);
+
void SaveOrdersToPdfFile(ReportBindingModel model);
}
}
diff --git a/ComputersShop/ComputersShopContracts/ViewModels/ReportComputerComponentViewModel.cs b/ComputersShop/ComputersShopContracts/ViewModels/ReportComputerComponentViewModel.cs
index ebb4be3..6c1c5d0 100644
--- a/ComputersShop/ComputersShopContracts/ViewModels/ReportComputerComponentViewModel.cs
+++ b/ComputersShop/ComputersShopContracts/ViewModels/ReportComputerComponentViewModel.cs
@@ -8,8 +8,8 @@ namespace ComputersShopContracts.ViewModels
{
public class ReportComputerComponentViewModel
{
- public string ComponentName { get; set; } = string.Empty;
+ public string ComputerName { get; set; } = string.Empty;
public int TotalCount { get; set; }
- public List> Computers { get; set; } = new();
+ public List<(string Component, int Count)> Components { get; set; } = new();
}
}
diff --git a/ComputersShop/ComputersShopDatabaseImplement/Implements/OrderStorage.cs b/ComputersShop/ComputersShopDatabaseImplement/Implements/OrderStorage.cs
index 998f763..5cc0342 100644
--- a/ComputersShop/ComputersShopDatabaseImplement/Implements/OrderStorage.cs
+++ b/ComputersShop/ComputersShopDatabaseImplement/Implements/OrderStorage.cs
@@ -25,13 +25,24 @@ namespace ComputersShopDatabaseImplement.Implements
}
public List GetFiltredList(OrderSearchModel model)
{
- if (!model.Id.HasValue)
+ if (!model.Id.HasValue && !model.DateFrom.HasValue)
{
return new();
}
using var context = new ComputersShopDatabase();
- return context.Orders.Where(x => x.Id == model.Id).Include(x => x.Computer)
- .Select(x => x.GetViewModel).ToList();
+ if (model.DateFrom.HasValue)
+ {
+ return context.Orders
+ .Include(x => x.Computer)
+ .Where(x => x.DateCreate >= model.DateFrom && x.DateCreate <= model.DateTo)
+ .Select(x => x.GetViewModel)
+ .ToList();
+ }
+ return context.Orders
+ .Include(x => x.Computer)
+ .Where(x => x.Id == model.Id)
+ .Select(x => x.GetViewModel)
+ .ToList();
}
public List GetFullList()
{
diff --git a/ComputersShop/ComputersShopFileImplement/Implements/OrderStorage.cs b/ComputersShop/ComputersShopFileImplement/Implements/OrderStorage.cs
index 3317c1c..530793c 100644
--- a/ComputersShop/ComputersShopFileImplement/Implements/OrderStorage.cs
+++ b/ComputersShop/ComputersShopFileImplement/Implements/OrderStorage.cs
@@ -24,11 +24,21 @@ namespace ComputersShopFileImplement.Implements
}
public List GetFiltredList(OrderSearchModel model)
{
- if (!model.Id.HasValue)
+ if (!model.Id.HasValue && !model.DateFrom.HasValue)
{
return new();
}
- return source.Orders.Where(x => x.Id == model.Id).Select(x => GetViewModel(x)).ToList();
+ if (model.DateFrom.HasValue)
+ {
+ return source.Orders
+ .Where(x => x.DateCreate >= model.DateFrom && x.DateCreate <= model.DateTo)
+ .Select(x => AddComputerName(x.GetViewModel))
+ .ToList();
+ }
+ return source.Orders
+ .Where(x => x.Id == model.Id)
+ .Select(x => AddComputerName(x.GetViewModel))
+ .ToList();
}
public OrderViewModel? GetElement(OrderSearchModel model)
{
@@ -79,5 +89,14 @@ namespace ComputersShopFileImplement.Implements
viewModel.ComputerName = computer?.ComputerName;
return viewModel;
}
+ private OrderViewModel AddComputerName(OrderViewModel model)
+ {
+ var selectedPastry = source.Computers.FirstOrDefault(x => x.Id == model.ComputerId);
+ if (selectedPastry != null)
+ {
+ model.ComputerName = selectedPastry.ComputerName;
+ }
+ return model;
+ }
}
}
diff --git a/ComputersShop/ComputersShopListImplement/Implements/OrderStorage.cs b/ComputersShop/ComputersShopListImplement/Implements/OrderStorage.cs
index 56af78b..5967de4 100644
--- a/ComputersShop/ComputersShopListImplement/Implements/OrderStorage.cs
+++ b/ComputersShop/ComputersShopListImplement/Implements/OrderStorage.cs
@@ -31,15 +31,18 @@ namespace ComputersShopListImplement.Implements
public List GetFiltredList(OrderSearchModel model)
{
var result = new List();
- if (model == null || !model.Id.HasValue)
+ if (!model.Id.HasValue && !model.DateFrom.HasValue)
{
return result;
}
- foreach (var order in _source.Orders)
+ if (model.DateFrom.HasValue)
{
- if (order.Id == model.Id)
+ foreach (var order in _source.Orders)
{
- result.Add(AddComputerName(order.GetViewModel));
+ if (order.Id == model.Id)
+ {
+ result.Add(AddComputerName(order.GetViewModel));
+ }
}
}
return result;
diff --git a/ComputersShop/ComputersShopView/FormReportComputerComponents.Designer.cs b/ComputersShop/ComputersShopView/FormReportComputerComponents.Designer.cs
index 33a28c2..5b3501b 100644
--- a/ComputersShop/ComputersShopView/FormReportComputerComponents.Designer.cs
+++ b/ComputersShop/ComputersShopView/FormReportComputerComponents.Designer.cs
@@ -30,8 +30,8 @@
{
this.buttonSave = new System.Windows.Forms.Button();
this.dataGridView = new System.Windows.Forms.DataGridView();
- this.Component = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Computer = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.Component = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Count = new System.Windows.Forms.DataGridViewTextBoxColumn();
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
this.SuspendLayout();
@@ -50,8 +50,8 @@
//
this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
- this.Component,
this.Computer,
+ this.Component,
this.Count});
this.dataGridView.Location = new System.Drawing.Point(4, 82);
this.dataGridView.Name = "dataGridView";
@@ -60,13 +60,6 @@
this.dataGridView.Size = new System.Drawing.Size(634, 362);
this.dataGridView.TabIndex = 1;
//
- // Component
- //
- this.Component.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
- this.Component.HeaderText = "Компонент";
- this.Component.MinimumWidth = 6;
- this.Component.Name = "Component";
- //
// Computer
//
this.Computer.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
@@ -74,6 +67,13 @@
this.Computer.MinimumWidth = 6;
this.Computer.Name = "Computer";
//
+ // Component
+ //
+ this.Component.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
+ this.Component.HeaderText = "Компонент";
+ this.Component.MinimumWidth = 6;
+ this.Component.Name = "Component";
+ //
// Count
//
this.Count.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
@@ -100,8 +100,8 @@
private Button buttonSave;
private DataGridView dataGridView;
- private DataGridViewTextBoxColumn Component;
private DataGridViewTextBoxColumn Computer;
+ private DataGridViewTextBoxColumn Component;
private DataGridViewTextBoxColumn Count;
}
}
\ No newline at end of file
diff --git a/ComputersShop/ComputersShopView/FormReportComputerComponents.cs b/ComputersShop/ComputersShopView/FormReportComputerComponents.cs
index fe096f3..563c516 100644
--- a/ComputersShop/ComputersShopView/FormReportComputerComponents.cs
+++ b/ComputersShop/ComputersShopView/FormReportComputerComponents.cs
@@ -27,14 +27,14 @@ namespace ComputersShopView
{
try
{
- var dict = _logic.GetComputerComponent();
+ var dict = _logic.GetComputerComponents();
if (dict != null)
{
dataGridView.Rows.Clear();
foreach (var elem in dict)
{
- dataGridView.Rows.Add(new object[] { elem.ComponentName, "", "" });
- foreach (var listElem in elem.Computers)
+ dataGridView.Rows.Add(new object[] { elem.ComputerName, "", "" });
+ foreach (var listElem in elem.Components)
{
dataGridView.Rows.Add(new object[] { "", listElem.Item1, listElem.Item2 });
}
@@ -47,37 +47,27 @@ namespace ComputersShopView
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка загрузки списка изделий по компонентам");
-
- MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK,
- MessageBoxIcon.Error);
+ MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonSaveToExcel_Click(object sender, EventArgs e)
{
- using var dialog = new SaveFileDialog
- {
- Filter = "xlsx|*.xlsx"
- };
+ using var dialog = new SaveFileDialog { Filter = "xlsx|*.xlsx" };
if (dialog.ShowDialog() == DialogResult.OK)
{
try
{
- _logic.SaveComputerComponentToExcelFile(new
- ReportBindingModel
+ _logic.SaveComputerComponentToExcelFile(new ReportBindingModel
{
FileName = dialog.FileName
});
- _logger.LogInformation("Сохранение списка изделий по компонентам");
-
- MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK,
- MessageBoxIcon.Information);
+ _logger.LogInformation("Saving list of ice creams with components");
+ MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)
{
- _logger.LogError(ex, "Ошибка сохранения списка изделий по компонентам");
-
- MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK,
- MessageBoxIcon.Error);
+ _logger.LogError(ex, "Saving list of ice creams with components error");
+ MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
diff --git a/ComputersShop/ComputersShopView/FormReportComputerComponents.resx b/ComputersShop/ComputersShopView/FormReportComputerComponents.resx
index 16d38d6..e97b36c 100644
--- a/ComputersShop/ComputersShopView/FormReportComputerComponents.resx
+++ b/ComputersShop/ComputersShopView/FormReportComputerComponents.resx
@@ -57,10 +57,10 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
+
True
-
+
True
diff --git a/ComputersShop/ComputersShopView/FormReportOrders.Designer.cs b/ComputersShop/ComputersShopView/FormReportOrders.Designer.cs
index 1a5fc84..a1310ee 100644
--- a/ComputersShop/ComputersShopView/FormReportOrders.Designer.cs
+++ b/ComputersShop/ComputersShopView/FormReportOrders.Designer.cs
@@ -28,84 +28,87 @@
///
private void InitializeComponent()
{
- this.button1 = new System.Windows.Forms.Button();
- this.button2 = new System.Windows.Forms.Button();
- this.label1 = new System.Windows.Forms.Label();
+ this.panel = new System.Windows.Forms.Panel();
+ this.buttonToPdf = new System.Windows.Forms.Button();
+ this.buttonMake = new System.Windows.Forms.Button();
this.label2 = new System.Windows.Forms.Label();
+ this.label1 = new System.Windows.Forms.Label();
this.dateTimePickerFrom = new System.Windows.Forms.DateTimePicker();
this.dateTimePickerTo = new System.Windows.Forms.DateTimePicker();
- this.panel = new System.Windows.Forms.Panel();
this.panel.SuspendLayout();
this.SuspendLayout();
//
- // button1
+ // panel
//
- this.button1.Location = new System.Drawing.Point(608, 16);
- this.button1.Name = "button1";
- this.button1.Size = new System.Drawing.Size(129, 29);
- this.button1.TabIndex = 0;
- this.button1.Text = "Сформировать";
- this.button1.UseVisualStyleBackColor = true;
+ this.panel.Controls.Add(this.buttonToPdf);
+ this.panel.Controls.Add(this.buttonMake);
+ this.panel.Controls.Add(this.label2);
+ this.panel.Controls.Add(this.label1);
+ this.panel.Controls.Add(this.dateTimePickerFrom);
+ this.panel.Controls.Add(this.dateTimePickerTo);
+ this.panel.Dock = System.Windows.Forms.DockStyle.Top;
+ this.panel.Location = new System.Drawing.Point(0, 0);
+ this.panel.Name = "panel";
+ this.panel.Size = new System.Drawing.Size(908, 60);
+ this.panel.TabIndex = 0;
//
- // button2
+ // buttonToPdf
//
- this.button2.Location = new System.Drawing.Point(793, 16);
- this.button2.Name = "button2";
- this.button2.Size = new System.Drawing.Size(94, 29);
- this.button2.TabIndex = 1;
- this.button2.Text = "В Pdf";
- this.button2.UseVisualStyleBackColor = true;
+ this.buttonToPdf.Location = new System.Drawing.Point(785, 19);
+ this.buttonToPdf.Name = "buttonToPdf";
+ this.buttonToPdf.Size = new System.Drawing.Size(94, 29);
+ this.buttonToPdf.TabIndex = 6;
+ this.buttonToPdf.Text = "В Pdf";
+ this.buttonToPdf.UseVisualStyleBackColor = true;
+ this.buttonToPdf.Click += new System.EventHandler(this.ButtonToPdf_Click);
//
- // label1
+ // buttonMake
//
- this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(4, 25);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(18, 20);
- this.label1.TabIndex = 2;
- this.label1.Text = "С";
+ this.buttonMake.Location = new System.Drawing.Point(548, 16);
+ this.buttonMake.Name = "buttonMake";
+ this.buttonMake.Size = new System.Drawing.Size(160, 29);
+ this.buttonMake.TabIndex = 5;
+ this.buttonMake.Text = "Сформировать";
+ this.buttonMake.UseVisualStyleBackColor = true;
+ this.buttonMake.Click += new System.EventHandler(this.ButtonMake_Click);
//
// label2
//
this.label2.AutoSize = true;
- this.label2.Location = new System.Drawing.Point(275, 21);
+ this.label2.Location = new System.Drawing.Point(267, 25);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(27, 20);
- this.label2.TabIndex = 3;
+ this.label2.TabIndex = 4;
this.label2.Text = "по";
//
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(11, 25);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(18, 20);
+ this.label1.TabIndex = 3;
+ this.label1.Text = "С";
+ //
// dateTimePickerFrom
//
- this.dateTimePickerFrom.Location = new System.Drawing.Point(48, 16);
+ this.dateTimePickerFrom.Location = new System.Drawing.Point(67, 18);
this.dateTimePickerFrom.Name = "dateTimePickerFrom";
- this.dateTimePickerFrom.Size = new System.Drawing.Size(203, 27);
- this.dateTimePickerFrom.TabIndex = 4;
+ this.dateTimePickerFrom.Size = new System.Drawing.Size(184, 27);
+ this.dateTimePickerFrom.TabIndex = 1;
//
// dateTimePickerTo
//
- this.dateTimePickerTo.Location = new System.Drawing.Point(341, 16);
+ this.dateTimePickerTo.Location = new System.Drawing.Point(332, 18);
this.dateTimePickerTo.Name = "dateTimePickerTo";
- this.dateTimePickerTo.Size = new System.Drawing.Size(203, 27);
- this.dateTimePickerTo.TabIndex = 5;
- //
- // panel
- //
- this.panel.Controls.Add(this.label1);
- this.panel.Controls.Add(this.dateTimePickerTo);
- this.panel.Controls.Add(this.dateTimePickerFrom);
- this.panel.Controls.Add(this.label2);
- this.panel.Controls.Add(this.button1);
- this.panel.Controls.Add(this.button2);
- this.panel.Location = new System.Drawing.Point(8, 9);
- this.panel.Name = "panel";
- this.panel.Size = new System.Drawing.Size(895, 85);
- this.panel.TabIndex = 6;
+ this.dateTimePickerTo.Size = new System.Drawing.Size(182, 27);
+ this.dateTimePickerTo.TabIndex = 2;
//
// FormReportOrders
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(908, 158);
+ this.ClientSize = new System.Drawing.Size(908, 365);
this.Controls.Add(this.panel);
this.Name = "FormReportOrders";
this.Text = "Заказы";
@@ -117,12 +120,12 @@
#endregion
- private Button button1;
- private Button button2;
- private Label label1;
+ private Panel panel;
+ private Button buttonToPdf;
+ private Button buttonMake;
private Label label2;
+ private Label label1;
private DateTimePicker dateTimePickerFrom;
private DateTimePicker dateTimePickerTo;
- private Panel panel;
}
}
\ No newline at end of file
diff --git a/ComputersShop/ComputersShopView/FormReportOrders.cs b/ComputersShop/ComputersShopView/FormReportOrders.cs
index 6b1db73..4c8ff82 100644
--- a/ComputersShop/ComputersShopView/FormReportOrders.cs
+++ b/ComputersShop/ComputersShopView/FormReportOrders.cs
@@ -30,7 +30,7 @@ namespace ComputersShopView
Dock = DockStyle.Fill
};
reportViewer.LocalReport.LoadReportDefinition(new
- FileStream("ReportOrders.rdlc", FileMode.Open));
+ FileStream("C:\\Users\\midni\\универ\\2 курс\\РПП1\\ComputersShop\\ComputersShopView\\ReportOrders.rdlc", FileMode.Open));
Controls.Clear();
Controls.Add(reportViewer);
Controls.Add(panel);
@@ -87,7 +87,7 @@ namespace ComputersShopView
DateFrom = dateTimePickerFrom.Value,
DateTo = dateTimePickerTo.Value
});
- _logger.LogInformation("Сохранение списка заказов на { From -{ To ", dateTimePickerFrom.Value.ToShortDateString(), dateTimePickerTo.Value.ToShortDateString());
+ _logger.LogInformation("Сохранение списка заказов на { From} -{ To}", dateTimePickerFrom.Value.ToShortDateString(), dateTimePickerTo.Value.ToShortDateString());
MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK,
MessageBoxIcon.Information);
}
diff --git a/ComputersShop/ComputersShopView/ReportOrders.rdlc b/ComputersShop/ComputersShopView/ReportOrders.rdlc
index 91ec937..3624f02 100644
--- a/ComputersShop/ComputersShopView/ReportOrders.rdlc
+++ b/ComputersShop/ComputersShopView/ReportOrders.rdlc
@@ -1,57 +1,599 @@
-
-
-
-
- true
- true
-
-
-
-
- Заказы
-
-
-
-
-
-
- Textbox1
- 0.03387cm
- 0.97367cm
- 16.51cm
-
-
- Middle
- 2pt
- 2pt
- 2pt
- 2pt
-
-
-
- 2in
-
-
- 6.5in
-
- 29.7cm
- 21cm
- 2cm
- 2cm
- 2cm
- 2cm
- 0.13cm
-
-
+
0
+
+
+
+ System.Data.DataSet
+ /* Local Connection */
+
+ 47cb53f0-7dde-4717-ba03-866a0bc4f4dd
+
+
+
+
+
+ ComputersShopContractsViewModels
+ /* Local Query */
+
+
+
+ Id
+ System.Int32
+
+
+ DateCreate
+ System.DateTime
+
+
+ ComputerName
+ System.String
+
+
+ Sum
+ System.Decimal
+
+
+ Status
+ ComputersShopDataModels.Status
+
+
+
+ ComputersShopContracts.ViewModels
+ ReportOrderViewModel
+ ComputersShopContracts.ViewModels.ReportOrderViewModel, ComputersShopContracts, 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
+
+
+
+
+ Заказы
+
+
+
+
+
+
+ 1cm
+ 21cm
+ 1
+
+
+ Middle
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+ 2.5cm
+
+
+ 3.21438cm
+
+
+ 8.23317cm
+
+
+ 2.5cm
+
+
+ 2.5cm
+
+
+
+
+ 0.6cm
+
+
+
+
+ true
+ true
+
+
+
+
+ Номер
+
+
+
+
+
+
+ Textbox5
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ Дата создания
+
+
+
+
+
+
+ Textbox1
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ Мороженое
+
+
+
+
+
+
+ Textbox3
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ Статус Заказа
+
+
+
+
+
+
+ Textbox2
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ Сумма
+
+
+
+
+
+
+ Textbox7
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ 0.6cm
+
+
+
+
+ true
+ true
+
+
+
+
+ =Fields!Id.Value
+
+
+
+
+
+
+ Id
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Fields!DateCreate.Value
+
+
+
+
+
+
+ DateCreate
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Fields!ComputerName.Value
+
+
+
+
+
+
+ ComputerName
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Fields!Status.Value
+
+
+
+
+
+
+ Status
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Fields!Sum.Value
+
+
+
+
+
+
+ Sum
+
+
+ 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
+
+
+
+ 5.72875cm
+
+
+ 21cm
+
+ 29.7cm
+ 21cm
+ 2cm
+ 2cm
+ 2cm
+ 2cm
+ 0.13cm
+
+
+
+
+
+
+ String
+ true
+ ReportParameter1
+
+
+
+
+ 5
+ 2
+
+
+ 0
+ 0
+ ReportParameterPeriod
+
+
+
+
Cm
- e77d9a2e-2123-4ba0-be40-b51f7c9b20c3
+ 1c0c12af-b9e8-41db-8d1f-26d1acbf91cc
\ No newline at end of file