diff --git a/SoftwareInstallation/SofrwareInstallationContracts/BusinessLogicsContracts/IReportLogic.cs b/SoftwareInstallation/SofrwareInstallationContracts/BusinessLogicsContracts/IReportLogic.cs index 758a9ff..4daa645 100644 --- a/SoftwareInstallation/SofrwareInstallationContracts/BusinessLogicsContracts/IReportLogic.cs +++ b/SoftwareInstallation/SofrwareInstallationContracts/BusinessLogicsContracts/IReportLogic.cs @@ -6,10 +6,14 @@ namespace SofrwareInstallationContracts.BusinessLogicsContracts public interface IReportLogic { List GetPackageComponent(); + List GetStorePackage(); List GetOrders(ReportBindingModel model); + List GetOrdersGroupByDate(); void SavePackagesToWordFile(ReportBindingModel model); + void SaveStoresToWordFile(ReportBindingModel model); void SavePackageComponentToExcelFile(ReportBindingModel model); + void SaveStorePackageToExcelFile(ReportBindingModel model); void SaveOrdersToPdfFile(ReportBindingModel model); - + void SaveOrdersGroupByDateToPdfFile(ReportBindingModel model); } } diff --git a/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/ReportOrdersGroupByDateViewModel.cs b/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/ReportOrdersGroupByDateViewModel.cs new file mode 100644 index 0000000..c7b1b73 --- /dev/null +++ b/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/ReportOrdersGroupByDateViewModel.cs @@ -0,0 +1,9 @@ +namespace SofrwareInstallationContracts.ViewModels +{ + public class ReportOrdersGroupByDateViewModel + { + public DateTime DateCreate { get; set; } + public int Count { get; set; } + public double Sum { get; set; } + } +} diff --git a/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/ReportStorePackageViewModel.cs b/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/ReportStorePackageViewModel.cs new file mode 100644 index 0000000..5deb5b3 --- /dev/null +++ b/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/ReportStorePackageViewModel.cs @@ -0,0 +1,11 @@ +namespace SofrwareInstallationContracts.ViewModels +{ + public class ReportStorePackageViewModel + { + public string StoreName { get; set; } = string.Empty; + + public int TotalCount { get; set; } + + public List<(string Package, int Count)> Packages { get; set; } = new(); + } +} diff --git a/SoftwareInstallation/SoftwareInstallation/FormMain.Designer.cs b/SoftwareInstallation/SoftwareInstallation/FormMain.Designer.cs index e1fe008..11252da 100644 --- a/SoftwareInstallation/SoftwareInstallation/FormMain.Designer.cs +++ b/SoftwareInstallation/SoftwareInstallation/FormMain.Designer.cs @@ -32,11 +32,11 @@ this.СправочникиToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ИзделияToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.КомпонентыToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.StoreToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.отчетыToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.списокИзделийToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.компонентыПоИзделиямToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.списокЗаказовToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.StoreToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.DataGridView = new System.Windows.Forms.DataGridView(); this.CreateOrderButton = new System.Windows.Forms.Button(); this.TakeOrderInWorkButton = new System.Windows.Forms.Button(); @@ -45,6 +45,9 @@ this.UpdateListButton = new System.Windows.Forms.Button(); this.StoreReplenishment = new System.Windows.Forms.Button(); this.SellPackageButton = new System.Windows.Forms.Button(); + this.списокМагазиновToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.изделияПоМагазинамToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.списокЗаказовгруппировкаПоДатеToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.MenuStrip.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.DataGridView)).BeginInit(); this.SuspendLayout(); @@ -73,21 +76,21 @@ // ИзделияToolStripMenuItem // this.ИзделияToolStripMenuItem.Name = "ИзделияToolStripMenuItem"; - this.ИзделияToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.ИзделияToolStripMenuItem.Size = new System.Drawing.Size(145, 22); this.ИзделияToolStripMenuItem.Text = "Изделия"; this.ИзделияToolStripMenuItem.Click += new System.EventHandler(this.ИзделияToolStripMenuItem_Click); // // КомпонентыToolStripMenuItem // this.КомпонентыToolStripMenuItem.Name = "КомпонентыToolStripMenuItem"; - this.КомпонентыToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.КомпонентыToolStripMenuItem.Size = new System.Drawing.Size(145, 22); this.КомпонентыToolStripMenuItem.Text = "Компоненты"; this.КомпонентыToolStripMenuItem.Click += new System.EventHandler(this.КомпонентыToolStripMenuItem_Click); // // StoreToolStripMenuItem // this.StoreToolStripMenuItem.Name = "StoreToolStripMenuItem"; - this.StoreToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.StoreToolStripMenuItem.Size = new System.Drawing.Size(145, 22); this.StoreToolStripMenuItem.Text = "Магазины"; this.StoreToolStripMenuItem.Click += new System.EventHandler(this.StoreToolStripMenuItem_Click); // @@ -96,7 +99,10 @@ this.отчетыToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.списокИзделийToolStripMenuItem, this.компонентыПоИзделиямToolStripMenuItem, - this.списокЗаказовToolStripMenuItem}); + this.списокЗаказовToolStripMenuItem, + this.списокМагазиновToolStripMenuItem, + this.изделияПоМагазинамToolStripMenuItem, + this.списокЗаказовгруппировкаПоДатеToolStripMenuItem}); this.отчетыToolStripMenuItem.Name = "отчетыToolStripMenuItem"; this.отчетыToolStripMenuItem.Size = new System.Drawing.Size(60, 20); this.отчетыToolStripMenuItem.Text = "Отчеты"; @@ -104,21 +110,21 @@ // списокИзделийToolStripMenuItem // this.списокИзделийToolStripMenuItem.Name = "списокИзделийToolStripMenuItem"; - this.списокИзделийToolStripMenuItem.Size = new System.Drawing.Size(220, 22); + this.списокИзделийToolStripMenuItem.Size = new System.Drawing.Size(286, 22); this.списокИзделийToolStripMenuItem.Text = "Список Изделий"; this.списокИзделийToolStripMenuItem.Click += new System.EventHandler(this.списокИзделийToolStripMenuItem_Click); // // компонентыПоИзделиямToolStripMenuItem // this.компонентыПоИзделиямToolStripMenuItem.Name = "компонентыПоИзделиямToolStripMenuItem"; - this.компонентыПоИзделиямToolStripMenuItem.Size = new System.Drawing.Size(220, 22); + this.компонентыПоИзделиямToolStripMenuItem.Size = new System.Drawing.Size(286, 22); this.компонентыПоИзделиямToolStripMenuItem.Text = "Компоненты по Изделиям"; this.компонентыПоИзделиямToolStripMenuItem.Click += new System.EventHandler(this.компонентыПоИзделиямToolStripMenuItem_Click); // // списокЗаказовToolStripMenuItem // this.списокЗаказовToolStripMenuItem.Name = "списокЗаказовToolStripMenuItem"; - this.списокЗаказовToolStripMenuItem.Size = new System.Drawing.Size(220, 22); + this.списокЗаказовToolStripMenuItem.Size = new System.Drawing.Size(286, 22); this.списокЗаказовToolStripMenuItem.Text = "Список Заказов"; this.списокЗаказовToolStripMenuItem.Click += new System.EventHandler(this.списокЗаказовToolStripMenuItem_Click); // @@ -201,6 +207,27 @@ this.SellPackageButton.UseVisualStyleBackColor = true; this.SellPackageButton.Click += new System.EventHandler(this.SellPackageButton_Click); // + // списокМагазиновToolStripMenuItem + // + this.списокМагазиновToolStripMenuItem.Name = "списокМагазиновToolStripMenuItem"; + this.списокМагазиновToolStripMenuItem.Size = new System.Drawing.Size(286, 22); + this.списокМагазиновToolStripMenuItem.Text = "Список Магазинов"; + this.списокМагазиновToolStripMenuItem.Click += new System.EventHandler(this.списокМагазиновToolStripMenuItem_Click); + // + // изделияПоМагазинамToolStripMenuItem + // + this.изделияПоМагазинамToolStripMenuItem.Name = "изделияПоМагазинамToolStripMenuItem"; + this.изделияПоМагазинамToolStripMenuItem.Size = new System.Drawing.Size(286, 22); + this.изделияПоМагазинамToolStripMenuItem.Text = "Изделия по магазинам"; + this.изделияПоМагазинамToolStripMenuItem.Click += new System.EventHandler(this.изделияПоМагазинамToolStripMenuItem_Click); + // + // списокЗаказовгруппировкаПоДатеToolStripMenuItem + // + this.списокЗаказовгруппировкаПоДатеToolStripMenuItem.Name = "списокЗаказовгруппировкаПоДатеToolStripMenuItem"; + this.списокЗаказовгруппировкаПоДатеToolStripMenuItem.Size = new System.Drawing.Size(286, 22); + this.списокЗаказовгруппировкаПоДатеToolStripMenuItem.Text = "Список Заказов (группировка по дате)"; + this.списокЗаказовгруппировкаПоДатеToolStripMenuItem.Click += new System.EventHandler(this.списокЗаказовгруппировкаПоДатеToolStripMenuItem_Click); + // // FormMain // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); @@ -245,5 +272,8 @@ private ToolStripMenuItem списокИзделийToolStripMenuItem; private ToolStripMenuItem компонентыПоИзделиямToolStripMenuItem; private ToolStripMenuItem списокЗаказовToolStripMenuItem; + private ToolStripMenuItem списокМагазиновToolStripMenuItem; + private ToolStripMenuItem изделияПоМагазинамToolStripMenuItem; + private ToolStripMenuItem списокЗаказовгруппировкаПоДатеToolStripMenuItem; } } \ No newline at end of file diff --git a/SoftwareInstallation/SoftwareInstallation/FormMain.cs b/SoftwareInstallation/SoftwareInstallation/FormMain.cs index 4bf2f55..fd51910 100644 --- a/SoftwareInstallation/SoftwareInstallation/FormMain.cs +++ b/SoftwareInstallation/SoftwareInstallation/FormMain.cs @@ -254,5 +254,33 @@ namespace SoftwareInstallationView form.ShowDialog(); } } + + private void списокМагазиновToolStripMenuItem_Click(object sender, EventArgs e) + { + using var dialog = new SaveFileDialog { Filter = "docx|*.docx" }; + if (dialog.ShowDialog() == DialogResult.OK) + { + _reportLogic.SaveStoresToWordFile(new ReportBindingModel { FileName = dialog.FileName }); + MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + } + + private void изделияПоМагазинамToolStripMenuItem_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormReportStorePackages)); + if (service is FormReportStorePackages form) + { + form.ShowDialog(); + } + } + + private void списокЗаказовгруппировкаПоДатеToolStripMenuItem_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormReportOrdersGroupByDate)); + if (service is FormReportOrdersGroupByDate form) + { + form.ShowDialog(); + } + } } } diff --git a/SoftwareInstallation/SoftwareInstallation/FormReportOrdersGroupByDate.Designer.cs b/SoftwareInstallation/SoftwareInstallation/FormReportOrdersGroupByDate.Designer.cs new file mode 100644 index 0000000..35164f5 --- /dev/null +++ b/SoftwareInstallation/SoftwareInstallation/FormReportOrdersGroupByDate.Designer.cs @@ -0,0 +1,86 @@ +namespace SoftwareInstallationView +{ + partial class FormReportOrdersGroupByDate + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.Panel = new System.Windows.Forms.Panel(); + this.ToPdfButton = new System.Windows.Forms.Button(); + this.MakeButton = new System.Windows.Forms.Button(); + this.Panel.SuspendLayout(); + this.SuspendLayout(); + // + // Panel + // + this.Panel.Controls.Add(this.ToPdfButton); + this.Panel.Controls.Add(this.MakeButton); + 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(800, 38); + this.Panel.TabIndex = 0; + // + // ToPdfButton + // + this.ToPdfButton.Location = new System.Drawing.Point(142, 3); + this.ToPdfButton.Name = "ToPdfButton"; + this.ToPdfButton.Size = new System.Drawing.Size(113, 32); + this.ToPdfButton.TabIndex = 1; + this.ToPdfButton.Text = "В Pdf"; + this.ToPdfButton.UseVisualStyleBackColor = true; + this.ToPdfButton.Click += new System.EventHandler(this.ToPdfButton_Click); + // + // MakeButton + // + this.MakeButton.Location = new System.Drawing.Point(23, 3); + this.MakeButton.Name = "MakeButton"; + this.MakeButton.Size = new System.Drawing.Size(113, 32); + this.MakeButton.TabIndex = 2; + this.MakeButton.Text = "Сформировать"; + this.MakeButton.UseVisualStyleBackColor = true; + this.MakeButton.Click += new System.EventHandler(this.MakeButton_Click); + // + // FormReportOrdersGroupByDate + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(800, 450); + this.Controls.Add(this.Panel); + this.Name = "FormReportOrdersGroupByDate"; + this.Text = "Заказы (группировка по дате)"; + this.Panel.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private Panel Panel; + private Button ToPdfButton; + private Button MakeButton; + } +} \ No newline at end of file diff --git a/SoftwareInstallation/SoftwareInstallation/FormReportOrdersGroupByDate.cs b/SoftwareInstallation/SoftwareInstallation/FormReportOrdersGroupByDate.cs new file mode 100644 index 0000000..7f8ae4b --- /dev/null +++ b/SoftwareInstallation/SoftwareInstallation/FormReportOrdersGroupByDate.cs @@ -0,0 +1,72 @@ +using Microsoft.Reporting.WinForms; +using SofrwareInstallationContracts.BusinessLogicsContracts; +using Microsoft.Extensions.Logging; +using SofrwareInstallationContracts.BindingModels; + +namespace SoftwareInstallationView +{ + public partial class FormReportOrdersGroupByDate : Form + { + private readonly ReportViewer reportViewer; + private readonly ILogger _logger; + private readonly IReportLogic _logic; + + public FormReportOrdersGroupByDate(ILogger logger, IReportLogic logic) + { + InitializeComponent(); + _logger = logger; + _logic = logic; + reportViewer = new ReportViewer + { + Dock = DockStyle.Fill + }; + reportViewer.LocalReport.LoadReportDefinition(new FileStream("ReportOrdersGroupByDate.rdlc", FileMode.Open)); + Controls.Clear(); + Controls.Add(reportViewer); + Controls.Add(Panel); + } + + private void MakeButton_Click(object sender, EventArgs e) + { + try + { + var dataSource = _logic.GetOrdersGroupByDate(); + + var source = new ReportDataSource("DataSetOrders", dataSource); + + reportViewer.LocalReport.DataSources.Clear(); + reportViewer.LocalReport.DataSources.Add(source); + + reportViewer.RefreshReport(); + _logger.LogInformation("Загрузка списка заказов (группировка по дате)"); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка загрузки списка заказов (группировка по дате)"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void ToPdfButton_Click(object sender, EventArgs e) + { + using var dialog = new SaveFileDialog { Filter = "pdf|*.pdf" }; + if (dialog.ShowDialog() == DialogResult.OK) + { + try + { + _logic.SaveOrdersGroupByDateToPdfFile(new ReportBindingModel + { + FileName = dialog.FileName + }); + _logger.LogInformation("Сохранение списка заказов"); + MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка сохранения списка заказов"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } + } +} diff --git a/SoftwareInstallation/SoftwareInstallation/FormReportOrdersGroupByDate.resx b/SoftwareInstallation/SoftwareInstallation/FormReportOrdersGroupByDate.resx new file mode 100644 index 0000000..f298a7b --- /dev/null +++ b/SoftwareInstallation/SoftwareInstallation/FormReportOrdersGroupByDate.resx @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/SoftwareInstallation/SoftwareInstallation/FormReportStorePackages.Designer.cs b/SoftwareInstallation/SoftwareInstallation/FormReportStorePackages.Designer.cs new file mode 100644 index 0000000..e096ad3 --- /dev/null +++ b/SoftwareInstallation/SoftwareInstallation/FormReportStorePackages.Designer.cs @@ -0,0 +1,100 @@ +namespace SoftwareInstallationView +{ + partial class FormReportStorePackages + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.DataGridView = new System.Windows.Forms.DataGridView(); + this.SaveToExcelButton = new System.Windows.Forms.Button(); + this.StoreName = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.PackageName = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.CountPackage = new System.Windows.Forms.DataGridViewTextBoxColumn(); + ((System.ComponentModel.ISupportInitialize)(this.DataGridView)).BeginInit(); + this.SuspendLayout(); + // + // DataGridView + // + this.DataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.DataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.StoreName, + this.PackageName, + this.CountPackage}); + this.DataGridView.Location = new System.Drawing.Point(2, 55); + this.DataGridView.Name = "DataGridView"; + this.DataGridView.RowTemplate.Height = 25; + this.DataGridView.Size = new System.Drawing.Size(795, 383); + this.DataGridView.TabIndex = 0; + // + // SaveToExcelButton + // + this.SaveToExcelButton.Location = new System.Drawing.Point(26, 12); + this.SaveToExcelButton.Name = "SaveToExcelButton"; + this.SaveToExcelButton.Size = new System.Drawing.Size(113, 37); + this.SaveToExcelButton.TabIndex = 1; + this.SaveToExcelButton.Text = "Сохранить в Excel"; + this.SaveToExcelButton.UseVisualStyleBackColor = true; + this.SaveToExcelButton.Click += new System.EventHandler(this.SaveToExcelButton_Click); + // + // StoreName + // + this.StoreName.HeaderText = "Название магазина"; + this.StoreName.Name = "StoreName"; + // + // PackageName + // + this.PackageName.HeaderText = "Название изделия"; + this.PackageName.Name = "PackageName"; + // + // CountPackage + // + this.CountPackage.HeaderText = "Количество"; + this.CountPackage.Name = "CountPackage"; + // + // FormReportStorePackages + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(800, 450); + this.Controls.Add(this.SaveToExcelButton); + this.Controls.Add(this.DataGridView); + this.Name = "FormReportStorePackages"; + this.Text = "Изделия по магазинам"; + this.Load += new System.EventHandler(this.FormReportStorePackages_Load); + ((System.ComponentModel.ISupportInitialize)(this.DataGridView)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private DataGridView DataGridView; + private Button SaveToExcelButton; + private DataGridViewTextBoxColumn StoreName; + private DataGridViewTextBoxColumn PackageName; + private DataGridViewTextBoxColumn CountPackage; + } +} \ No newline at end of file diff --git a/SoftwareInstallation/SoftwareInstallation/FormReportStorePackages.cs b/SoftwareInstallation/SoftwareInstallation/FormReportStorePackages.cs new file mode 100644 index 0000000..d5f256c --- /dev/null +++ b/SoftwareInstallation/SoftwareInstallation/FormReportStorePackages.cs @@ -0,0 +1,69 @@ +using SofrwareInstallationContracts.BusinessLogicsContracts; +using Microsoft.Extensions.Logging; +using SofrwareInstallationContracts.BindingModels; +using System.Windows.Forms; + +namespace SoftwareInstallationView +{ + public partial class FormReportStorePackages : Form + { + private readonly ILogger _logger; + private readonly IReportLogic _logic; + public FormReportStorePackages(ILogger logger, IReportLogic logic) + { + InitializeComponent(); + _logger = logger; + _logic = logic; + } + + private void SaveToExcelButton_Click(object sender, EventArgs e) + { + using var dialog = new SaveFileDialog { Filter = "xlsx|*.xlsx" }; + if (dialog.ShowDialog() == DialogResult.OK) + { + try + { + _logic.SaveStorePackageToExcelFile(new ReportBindingModel + { + FileName = dialog.FileName + }); + _logger.LogInformation("Сохранение списка магазинов с изделиями"); + MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка сохранения списка магазинов с изделиями"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } + + private void FormReportStorePackages_Load(object sender, EventArgs e) + { + try + { + var dict = _logic.GetStorePackage(); + if (dict != null) + { + DataGridView.Rows.Clear(); + foreach (var elem in dict) + { + DataGridView.Rows.Add(new object[] { elem.StoreName, "", "" }); + foreach (var listElem in elem.Packages) + { + DataGridView.Rows.Add(new object[] { "", listElem.Item1, listElem.Item2 }); + } + DataGridView.Rows.Add(new object[] { "Итого", "", elem.TotalCount }); + DataGridView.Rows.Add(Array.Empty()); + } + } + _logger.LogInformation("Загрузка списка магазинов с изделиями"); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка загрузки списка магазинов с изделиями"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } +} diff --git a/SoftwareInstallation/SoftwareInstallation/FormReportStorePackages.resx b/SoftwareInstallation/SoftwareInstallation/FormReportStorePackages.resx new file mode 100644 index 0000000..90a135a --- /dev/null +++ b/SoftwareInstallation/SoftwareInstallation/FormReportStorePackages.resx @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + + True + + + True + + + True + + + True + + + True + + \ No newline at end of file diff --git a/SoftwareInstallation/SoftwareInstallation/Program.cs b/SoftwareInstallation/SoftwareInstallation/Program.cs index 8355f17..9fd11d9 100644 --- a/SoftwareInstallation/SoftwareInstallation/Program.cs +++ b/SoftwareInstallation/SoftwareInstallation/Program.cs @@ -36,14 +36,17 @@ namespace SoftwareInstallationView services.AddTransient(); services.AddTransient(); services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); + services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); - services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); @@ -52,7 +55,9 @@ namespace SoftwareInstallationView services.AddTransient(); services.AddTransient(); services.AddTransient(); + services.AddTransient(); services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); diff --git a/SoftwareInstallation/SoftwareInstallation/ReportOrdersGroupByDate.rdlc b/SoftwareInstallation/SoftwareInstallation/ReportOrdersGroupByDate.rdlc new file mode 100644 index 0000000..9f481f9 --- /dev/null +++ b/SoftwareInstallation/SoftwareInstallation/ReportOrdersGroupByDate.rdlc @@ -0,0 +1,394 @@ + + + 0 + + + + System.Data.DataSet + /* Local Connection */ + + 10791c83-cee8-4a38-bbd0-245fc17cefb3 + + + + + + SofrwareInstallationContractsViewModels + /* Local Query */ + + + + DateCreate + System.DateTime + + + Sum + System.Decimal + + + Count + System.Int32 + + + + SofrwareInstallationContracts.ViewModels + ReportOrdersViewModel + SofrwareInstallationContracts.ViewModels.ReportOrdersViewModel, SofrwareInstallationContracts, 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 + + + + + + + 6.60986cm + + + 6.60986cm + + + 6.60986cm + + + + + 0.61323cm + + + + + true + true + + + + + Дата заказов + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Количество заказов + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Сумма + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.61323cm + + + + + true + true + + + + + =Fields!DateCreate.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + true + + + + + + true + true + + + + + =Fields!Count.Value + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Sum.Value + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + After + + + + + + + DataSetOrders + 2.48391cm + 0.55245cm + 1.22646cm + 19.82958cm + 2 + + + + + + 5.72875cm +