diff --git a/ConstructionCompany/ConstructionCompanyBusiness/BusinessLogics/PositionLogic.cs b/ConstructionCompany/ConstructionCompanyBusiness/BusinessLogics/PositionLogic.cs index ec60b8e..4abe29b 100644 --- a/ConstructionCompany/ConstructionCompanyBusiness/BusinessLogics/PositionLogic.cs +++ b/ConstructionCompany/ConstructionCompanyBusiness/BusinessLogics/PositionLogic.cs @@ -106,5 +106,11 @@ namespace ConstructionCompanyBusinessLogic.BusinessLogics } _logger.LogInformation("Position. IngredietnName:{PositionName}. Salary:{Salary}. Id:{Id}", model.PositionName, model.Salary, model.Id); } + + public List ReadPositionsAverage(DateTime dateFrom, DateTime dateTo) + { + var list = _positionStorage.GetPositionsAverage(dateFrom, dateTo); + return list; + } } } diff --git a/ConstructionCompany/ConstructionCompanyBusiness/BusinessLogics/RandomGeneratorLogic.cs b/ConstructionCompany/ConstructionCompanyBusiness/BusinessLogics/RandomGeneratorLogic.cs index 638f985..9f496aa 100644 --- a/ConstructionCompany/ConstructionCompanyBusiness/BusinessLogics/RandomGeneratorLogic.cs +++ b/ConstructionCompany/ConstructionCompanyBusiness/BusinessLogics/RandomGeneratorLogic.cs @@ -1,4 +1,5 @@ using ConstructionCompanyContracts.BindingModels; +using ConstructionCompanyContracts.SearchModels; using ConstructionCompanyContracts.BusinessLogicContracts; using ConstructionCompanyDataModels.Enums; using System; @@ -30,57 +31,74 @@ namespace ConstructionCompanyBusinessLogic.BusinessLogics public void GenerateEmployees() { - for (int i = 0; i < 400; i++) + int posInd = 1; + for (int i = 0; i < 200; i++) { - _employee.Create(new EmployeeBindingModel { EmployeeName = "testEmp", PositionID = 1 }); + _employee.Create(new EmployeeBindingModel { EmployeeName = "testEmp" + (i + 1), PositionID = posInd }); + posInd++; + if (posInd == 11) posInd = 1; } } public void GenerateEmployeesOrders() { - for (int i = 0; i < 2000; i++) + for (int i = 1; i <= 200; i++) { - Random rand = new Random(); - int emp = rand.Next(1, 600); - int ord = rand.Next(1, 2000); - if (_employeeOrder.ReadList(null)?.FirstOrDefault(x => x.OrderId == ord && x.EmployeeId == emp) != null) continue; - _employeeOrder.Create(new EmployeeOrderBindingModel { EmployeeId = emp, OrderId = ord}); + _employeeOrder.Create(new EmployeeOrderBindingModel { EmployeeId = i, OrderId = i}); } } public void GenerateMaterialOrders() { - for (int i = 0; i < 50; i++) + int quantity = 1; + for (int i = 1; i <= 200; i++) + { + _materialOrder.Create(new MaterialOrderBindingModel { MaterialId = i, OrderId = i, Quantity = quantity}); + quantity++; + if (quantity == 7) quantity = 1; + } + } + + public void GenerateAdditionalMaterialOrders() + { + Random rand = new Random(); + int quantity = 1; + for (int i = 1; i <= 100; i++) { - Random rand = new Random(); int mat = rand.Next(1, 10); - int ord = rand.Next(1, 200); - if (_materialOrder.ReadList(null)?.FirstOrDefault(x => x.OrderId == ord && x.MaterialId == mat) != null) continue; - _materialOrder.Create(new MaterialOrderBindingModel { MaterialId = mat, OrderId = ord, Quantity = 1}); + int ord = rand.Next(1, 100); + if (_materialOrder.ReadElement(new MaterialOrderSearchModel { MaterialId = mat, OrderId = ord}) != null) + { + i--; + continue; + } + _materialOrder.Create(new MaterialOrderBindingModel { MaterialId = mat, OrderId = ord, Quantity = quantity }); + quantity++; + if (quantity == 7) quantity = 1; } } public void GenerateMaterials() { - for (int i = 0; i < 1000; i++) + for (int i = 0; i < 200; i++) { - _material.Create(new MaterialBindingModel { MaterialName = "testMat", Quantity = 2000 }); + _material.Create(new MaterialBindingModel { MaterialName = "testMat" + (i + 1), Quantity = 2000 }); } } public void GenerateOrders() { - for (int i = 0; i < 2000; i++) + for (int i = 0; i < 1000; i++) { - _order.CreateOrder(new OrderBindingModel { Description = "snfjknfjksfns", Adress = "dsdsdssd", Price=20000, Status=OrderStatus.Неизвестен, CustomerNumber="+7838347475"}); + _order.CreateOrder(new OrderBindingModel { Description = "order" + (i + 1), Adress = "dsdsdssd", Price=20000, Status=OrderStatus.Неизвестен, CustomerNumber="+7838347475"}); } } public void GeneratePositions() { - for (int i = 0; i < 15; i++) + for (int i = 0; i < 20; i++) { - _position.Create(new PositionBindingModel { PositionName = "testPos", Salary = 20000 }); + _position.Create(new PositionBindingModel { PositionName = "testPos" + (i + 1), Salary = 20000 }); } } } diff --git a/ConstructionCompany/ConstructionCompanyContracts/BusinessLogicContracts/IPositionLogic.cs b/ConstructionCompany/ConstructionCompanyContracts/BusinessLogicContracts/IPositionLogic.cs index 771bfe2..feff743 100644 --- a/ConstructionCompany/ConstructionCompanyContracts/BusinessLogicContracts/IPositionLogic.cs +++ b/ConstructionCompany/ConstructionCompanyContracts/BusinessLogicContracts/IPositionLogic.cs @@ -13,6 +13,7 @@ namespace ConstructionCompanyContracts.BusinessLogicContracts { List? ReadList(PositionSearchModel? model); PositionViewModel? ReadElement(PositionSearchModel model); + List? ReadPositionsAverage(DateTime dateFrom, DateTime dateTo); bool Create(PositionBindingModel model); bool Update(PositionBindingModel model); bool Delete(PositionBindingModel model); diff --git a/ConstructionCompany/ConstructionCompanyContracts/BusinessLogicContracts/IRandomGeneratorLogic.cs b/ConstructionCompany/ConstructionCompanyContracts/BusinessLogicContracts/IRandomGeneratorLogic.cs index 0c75c1b..6ff7245 100644 --- a/ConstructionCompany/ConstructionCompanyContracts/BusinessLogicContracts/IRandomGeneratorLogic.cs +++ b/ConstructionCompany/ConstructionCompanyContracts/BusinessLogicContracts/IRandomGeneratorLogic.cs @@ -14,5 +14,7 @@ namespace ConstructionCompanyContracts.BusinessLogicContracts public void GenerateEmployees(); public void GenerateEmployeesOrders(); public void GenerateMaterialOrders(); + + public void GenerateAdditionalMaterialOrders(); } } diff --git a/ConstructionCompany/ConstructionCompanyContracts/StorageContracts/IPositionStorage.cs b/ConstructionCompany/ConstructionCompanyContracts/StorageContracts/IPositionStorage.cs index b6ba2d1..4c518f8 100644 --- a/ConstructionCompany/ConstructionCompanyContracts/StorageContracts/IPositionStorage.cs +++ b/ConstructionCompany/ConstructionCompanyContracts/StorageContracts/IPositionStorage.cs @@ -13,6 +13,7 @@ namespace ConstructionCompanyContracts.StorageContracts { List GetFullList(); List GetFilteredList(PositionSearchModel model); + List GetPositionsAverage(DateTime dateFrom, DateTime dateTo); PositionViewModel? GetElement(PositionSearchModel model); PositionViewModel? Insert(PositionBindingModel model); PositionViewModel? Update(PositionBindingModel model); diff --git a/ConstructionCompany/ConstructionCompanyContracts/ViewModels/BrigadeReportViewModel.cs b/ConstructionCompany/ConstructionCompanyContracts/ViewModels/BrigadeReportViewModel.cs new file mode 100644 index 0000000..025cb48 --- /dev/null +++ b/ConstructionCompany/ConstructionCompanyContracts/ViewModels/BrigadeReportViewModel.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConstructionCompanyContracts.ViewModels +{ + public class BrigadeReportViewModel + { + public int PositionId { get; set; } + [DisplayName("Название должности")] + public string PositionName { get; set; } = string.Empty; + [DisplayName("Среденее потребление материалров")] + public double materialAvg { get; set; } + } +} diff --git a/ConstructionCompany/ConstructionCompanyPsqlImplement/ConstructionCompanyDatabase.cs b/ConstructionCompany/ConstructionCompanyPsqlImplement/ConstructionCompanyDatabase.cs index 3960414..cd8466f 100644 --- a/ConstructionCompany/ConstructionCompanyPsqlImplement/ConstructionCompanyDatabase.cs +++ b/ConstructionCompany/ConstructionCompanyPsqlImplement/ConstructionCompanyDatabase.cs @@ -95,7 +95,7 @@ namespace ConstructionCompanyPsqlImplement connection.Close(); } - public List ExecuteReader(string commandString) + public List> ExecuteReader(string commandString, int numOfFields) { using var connection = new NpgsqlConnection(connectionString); connection.Open(); @@ -103,12 +103,17 @@ namespace ConstructionCompanyPsqlImplement using var commandMaterials = connection.CreateCommand(); commandMaterials.CommandText = commandString; using var reader = commandMaterials.ExecuteReader(); - List ids = new List(); + List> res = new List>(); while (reader.Read()) { - ids.Add(reader.GetInt32(0)); + List item = new List(); + for (int i =0; i < numOfFields; i++) + { + item.Add(reader.GetValue(i).ToString()); + } + res.Add(item); } - return ids; + return res; } private void refreshDb() diff --git a/ConstructionCompany/ConstructionCompanyPsqlImplement/Implements/MaterialStorage.cs b/ConstructionCompany/ConstructionCompanyPsqlImplement/Implements/MaterialStorage.cs index e1a3e54..593c967 100644 --- a/ConstructionCompany/ConstructionCompanyPsqlImplement/Implements/MaterialStorage.cs +++ b/ConstructionCompany/ConstructionCompanyPsqlImplement/Implements/MaterialStorage.cs @@ -104,11 +104,11 @@ namespace ConstructionCompanyPsqlImplement.Implements { return null; } - var employeesId = _source.ExecuteReader(command); + var employeesId = _source.ExecuteReader(command, 1); List employees = new List(); foreach (var id in employeesId) { - employees.Add(_source.Employees.First(x => x.Id == id).GetViewModel); + employees.Add(_source.Employees.First(x => x.Id == Convert.ToInt32(id[0])).GetViewModel); } return employees; } diff --git a/ConstructionCompany/ConstructionCompanyPsqlImplement/Implements/PositionStorage.cs b/ConstructionCompany/ConstructionCompanyPsqlImplement/Implements/PositionStorage.cs index 12c1446..2a0d678 100644 --- a/ConstructionCompany/ConstructionCompanyPsqlImplement/Implements/PositionStorage.cs +++ b/ConstructionCompany/ConstructionCompanyPsqlImplement/Implements/PositionStorage.cs @@ -97,5 +97,18 @@ namespace ConstructionCompanyPsqlImplement.Implements _source.ExecuteSql(command); return deletedPosition; } + + public List GetPositionsAverage(DateTime dateFrom, DateTime dateTo) + { + var command = Position.PositionsAVGCommnad(dateFrom, dateTo); + var result = _source.ExecuteReader(command, 2); + List positionsAverages = new List(); + foreach (var posAvgPair in result) + { + string positionName = _source.Positions.First(x => x.Id == Convert.ToInt32(posAvgPair[0])).PositionName; + positionsAverages.Add(new BrigadeReportViewModel { PositionId = Convert.ToInt32(posAvgPair[0]), PositionName = positionName, materialAvg = Convert.ToDouble(posAvgPair[1]) }); + } + return positionsAverages; + } } } diff --git a/ConstructionCompany/ConstructionCompanyPsqlImplement/Models/Position.cs b/ConstructionCompany/ConstructionCompanyPsqlImplement/Models/Position.cs index 0ef7954..a142d8c 100644 --- a/ConstructionCompany/ConstructionCompanyPsqlImplement/Models/Position.cs +++ b/ConstructionCompany/ConstructionCompanyPsqlImplement/Models/Position.cs @@ -64,6 +64,11 @@ namespace ConstructionCompanyPsqlImplement.Models return $"DELETE FROM postition WHERE id = {model.Id}"; } + public static string PositionsAVGCommnad(DateTime dateFrom, DateTime dateTo) + { + return $"SELECT \"position\".id, AVG(material_order.quantiny) FROM \"position\"\r\nJOIN employee ON employee.position_id = \"position\".id\r\nJOIN employee_order ON employee_order.employee_id = employee.id\r\nJOIN \"order\" ON \"order\".id = employee_order.order_id\r\nJOIN material_order ON material_order.order_id = \"order\".id\r\nJOIN material ON material.id = material_order.material_id\r\nWHERE \"order\".date_begin >= '{dateFrom}' AND \"order\".date_begin <= '{dateTo}'\r\nGROUP BY \"position\".id"; + } + public PositionViewModel GetViewModel => new() { Id = Id, diff --git a/ConstructionCompany/ConstructionCompanyView/FormBrigadeMenu.Designer.cs b/ConstructionCompany/ConstructionCompanyView/FormBrigadeMenu.Designer.cs index 57d5948..51e4210 100644 --- a/ConstructionCompany/ConstructionCompanyView/FormBrigadeMenu.Designer.cs +++ b/ConstructionCompany/ConstructionCompanyView/FormBrigadeMenu.Designer.cs @@ -32,6 +32,7 @@ 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.menuStrip1.SuspendLayout(); this.SuspendLayout(); // @@ -41,7 +42,8 @@ this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.сотрудникиToolStripMenuItem, this.должностиToolStripMenuItem, - this.назначитьНаЗаказToolStripMenuItem}); + this.назначитьНаЗаказToolStripMenuItem, + this.отчётПоДолжностямToolStripMenuItem}); this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Name = "menuStrip1"; this.menuStrip1.Size = new System.Drawing.Size(645, 28); @@ -69,6 +71,13 @@ this.назначитьНаЗаказToolStripMenuItem.Text = "Назначить на заказ"; this.назначитьНаЗаказToolStripMenuItem.Click += new System.EventHandler(this.назначитьНаЗаказToolStripMenuItem_Click); // + // отчётПоДолжностямToolStripMenuItem + // + this.отчётПоДолжностямToolStripMenuItem.Name = "отчётПоДолжностямToolStripMenuItem"; + this.отчётПоДолжностямToolStripMenuItem.Size = new System.Drawing.Size(174, 24); + this.отчётПоДолжностямToolStripMenuItem.Text = "Отчёт по должностям"; + this.отчётПоДолжностямToolStripMenuItem.Click += new System.EventHandler(this.отчётПоДолжностямToolStripMenuItem_Click); + // // FormBrigadeMenu // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); @@ -94,5 +103,6 @@ private ToolStripMenuItem сотрудникиToolStripMenuItem; private ToolStripMenuItem должностиToolStripMenuItem; private ToolStripMenuItem назначитьНаЗаказToolStripMenuItem; + private ToolStripMenuItem отчётПоДолжностямToolStripMenuItem; } } \ No newline at end of file diff --git a/ConstructionCompany/ConstructionCompanyView/FormBrigadeMenu.cs b/ConstructionCompany/ConstructionCompanyView/FormBrigadeMenu.cs index f552a65..c45786a 100644 --- a/ConstructionCompany/ConstructionCompanyView/FormBrigadeMenu.cs +++ b/ConstructionCompany/ConstructionCompanyView/FormBrigadeMenu.cs @@ -43,5 +43,14 @@ namespace ConstructionCompanyView form.ShowDialog(); } } + + private void отчётПоДолжностямToolStripMenuItem_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormBrigadeReport)); + if (service is FormBrigadeReport form) + { + form.ShowDialog(); + } + } } } diff --git a/ConstructionCompany/ConstructionCompanyView/FormBrigadeReport.Designer.cs b/ConstructionCompany/ConstructionCompanyView/FormBrigadeReport.Designer.cs new file mode 100644 index 0000000..3eb4cc9 --- /dev/null +++ b/ConstructionCompany/ConstructionCompanyView/FormBrigadeReport.Designer.cs @@ -0,0 +1,134 @@ +namespace ConstructionCompanyView +{ + partial class FormBrigadeReport + { + /// + /// 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.label1 = new System.Windows.Forms.Label(); + this.buttonShow = new System.Windows.Forms.Button(); + this.dataGridView = new System.Windows.Forms.DataGridView(); + this.dateTimePickerFrom = new System.Windows.Forms.DateTimePicker(); + this.dateTimePickerTo = new System.Windows.Forms.DateTimePicker(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 9); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(0, 20); + this.label1.TabIndex = 19; + // + // buttonShow + // + this.buttonShow.Location = new System.Drawing.Point(12, 72); + this.buttonShow.Name = "buttonShow"; + this.buttonShow.Size = new System.Drawing.Size(134, 29); + this.buttonShow.TabIndex = 18; + this.buttonShow.Text = "Посчитать"; + this.buttonShow.UseVisualStyleBackColor = true; + this.buttonShow.Click += new System.EventHandler(this.buttonShow_Click); + // + // dataGridView + // + this.dataGridView.BackgroundColor = System.Drawing.Color.White; + this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridView.Location = new System.Drawing.Point(12, 107); + this.dataGridView.MultiSelect = false; + this.dataGridView.Name = "dataGridView"; + this.dataGridView.RowHeadersVisible = false; + this.dataGridView.RowHeadersWidth = 51; + this.dataGridView.RowTemplate.Height = 29; + this.dataGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.dataGridView.Size = new System.Drawing.Size(680, 366); + this.dataGridView.TabIndex = 20; + // + // dateTimePickerFrom + // + this.dateTimePickerFrom.Location = new System.Drawing.Point(12, 39); + this.dateTimePickerFrom.Name = "dateTimePickerFrom"; + this.dateTimePickerFrom.Size = new System.Drawing.Size(218, 27); + this.dateTimePickerFrom.TabIndex = 21; + // + // dateTimePickerTo + // + this.dateTimePickerTo.Location = new System.Drawing.Point(263, 39); + this.dateTimePickerTo.Name = "dateTimePickerTo"; + this.dateTimePickerTo.Size = new System.Drawing.Size(222, 27); + this.dateTimePickerTo.TabIndex = 22; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(12, 9); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(18, 20); + this.label2.TabIndex = 23; + this.label2.Text = "C"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(263, 9); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(29, 20); + this.label3.TabIndex = 24; + this.label3.Text = "По"; + // + // FormBrigadeReport + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(704, 485); + this.Controls.Add(this.label3); + this.Controls.Add(this.label2); + this.Controls.Add(this.dateTimePickerTo); + this.Controls.Add(this.dateTimePickerFrom); + this.Controls.Add(this.dataGridView); + this.Controls.Add(this.label1); + this.Controls.Add(this.buttonShow); + this.Name = "FormBrigadeReport"; + this.Text = "Отчёт по использованию материалов должностями с датой"; + ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + private Label label1; + private Button buttonShow; + private DataGridView dataGridView; + private DateTimePicker dateTimePickerFrom; + private DateTimePicker dateTimePickerTo; + private Label label2; + private Label label3; + } +} \ No newline at end of file diff --git a/ConstructionCompany/ConstructionCompanyView/FormBrigadeReport.cs b/ConstructionCompany/ConstructionCompanyView/FormBrigadeReport.cs new file mode 100644 index 0000000..0da53ca --- /dev/null +++ b/ConstructionCompany/ConstructionCompanyView/FormBrigadeReport.cs @@ -0,0 +1,51 @@ +using ConstructionCompanyContracts.BusinessLogicContracts; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Diagnostics; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace ConstructionCompanyView +{ + public partial class FormBrigadeReport : Form + { + public IPositionLogic _logic; + public FormBrigadeReport(IPositionLogic logic) + { + InitializeComponent(); + _logic = logic; + } + + private void buttonShow_Click(object sender, EventArgs e) + { + if (dateTimePickerFrom.Value > dateTimePickerTo.Value) + { + MessageBox.Show("Неверно выбраны даты!"); + return; + } + try + { + Stopwatch stopwatch = new Stopwatch(); + stopwatch.Start(); + var list = _logic.ReadPositionsAverage(dateTimePickerFrom.Value.Date, dateTimePickerTo.Value.Date).OrderBy(x => x.PositionId).ToList(); + stopwatch.Stop(); + MessageBox.Show(stopwatch.ElapsedMilliseconds.ToString(), "Результат среднего по должностям. Время:"); + if (list != null) + { + dataGridView.DataSource = list; + dataGridView.Columns["PositionId"].Visible = false; + dataGridView.Columns["PositionName"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; + } + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } +} diff --git a/ConstructionCompany/ConstructionCompanyView/FormBrigadeReport.resx b/ConstructionCompany/ConstructionCompanyView/FormBrigadeReport.resx new file mode 100644 index 0000000..f298a7b --- /dev/null +++ b/ConstructionCompany/ConstructionCompanyView/FormBrigadeReport.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/ConstructionCompany/ConstructionCompanyView/FormLogin.cs b/ConstructionCompany/ConstructionCompanyView/FormLogin.cs index 80e0c2a..452ecb6 100644 --- a/ConstructionCompany/ConstructionCompanyView/FormLogin.cs +++ b/ConstructionCompany/ConstructionCompanyView/FormLogin.cs @@ -78,9 +78,10 @@ namespace ConstructionCompanyView //_random.GenerateEmployeesOrders(); //long employeesOrders = stopwatch.ElapsedMilliseconds; //stopwatch.Restart(); - _random.GenerateMaterialOrders(); + //_random.GenerateMaterialOrders(); //stopwatch.Stop(); //long materialOrders = stopwatch.ElapsedMilliseconds; + _random.GenerateAdditionalMaterialOrders(); //MessageBox.Show($"materials={materials}, positions={positions}, employees={employees}, orders={orders}, materialOrders={materialOrders}, employeeOrders={employeesOrders}", "Результаты"); MessageBox.Show("Готово!"); } diff --git a/ConstructionCompany/ConstructionCompanyView/FormWarehouseReport.Designer.cs b/ConstructionCompany/ConstructionCompanyView/FormWarehouseReport.Designer.cs index e8354d6..b9f747a 100644 --- a/ConstructionCompany/ConstructionCompanyView/FormWarehouseReport.Designer.cs +++ b/ConstructionCompany/ConstructionCompanyView/FormWarehouseReport.Designer.cs @@ -82,9 +82,9 @@ this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(3, 3); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(68, 20); + this.label2.Size = new System.Drawing.Size(280, 20); this.label2.TabIndex = 15; - this.label2.Text = "Рабочие"; + this.label2.Text = "Рабочие имеющие доступ к материалу"; // // FormWarehouseReport // @@ -97,7 +97,7 @@ this.Controls.Add(this.comboBoxMaterial); this.Controls.Add(this.dataGridView); this.Name = "FormWarehouseReport"; - this.Text = "FormWarehouseReport"; + this.Text = "Отчёт использования материлов "; this.Load += new System.EventHandler(this.FormWarehouseReport_Load); ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit(); this.ResumeLayout(false); diff --git a/ConstructionCompany/ConstructionCompanyView/FormWarehouseReport.cs b/ConstructionCompany/ConstructionCompanyView/FormWarehouseReport.cs index 1170be0..eaeb8d0 100644 --- a/ConstructionCompany/ConstructionCompanyView/FormWarehouseReport.cs +++ b/ConstructionCompany/ConstructionCompanyView/FormWarehouseReport.cs @@ -39,7 +39,7 @@ namespace ConstructionCompanyView stopwatch.Start(); var list = _logic.ReadEmployeesUsingMaterial(model); stopwatch.Stop(); - MessageBox.Show(stopwatch.ElapsedMilliseconds.ToString(), "Готово. Время:"); + MessageBox.Show(stopwatch.ElapsedMilliseconds.ToString(), "Отчёт по материалам. Время:"); if (list != null) { dataGridView.DataSource = list; diff --git a/ConstructionCompany/ConstructionCompanyView/Program.cs b/ConstructionCompany/ConstructionCompanyView/Program.cs index 486074a..d0d191f 100644 --- a/ConstructionCompany/ConstructionCompanyView/Program.cs +++ b/ConstructionCompany/ConstructionCompanyView/Program.cs @@ -66,6 +66,7 @@ namespace ConstructionCompanyView services.AddTransient(); services.AddTransient(); services.AddTransient(); + services.AddTransient(); } } } \ No newline at end of file