diff --git a/ComputersShop/ComputersShop/ComputersShop.csproj b/ComputersShop/ComputersShop/ComputersShop.csproj index 1a00870..30d51d0 100644 --- a/ComputersShop/ComputersShop/ComputersShop.csproj +++ b/ComputersShop/ComputersShop/ComputersShop.csproj @@ -9,7 +9,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -20,6 +20,7 @@ + diff --git a/ComputersShop/ComputersShop/FormMain.Designer.cs b/ComputersShop/ComputersShop/FormMain.Designer.cs index b0fd856..4c9d187 100644 --- a/ComputersShop/ComputersShop/FormMain.Designer.cs +++ b/ComputersShop/ComputersShop/FormMain.Designer.cs @@ -32,6 +32,10 @@ справочникиToolStripMenuItem = new ToolStripMenuItem(); компонентыToolStripMenuItem = new ToolStripMenuItem(); компьютерыToolStripMenuItem = new ToolStripMenuItem(); + отчетыToolStripMenuItem = new ToolStripMenuItem(); + списокКомпонентовToolStripMenuItem = new ToolStripMenuItem(); + компонентыПоКомпьютерамToolStripMenuItem = new ToolStripMenuItem(); + списокЗаказовToolStripMenuItem = new ToolStripMenuItem(); dataGridView = new DataGridView(); buttonCreateOrder = new Button(); buttonTakeOrderInWork = new Button(); @@ -45,7 +49,7 @@ // menuStrip // menuStrip.ImageScalingSize = new Size(20, 20); - menuStrip.Items.AddRange(new ToolStripItem[] { справочникиToolStripMenuItem }); + menuStrip.Items.AddRange(new ToolStripItem[] { справочникиToolStripMenuItem, отчетыToolStripMenuItem }); menuStrip.Location = new Point(0, 0); menuStrip.Name = "menuStrip"; menuStrip.Size = new Size(1209, 28); @@ -62,17 +66,45 @@ // компонентыToolStripMenuItem // компонентыToolStripMenuItem.Name = "компонентыToolStripMenuItem"; - компонентыToolStripMenuItem.Size = new Size(224, 26); + компонентыToolStripMenuItem.Size = new Size(184, 26); компонентыToolStripMenuItem.Text = "Компоненты"; компонентыToolStripMenuItem.Click += ComponentsStripMenuItem_Click; // // компьютерыToolStripMenuItem // компьютерыToolStripMenuItem.Name = "компьютерыToolStripMenuItem"; - компьютерыToolStripMenuItem.Size = new Size(224, 26); + компьютерыToolStripMenuItem.Size = new Size(184, 26); компьютерыToolStripMenuItem.Text = "Компьютеры"; компьютерыToolStripMenuItem.Click += ComputersStripMenuItem_Click; // + // отчетыToolStripMenuItem + // + отчетыToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { списокКомпонентовToolStripMenuItem, компонентыПоКомпьютерамToolStripMenuItem, списокЗаказовToolStripMenuItem }); + отчетыToolStripMenuItem.Name = "отчетыToolStripMenuItem"; + отчетыToolStripMenuItem.Size = new Size(73, 24); + отчетыToolStripMenuItem.Text = "Отчеты"; + // + // списокКомпонентовToolStripMenuItem + // + списокКомпонентовToolStripMenuItem.Name = "списокКомпонентовToolStripMenuItem"; + списокКомпонентовToolStripMenuItem.Size = new Size(306, 26); + списокКомпонентовToolStripMenuItem.Text = "Список компонентов"; + списокКомпонентовToolStripMenuItem.Click += списокКомпонентовToolStripMenuItem_Click; + // + // компонентыПоКомпьютерамToolStripMenuItem + // + компонентыПоКомпьютерамToolStripMenuItem.Name = "компонентыПоКомпьютерамToolStripMenuItem"; + компонентыПоКомпьютерамToolStripMenuItem.Size = new Size(306, 26); + компонентыПоКомпьютерамToolStripMenuItem.Text = "Компоненты по компьютерам"; + компонентыПоКомпьютерамToolStripMenuItem.Click += компонентыПоКомпьютерамToolStripMenuItem_Click; + // + // списокЗаказовToolStripMenuItem + // + списокЗаказовToolStripMenuItem.Name = "списокЗаказовToolStripMenuItem"; + списокЗаказовToolStripMenuItem.Size = new Size(306, 26); + списокЗаказовToolStripMenuItem.Text = "Список заказов"; + списокЗаказовToolStripMenuItem.Click += списокЗаказовToolStripMenuItem_Click; + // // dataGridView // dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; @@ -168,5 +200,9 @@ private Button buttonOrderReady; private Button buttonIssuedOrder; private Button buttonRefresh; + private ToolStripMenuItem отчетыToolStripMenuItem; + private ToolStripMenuItem списокКомпонентовToolStripMenuItem; + private ToolStripMenuItem компонентыПоКомпьютерамToolStripMenuItem; + private ToolStripMenuItem списокЗаказовToolStripMenuItem; } } \ No newline at end of file diff --git a/ComputersShop/ComputersShop/FormMain.cs b/ComputersShop/ComputersShop/FormMain.cs index d55f106..72e4f3d 100644 --- a/ComputersShop/ComputersShop/FormMain.cs +++ b/ComputersShop/ComputersShop/FormMain.cs @@ -18,11 +18,14 @@ namespace ComputersShop { private readonly ILogger _logger; private readonly IOrderLogic _orderLogic; - public FormMain(ILogger logger, IOrderLogic orderLogic) + private readonly IReportLogic _reportLogic; + + public FormMain(ILogger logger, IOrderLogic orderLogic, IReportLogic reportLogic) { InitializeComponent(); _logger = logger; _orderLogic = orderLogic; + _reportLogic = reportLogic; } private void ComponentsStripMenuItem_Click(object sender, EventArgs e) @@ -79,6 +82,42 @@ namespace ComputersShop } } + private void списокКомпонентовToolStripMenuItem_Click(object sender, EventArgs e) + { + using var dialog = new SaveFileDialog { Filter = "docx|*.docx" }; + if (dialog.ShowDialog() == DialogResult.OK) + { + _reportLogic.SaveComponentsToWordFile(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(FormReportComputerComponents)); + if (service is FormReportComputerComponents form) + { + form.ShowDialog(); + } + + } + + private void списокЗаказовToolStripMenuItem_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormReportOrders)); + if (service is FormReportOrders form) + { + form.ShowDialog(); + } + + } + private OrderBindingModel CreateBindingModel(int id, bool isDone = false) { return new OrderBindingModel diff --git a/ComputersShop/ComputersShop/FormReportComputerComponents.Designer.cs b/ComputersShop/ComputersShop/FormReportComputerComponents.Designer.cs new file mode 100644 index 0000000..46134a4 --- /dev/null +++ b/ComputersShop/ComputersShop/FormReportComputerComponents.Designer.cs @@ -0,0 +1,106 @@ +namespace ComputersShop +{ + partial class FormReportComputerComponents + { + /// + /// 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() + { + dataGridView = new DataGridView(); + SaveButton = new Button(); + ComponentColumn = new DataGridViewTextBoxColumn(); + ComputerColumn = new DataGridViewTextBoxColumn(); + CountColumn = new DataGridViewTextBoxColumn(); + ((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit(); + SuspendLayout(); + // + // dataGridView + // + dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; + dataGridView.Columns.AddRange(new DataGridViewColumn[] { ComponentColumn, ComputerColumn, CountColumn }); + dataGridView.Location = new Point(14, 61); + dataGridView.Margin = new Padding(3, 4, 3, 4); + dataGridView.Name = "dataGridView"; + dataGridView.RowHeadersWidth = 51; + dataGridView.RowTemplate.Height = 25; + dataGridView.Size = new Size(651, 523); + dataGridView.TabIndex = 0; + // + // SaveButton + // + SaveButton.Location = new Point(14, 23); + SaveButton.Margin = new Padding(3, 4, 3, 4); + SaveButton.Name = "SaveButton"; + SaveButton.Size = new Size(193, 31); + SaveButton.TabIndex = 1; + SaveButton.Text = "Сохранить в Excel"; + SaveButton.UseVisualStyleBackColor = true; + SaveButton.Click += SaveButton_Click; + // + // ComponentColumn + // + ComponentColumn.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; + ComponentColumn.HeaderText = "Компонент"; + ComponentColumn.MinimumWidth = 6; + ComponentColumn.Name = "ComponentColumn"; + // + // ComputerColumn + // + ComputerColumn.HeaderText = "Компьютер"; + ComputerColumn.MinimumWidth = 6; + ComputerColumn.Name = "ComputerColumn"; + ComputerColumn.Width = 200; + // + // CountColumn + // + CountColumn.HeaderText = "Количество"; + CountColumn.MinimumWidth = 6; + CountColumn.Name = "CountColumn"; + CountColumn.Width = 130; + // + // FormReportComputerComponents + // + AutoScaleDimensions = new SizeF(8F, 20F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(679, 600); + Controls.Add(SaveButton); + Controls.Add(dataGridView); + Margin = new Padding(3, 4, 3, 4); + Name = "FormReportComputerComponents"; + Text = "Компоненты по компьютерам"; + Load += ReportComputerComponentForm_Load; + ((System.ComponentModel.ISupportInitialize)dataGridView).EndInit(); + ResumeLayout(false); + } + + #endregion + + private DataGridView dataGridView; + private Button SaveButton; + private DataGridViewTextBoxColumn ComponentColumn; + private DataGridViewTextBoxColumn ComputerColumn; + private DataGridViewTextBoxColumn CountColumn; + } +} \ No newline at end of file diff --git a/ComputersShop/ComputersShop/FormReportComputerComponents.cs b/ComputersShop/ComputersShop/FormReportComputerComponents.cs new file mode 100644 index 0000000..fc0465a --- /dev/null +++ b/ComputersShop/ComputersShop/FormReportComputerComponents.cs @@ -0,0 +1,91 @@ +using ComputersShopContracts.BindingModels; +using ComputersShopContracts.BisnessLogicsContracts; +using Microsoft.Extensions.Logging; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace ComputersShop +{ + public partial class FormReportComputerComponents : Form + { + private readonly ILogger _logger; + private readonly IReportLogic _logic; + + public FormReportComputerComponents(ILogger +logger, IReportLogic logic) + { + InitializeComponent(); + _logger = logger; + _logic = logic; + + } + + private void ReportComputerComponentForm_Load(object sender, EventArgs e) + { + try + { + var dict = _logic.GetComputerComponent(); + 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[] { "", 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); + } + + } + + private void SaveButton_Click(object sender, EventArgs e) + { + using var dialog = new SaveFileDialog + { + Filter = "xlsx|*.xlsx" + }; + if (dialog.ShowDialog() == DialogResult.OK) + { + try + { + _logic.SaveComputerComponentToExcelFile(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/ComputersShop/ComputersShop/FormReportComputerComponents.resx b/ComputersShop/ComputersShop/FormReportComputerComponents.resx new file mode 100644 index 0000000..af32865 --- /dev/null +++ b/ComputersShop/ComputersShop/FormReportComputerComponents.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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/ComputersShop/ComputersShop/FormReportOrders.Designer.cs b/ComputersShop/ComputersShop/FormReportOrders.Designer.cs new file mode 100644 index 0000000..9d86a2e --- /dev/null +++ b/ComputersShop/ComputersShop/FormReportOrders.Designer.cs @@ -0,0 +1,145 @@ +namespace ComputersShop +{ + partial class FormReportOrders + { + /// + /// 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() + { + panelTop = new Panel(); + ToPdfButton = new Button(); + MakeButton = new Button(); + labelUntill = new Label(); + labelFrom = new Label(); + dateTimePickerTo = new DateTimePicker(); + dateTimePickerFrom = new DateTimePicker(); + panelReport = new Panel(); + panelTop.SuspendLayout(); + SuspendLayout(); + // + // panelTop + // + panelTop.Controls.Add(ToPdfButton); + panelTop.Controls.Add(MakeButton); + panelTop.Controls.Add(labelUntill); + panelTop.Controls.Add(labelFrom); + panelTop.Controls.Add(dateTimePickerTo); + panelTop.Controls.Add(dateTimePickerFrom); + panelTop.Location = new Point(14, 16); + panelTop.Margin = new Padding(3, 4, 3, 4); + panelTop.Name = "panelTop"; + panelTop.Size = new Size(887, 57); + panelTop.TabIndex = 0; + // + // ToPdfButton + // + ToPdfButton.Location = new Point(712, 23); + ToPdfButton.Margin = new Padding(3, 4, 3, 4); + ToPdfButton.Name = "ToPdfButton"; + ToPdfButton.Size = new Size(171, 31); + ToPdfButton.TabIndex = 5; + ToPdfButton.Text = "В Pdf"; + ToPdfButton.UseVisualStyleBackColor = true; + ToPdfButton.Click += ButtonToPdf_Click; + // + // MakeButton + // + MakeButton.Location = new Point(537, 23); + MakeButton.Margin = new Padding(3, 4, 3, 4); + MakeButton.Name = "MakeButton"; + MakeButton.Size = new Size(168, 31); + MakeButton.TabIndex = 4; + MakeButton.Text = "Сформировать"; + MakeButton.UseVisualStyleBackColor = true; + MakeButton.Click += MakeButton_Click; + // + // labelUntill + // + labelUntill.AutoSize = true; + labelUntill.Location = new Point(269, 31); + labelUntill.Name = "labelUntill"; + labelUntill.Size = new Size(29, 20); + labelUntill.TabIndex = 3; + labelUntill.Text = "По"; + // + // labelFrom + // + labelFrom.AutoSize = true; + labelFrom.Location = new Point(9, 31); + labelFrom.Name = "labelFrom"; + labelFrom.Size = new Size(18, 20); + labelFrom.TabIndex = 2; + labelFrom.Text = "С"; + // + // dateTimePickerTo + // + dateTimePickerTo.Location = new Point(302, 23); + dateTimePickerTo.Margin = new Padding(3, 4, 3, 4); + dateTimePickerTo.Name = "dateTimePickerTo"; + dateTimePickerTo.Size = new Size(228, 27); + dateTimePickerTo.TabIndex = 1; + // + // dateTimePickerFrom + // + dateTimePickerFrom.Location = new Point(33, 23); + dateTimePickerFrom.Margin = new Padding(3, 4, 3, 4); + dateTimePickerFrom.Name = "dateTimePickerFrom"; + dateTimePickerFrom.Size = new Size(228, 27); + dateTimePickerFrom.TabIndex = 0; + // + // panelReport + // + panelReport.Location = new Point(14, 80); + panelReport.Name = "panelReport"; + panelReport.Size = new Size(888, 508); + panelReport.TabIndex = 1; + // + // FormReportOrders + // + AutoScaleDimensions = new SizeF(8F, 20F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(914, 600); + Controls.Add(panelReport); + Controls.Add(panelTop); + Margin = new Padding(3, 4, 3, 4); + Name = "FormReportOrders"; + Text = "Заказы"; + panelTop.ResumeLayout(false); + panelTop.PerformLayout(); + ResumeLayout(false); + } + + #endregion + + private Panel panelTop; + private Button ToPdfButton; + private Button MakeButton; + private Label labelUntill; + private Label labelFrom; + private DateTimePicker dateTimePickerTo; + private DateTimePicker dateTimePickerFrom; + private Panel panelReport; + } +} \ No newline at end of file diff --git a/ComputersShop/ComputersShop/FormReportOrders.cs b/ComputersShop/ComputersShop/FormReportOrders.cs new file mode 100644 index 0000000..f959a8e --- /dev/null +++ b/ComputersShop/ComputersShop/FormReportOrders.cs @@ -0,0 +1,104 @@ +using ComputersShopContracts.BindingModels; +using ComputersShopContracts.BisnessLogicsContracts; +using Microsoft.Extensions.Logging; +using Microsoft.Reporting.WinForms; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace ComputersShop +{ + public partial class FormReportOrders : Form + { + private readonly ReportViewer reportViewer; + private readonly ILogger _logger; + private readonly IReportLogic _logic; + public FormReportOrders(ILogger logger, IReportLogic logic) + { + InitializeComponent(); + _logger = logger; + _logic = logic; + reportViewer = new ReportViewer + { + Dock = DockStyle.Fill + }; + reportViewer.LocalReport.LoadReportDefinition(new FileStream("ReportOrders.rdlc", FileMode.Open)); + panelReport.Controls.Add(reportViewer); + } + + private void MakeButton_Click(object sender, EventArgs e) + { + if (dateTimePickerFrom.Value.Date >= dateTimePickerTo.Value.Date) + { + MessageBox.Show("Дата начала должна быть меньше даты окончания", + "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + try + { + var dataSource = _logic.GetOrders(new ReportBindingModel + { + DateFrom = dateTimePickerFrom.Value, + DateTo = dateTimePickerTo.Value + }); + var source = new ReportDataSource("DataSetOrders", dataSource); + reportViewer.LocalReport.DataSources.Clear(); + reportViewer.LocalReport.DataSources.Add(source); + var parameters = new[] { new ReportParameter("ReportParameterPeriod", $"c {dateTimePickerFrom.Value.ToShortDateString()} по {dateTimePickerTo.Value.ToShortDateString()}") }; + reportViewer.LocalReport.SetParameters(parameters); + reportViewer.RefreshReport(); + _logger.LogInformation("Загрузка списка заказов на период {From}-{ To}", dateTimePickerFrom.Value.ToShortDateString(), + dateTimePickerTo.Value.ToShortDateString()); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка загрузки списка заказов на период"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, + MessageBoxIcon.Error); + } + } + + private void ButtonToPdf_Click(object sender, EventArgs e) + { + if (dateTimePickerFrom.Value.Date >= dateTimePickerTo.Value.Date) + { + MessageBox.Show("Дата начала должна быть меньше даты окончания", + "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + using var dialog = new SaveFileDialog + { + Filter = "pdf|*.pdf" + }; + if (dialog.ShowDialog() == DialogResult.OK) + { + try + { + _logic.SaveOrdersToPdfFile(new ReportBindingModel + { + FileName = dialog.FileName, + DateFrom = dateTimePickerFrom.Value, + DateTo = dateTimePickerTo.Value + }); + _logger.LogInformation("Сохранение списка заказов на период { From}-{ To}", dateTimePickerFrom.Value.ToShortDateString(), + dateTimePickerTo.Value.ToShortDateString()); + MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, + MessageBoxIcon.Information); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка сохранения списка заказов на период"); + + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, + MessageBoxIcon.Error); + } + } + } + } +} diff --git a/ComputersShop/ComputersShop/FormReportOrders.resx b/ComputersShop/ComputersShop/FormReportOrders.resx new file mode 100644 index 0000000..af32865 --- /dev/null +++ b/ComputersShop/ComputersShop/FormReportOrders.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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/ComputersShop/ComputersShop/Program.cs b/ComputersShop/ComputersShop/Program.cs index 272046c..e59bd4f 100644 --- a/ComputersShop/ComputersShop/Program.cs +++ b/ComputersShop/ComputersShop/Program.cs @@ -7,6 +7,8 @@ using Microsoft.Extensions.Logging; using NLog.Extensions.Logging; using System.Drawing; using System; +using ComputersShopBusinessLogic.OfficePackage.Implements; +using ComputersShopBusinessLogic.OfficePackage; namespace ComputersShop { @@ -41,6 +43,7 @@ namespace ComputersShop services.AddTransient(); services.AddTransient(); services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); @@ -48,7 +51,11 @@ namespace ComputersShop services.AddTransient(); services.AddTransient(); services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); } - } } \ No newline at end of file diff --git a/ComputersShop/ComputersShop/ReportOrders.rdlc b/ComputersShop/ComputersShop/ReportOrders.rdlc new file mode 100644 index 0000000..9c0d949 --- /dev/null +++ b/ComputersShop/ComputersShop/ReportOrders.rdlc @@ -0,0 +1,599 @@ + + + 0 + + + + System.Data.DataSet + /* Local Connection */ + + 47cb53f0-7dde-4717-ba03-866a0bc4f4dd + + + + + + ComputerShopContractsViewModels + /* Local Query */ + + + + Id + System.Int32 + + + DateCreate + System.DateTime + + + ComputerName + System.String + + + Sum + System.Decimal + + + OrderStatus + ComputerShopDataModels.OrderStatus + + + + ComputerShopContracts.ViewModels + ReportOrderViewModel + ComputerShopContracts.ViewModels.ReportOrderViewModel, ComputerShopContracts, 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 + + + + + Номер + + + + + + 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!ComputerName.Value + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!OrderStatus.Value + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Sum.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 + + + + 5.72875cm +