diff --git a/ComputersShop/ComputersShopBusinessLogic/BusinessLogics/ReportLogic.cs b/ComputersShop/ComputersShopBusinessLogic/BusinessLogics/ReportLogic.cs index f568aa8..a7b69d5 100644 --- a/ComputersShop/ComputersShopBusinessLogic/BusinessLogics/ReportLogic.cs +++ b/ComputersShop/ComputersShopBusinessLogic/BusinessLogics/ReportLogic.cs @@ -135,7 +135,7 @@ namespace ComputersShopBusinessLogic.BusinessLogics return list; } - public void SaveShopDocumentToExcelFile(ReportBindingModel model) + public void SaveShopComputerToExcelFile(ReportBindingModel model) { _saveToExcel.CreateShopReport(new ExcelInfo { @@ -178,4 +178,4 @@ namespace ComputersShopBusinessLogic.BusinessLogics } } } -} + diff --git a/ComputersShop/ComputersShopContracts/BusinessLogicContracts/IReportLogic.cs b/ComputersShop/ComputersShopContracts/BusinessLogicContracts/IReportLogic.cs index 0507ab9..0036cdd 100644 --- a/ComputersShop/ComputersShopContracts/BusinessLogicContracts/IReportLogic.cs +++ b/ComputersShop/ComputersShopContracts/BusinessLogicContracts/IReportLogic.cs @@ -19,5 +19,11 @@ namespace ComputersShopContracts.BusinessLogicContracts void SaveComputerComponentToExcelFile(ReportBindingModel model); void SaveOrdersToPdfFile(ReportBindingModel model); - } + + List GetShopComputers(); + List GetGroupedByDateOrders(); + void SaveShopsToWordFile(ReportBindingModel model); + void SaveShopComputerToExcelFile(ReportBindingModel model); + void SaveGroupedByDateOrders(ReportBindingModel model); + } } diff --git a/ComputersShop/ComputersShopView/FormMain.Designer.cs b/ComputersShop/ComputersShopView/FormMain.Designer.cs index d1107e0..85bad3a 100644 --- a/ComputersShop/ComputersShopView/FormMain.Designer.cs +++ b/ComputersShop/ComputersShopView/FormMain.Designer.cs @@ -198,5 +198,9 @@ private Button buttonRef; private ToolStripMenuItem computerToolStripMenuItem; private ToolStripMenuItem componentsToolStripMenuItem; - } + private ToolStripMenuItem отчётыToolStripMenuItem; + private ToolStripMenuItem списокКомпонентовToolStripMenuItem; + private ToolStripMenuItem компонентыПоКомпьютерамToolStripMenuItem; + private ToolStripMenuItem списокЗаказовToolStripMenuItem; + } } \ No newline at end of file diff --git a/ComputersShop/ComputersShopView/FormMain.cs b/ComputersShop/ComputersShopView/FormMain.cs index 1406acc..64b7524 100644 --- a/ComputersShop/ComputersShopView/FormMain.cs +++ b/ComputersShop/ComputersShopView/FormMain.cs @@ -172,5 +172,33 @@ namespace ComputersShopView { LoadData(); } - } + + private void ComponentsDocxToolStripMenuItem_Click(object sender, EventArgs e) + { + using var dialog = new SaveFileDialog { Filter = "docx|*.docx" }; + if (dialog.ShowDialog() == DialogResult.OK) + { + _reportLogic.SaveComputersToWordFile(new ReportBindingModel { FileName = dialog.FileName }); + MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + } + + private void ComputerComponentsToolStripMenuItem_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormReportComputerComponents)); + if (service is FormReportComputerComponents form) + { + form.ShowDialog(); + } + } + + private void OrdersToolStripMenuItem_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormReportOrders)); + if (service is FormReportOrders form) + { + form.ShowDialog(); + } + } + } }