Compare commits

..

No commits in common. "6c836919a1c3729969deaa8e16793040c87326eb" and "396f923de4748dfecb9103c615e353d554c64a6c" have entirely different histories.

20 changed files with 68 additions and 411 deletions

View File

@ -1,6 +1,4 @@
using FactoryBusinessLogic.OfficePackage; using FactoryContracts.BindingModels;
using FactoryBusinessLogic.OfficePackage.HelperModels;
using FactoryContracts.BindingModels;
using FactoryContracts.BusinessLogicsContracts; using FactoryContracts.BusinessLogicsContracts;
using FactoryContracts.SearchModels; using FactoryContracts.SearchModels;
using FactoryContracts.StoragesContracts; using FactoryContracts.StoragesContracts;
@ -10,57 +8,34 @@ namespace FactoryBusinessLogic.BusinessLogics
{ {
public class WorkerReportLogic : IWorkerReportLogic public class WorkerReportLogic : IWorkerReportLogic
{ {
private readonly IWorkpieceStorage _workpieceStorage; private readonly IMachineStorage _machineStorage;
private readonly IPlanProductionStorage _planProduction; private readonly IProductStorage _productStorage;
private readonly AbstractSaveToWord _saveToWord; public WorkerReportLogic(IMachineStorage machineStorage, IProductStorage productStorage)
private readonly AbstractSaveToExcel _saveToExcel;
private readonly AbstractSaveToPdf _saveToPdf;
public WorkerReportLogic(IWorkpieceStorage workpieceStorage, IPlanProductionStorage planProductionStorage, AbstractSaveToWord saveToWord, AbstractSaveToExcel saveToExcel, AbstractSaveToPdf saveToPdf)
{ {
_workpieceStorage = workpieceStorage; _machineStorage = machineStorage;
_planProduction = planProductionStorage; _productStorage = productStorage;
_saveToExcel = saveToExcel;
_saveToPdf = saveToPdf;
_saveToWord = saveToWord;
} }
public List<PlanProductionProductReportViewModel> GetProductsByPlanProduction(List<PlanProductionSearchModel> plans) public List<PlanProductionProductReportViewModel> GetProductsByPlanProduction(List<PlanProductionSearchModel> plans)
{ {
List<int> ids = plans.Select(x =>(int)x.Id).ToList(); //return _productStorage.GetProducts(plans);
return _planProduction.GetProducts(ids); throw new NotImplementedException();
} }
public List<WorkpieceTimeReportViewModel> GetWorkpieces(ClientSearchModel client, ReportBindingModel model) public List<WorkpieceTimeReportViewModel> GetWorkpieces(ClientSearchModel client, ReportBindingModel model)
{ {
return _workpieceStorage.GetWorkpiecesByPeriod(client, model); //return _workpieceStorage.GetWorkpiecesByPeriod(client, model);
} throw new NotImplementedException();
public void SaveWorkpiecesToPdfFile(ClientSearchModel client, ReportBindingModel model) }
{ public void SaveMachinesToPdfFile(ReportBindingModel model)
_saveToPdf.CreateWorkerDoc(new WorkerPdfInfo {
{ throw new NotImplementedException();
FileName = model.FileName, }
Title = "Список заготовок", public void SavePlanProductionsToExcelFile(ReportBindingModel model)
DateFrom = model.DateFrom!.Value, {
DateTo = model.DateTo!.Value, throw new NotImplementedException();
Workpieces = GetWorkpieces(client, model) }
}); public void SavePlanProductionsToWordFile(ReportBindingModel model)
} {
public void SaveProductsToExcelFile(ReportBindingModel model, List<int> plans) throw new NotImplementedException();
{ }
_saveToExcel.CreateWorkerReport(new WorkerExcelInfo }
{
FileName = model.FileName,
Title = "Список планов",
//PlanProductionProducts = GetProductsByPlanProduction(plans)
});
}
public void SaveProudctsToWordFile(ReportBindingModel model, List<int> ids)
{
var plans = _planProduction.GetProducts(ids);
_saveToWord.CreateWorkerDoc(new WorkerWordInfo
{
FileName = model.FileName,
Title = "Список планов",
//PlanProductionProducts = GetProductsByPlanProduction(plans)
});
}
}
} }

View File

@ -65,62 +65,9 @@ namespace FactoryBusinessLogic.OfficePackage
} }
SaveStorekeeperExcel(info); SaveStorekeeperExcel(info);
} }
public void CreateWorkerReport(WorkerExcelInfo info) protected abstract void CreateStorekeeperExcel(StorekeeperExcelInfo info);
{ protected abstract void InsertCellInWorksheet(ExcelCellParameters excelParams);
CreateWorkerExcel(info);
InsertCellInWorksheet(new ExcelCellParameters
{
ColumnName = "A",
RowIndex = 1,
Text = info.Title,
StyleInfo = ExcelStyleInfoType.Title
});
MergeCells(new ExcelMergeParameters
{
CellFromName = "A1",
CellToName = "C1"
});
uint rowIndex = 2;
foreach (var pp in info.PlanProductionProducts)
{
InsertCellInWorksheet(new ExcelCellParameters
{
ColumnName = "A",
RowIndex = rowIndex,
Text = pp.ProductionName,
StyleInfo = ExcelStyleInfoType.Text
});
rowIndex++;
foreach (var product in pp.Products)
{
InsertCellInWorksheet(new ExcelCellParameters
{
ColumnName = "B",
RowIndex = rowIndex,
Text = product.ProductName,
StyleInfo = ExcelStyleInfoType.TextWithBorder
});
InsertCellInWorksheet(new ExcelCellParameters
{
ColumnName = "C",
RowIndex = rowIndex,
Text = product.Price.ToString(),
StyleInfo = ExcelStyleInfoType.TextWithBorder
});
rowIndex++;
}
rowIndex++;
}
SaveWorkerExcel(info);
}
protected abstract void CreateStorekeeperExcel(StorekeeperExcelInfo info);
protected abstract void CreateWorkerExcel(WorkerExcelInfo info);
protected abstract void InsertCellInWorksheet(ExcelCellParameters excelParams);
protected abstract void MergeCells(ExcelMergeParameters excelParams); protected abstract void MergeCells(ExcelMergeParameters excelParams);
protected abstract void SaveStorekeeperExcel(StorekeeperExcelInfo info); protected abstract void SaveStorekeeperExcel(StorekeeperExcelInfo info);
protected abstract void SaveWorkerExcel(WorkerExcelInfo info);
} }
} }

View File

@ -79,88 +79,11 @@ namespace FactoryBusinessLogic.OfficePackage
} }
SaveStorekeeperPdf(info); SaveStorekeeperPdf(info);
} }
public void CreateWorkerDoc(WorkerPdfInfo info) protected abstract void CreateStorekeeperPdf(StorekeeperPdfInfo info);
{ protected abstract void CreateParagraph(PdfParagraph paragraph);
CreateWorkerPdf(info);
CreateParagraph(new PdfParagraph
{
Text = info.Title,
Style = "NormalTitle",
ParagraphAlignment = PdfParagraphAlignmentType.Center
});
CreateParagraph(new PdfParagraph
{
Text = $"с{info.DateFrom.ToShortDateString()} по {info.DateTo.ToShortDateString()}",
Style = "Normal",
ParagraphAlignment = PdfParagraphAlignmentType.Center
});
CreateTable(new List<string> { "3cm", "5cm", "5cm" });
CreateRow(new PdfRowParameters
{
Texts = new List<string> { "Название изделия", "Этапы выполнения", "Станки" },
Style = "NormalTitle",
ParagraphAlignment = PdfParagraphAlignmentType.Center
});
foreach (var workpiece in info.Workpieces)
{
CreateRow(new PdfRowParameters
{
Texts = new List<string>
{
workpiece.WorkpieceName,
string.Empty,
string.Empty,
},
Style = "Normal",
ParagraphAlignment = PdfParagraphAlignmentType.Left
});
var phaseNames = workpiece.ExecutionPhases.Select(x => x.ExecutionPhaseName).ToList();
var machineNames = workpiece.Machines.Select(x => x.MachineName).ToList();
if (phaseNames.Count != machineNames.Count)
{
if (phaseNames.Count > machineNames.Count)
{
var diff = phaseNames.Count - machineNames.Count;
for (int i = 0; i < diff; i++)
{
machineNames.Add(string.Empty);
}
}
else
{
var diff = machineNames.Count - phaseNames.Count;
for (int i = 0; i < diff; i++)
{
phaseNames.Add(string.Empty);
}
}
}
var tupleList = machineNames.Zip(phaseNames, Tuple.Create);
foreach (var tuple in tupleList)
{
CreateRow(new PdfRowParameters
{
Texts = new List<string>
{
string.Empty,
tuple.Item1,
tuple.Item2,
},
Style = "Normal",
ParagraphAlignment = PdfParagraphAlignmentType.Left
});
}
}
SaveWorkerPdf(info);
}
protected abstract void CreateStorekeeperPdf(StorekeeperPdfInfo info);
protected abstract void CreateWorkerPdf(WorkerPdfInfo info);
protected abstract void CreateParagraph(PdfParagraph paragraph);
protected abstract void CreateTable(List<string> columns); protected abstract void CreateTable(List<string> columns);
protected abstract void CreateRow(PdfRowParameters rowParameters); protected abstract void CreateRow(PdfRowParameters rowParameters);
protected abstract void SaveStorekeeperPdf(StorekeeperPdfInfo info); protected abstract void SaveStorekeeperPdf(StorekeeperPdfInfo info);
protected abstract void SaveWorkerPdf(WorkerPdfInfo info);
} }
} }

View File

@ -48,51 +48,9 @@ namespace FactoryBusinessLogic.OfficePackage
} }
SaveStorekeeperWord(info); SaveStorekeeperWord(info);
} }
public void CreateWorkerDoc(WorkerWordInfo info) protected abstract void CreateStorekeeperWord(StorekeeperWordInfo info);
{
CreateWorkerWord(info);
CreateParagraph(new WordParagraph
{
Texts = new List<(string, WordTextProperties)> {
(info.Title, new WordTextProperties { Bold = true, Size = "24", }) },
TextProperties = new WordTextProperties
{
Size = "24",
JustificationType = WordJustificationType.Center
}
});
foreach (var ppp in info.PlanProductionProducts)
{
var t = ppp.Products;
List<(string, WordTextProperties)> texts = new List<(string, WordTextProperties)>
{
(ppp.ProductionName, new WordTextProperties { Bold = true, Size = "24", })
};
foreach (var product in ppp.Products)
{
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.Append(product.ProductName);
stringBuilder.Append(" — ");
stringBuilder.Append(product.Price.ToString());
texts.Add((stringBuilder.ToString(), new WordTextProperties { Size = "24" }));
}
CreateParagraph(new WordParagraph
{
Texts = texts,
TextProperties = new WordTextProperties
{
Size = "24",
JustificationType = WordJustificationType.Both
}
});
}
SaveWorkerWord(info);
}
protected abstract void CreateStorekeeperWord(StorekeeperWordInfo info);
protected abstract void CreateWorkerWord(WorkerWordInfo info);
protected abstract void CreateParagraph(WordParagraph paragraph); protected abstract void CreateParagraph(WordParagraph paragraph);
protected abstract void SaveStorekeeperWord(StorekeeperWordInfo info); protected abstract void SaveStorekeeperWord(StorekeeperWordInfo info);
protected abstract void SaveWorkerWord(WorkerWordInfo info);
} }
} }

View File

@ -1,16 +0,0 @@
using FactoryContracts.ViewModels;
namespace FactoryBusinessLogic.OfficePackage.HelperModels
{
public class WorkerExcelInfo
{
public string FileName { get; set; } = string.Empty;
public string Title { get; set; } = string.Empty;
public List<PlanProductionProductReportViewModel> PlanProductionProducts
{
get;
set;
} = new();
}
}

View File

@ -1,14 +0,0 @@
using FactoryContracts.ViewModels;
namespace FactoryBusinessLogic.OfficePackage.HelperModels
{
public class WorkerPdfInfo
{
public string FileName { get; set; } = string.Empty;
public string Title { get; set; } = string.Empty;
public DateTime DateFrom { get; set; }
public DateTime DateTo { get; set; }
public List<WorkpieceTimeReportViewModel> Workpieces { get; set; } = new();
}
}

View File

@ -1,15 +0,0 @@
using FactoryContracts.ViewModels;
namespace FactoryBusinessLogic.OfficePackage.HelperModels
{
public class WorkerWordInfo
{
public string FileName { get; set; } = string.Empty;
public string Title { get; set; } = string.Empty;
public List<PlanProductionProductReportViewModel> PlanProductionProducts
{
get;
set;
} = new();
}
}

View File

@ -208,40 +208,7 @@ namespace FactoryBusinessLogic.OfficePackage.Implements
sheets.Append(sheet); sheets.Append(sheet);
_worksheet = worksheetPart.Worksheet; _worksheet = worksheetPart.Worksheet;
} }
protected override void CreateWorkerExcel(WorkerExcelInfo info) protected override void InsertCellInWorksheet(ExcelCellParameters excelParams)
{
_spreadsheetDocument = SpreadsheetDocument.Create(info.FileName, SpreadsheetDocumentType.Workbook);
// Создаем книгу (в ней хранятся листы)
var workbookpart = _spreadsheetDocument.AddWorkbookPart();
workbookpart.Workbook = new Workbook();
CreateStyles(workbookpart);
// Получаем/создаем хранилище текстов для книги
_shareStringPart =
_spreadsheetDocument.WorkbookPart!.GetPartsOfType<SharedStringTablePart>().Any()
?
_spreadsheetDocument.WorkbookPart.GetPartsOfType<SharedStringTablePart>().First()
:
_spreadsheetDocument.WorkbookPart.AddNewPart<SharedStringTablePart>();
// Создаем SharedStringTable, если его нет
if (_shareStringPart.SharedStringTable == null)
{
_shareStringPart.SharedStringTable = new SharedStringTable();
}
// Создаем лист в книгу
var worksheetPart = workbookpart.AddNewPart<WorksheetPart>();
worksheetPart.Worksheet = new Worksheet(new SheetData());
// Добавляем лист в книгу
var sheets = _spreadsheetDocument.WorkbookPart.Workbook.AppendChild(new Sheets());
var sheet = new Sheet()
{
Id = _spreadsheetDocument.WorkbookPart.GetIdOfPart(worksheetPart),
SheetId = 1,
Name = "Лист"
};
sheets.Append(sheet);
_worksheet = worksheetPart.Worksheet;
}
protected override void InsertCellInWorksheet(ExcelCellParameters excelParams)
{ {
if (_worksheet == null || _shareStringPart == null) if (_worksheet == null || _shareStringPart == null)
{ {
@ -337,14 +304,5 @@ namespace FactoryBusinessLogic.OfficePackage.Implements
_spreadsheetDocument.WorkbookPart!.Workbook.Save(); _spreadsheetDocument.WorkbookPart!.Workbook.Save();
_spreadsheetDocument.Dispose(); _spreadsheetDocument.Dispose();
} }
protected override void SaveWorkerExcel(WorkerExcelInfo info) }
{
if (_spreadsheetDocument == null)
{
return;
}
_spreadsheetDocument.WorkbookPart!.Workbook.Save();
_spreadsheetDocument.Dispose();
}
}
} }

View File

@ -35,13 +35,7 @@ namespace FactoryBusinessLogic.OfficePackage.Implements
DefineStyles(_document); DefineStyles(_document);
_section = _document.AddSection(); _section = _document.AddSection();
} }
protected override void CreateWorkerPdf(WorkerPdfInfo info) protected override void CreateParagraph(PdfParagraph pdfParagraph)
{
_document = new Document();
DefineStyles(_document);
_section = _document.AddSection();
}
protected override void CreateParagraph(PdfParagraph pdfParagraph)
{ {
if (_section == null) if (_section == null)
{ {
@ -96,15 +90,6 @@ namespace FactoryBusinessLogic.OfficePackage.Implements
renderer.RenderDocument(); renderer.RenderDocument();
renderer.PdfDocument.Save(info.FileName); renderer.PdfDocument.Save(info.FileName);
} }
protected override void SaveWorkerPdf(WorkerPdfInfo info)
{
var renderer = new PdfDocumentRenderer(true)
{
Document = _document
};
renderer.RenderDocument();
renderer.PdfDocument.Save(info.FileName);
}
} }
} }

View File

@ -63,14 +63,7 @@ namespace FactoryBusinessLogic.OfficePackage.Implements
mainPart.Document = new Document(); mainPart.Document = new Document();
_docBody = mainPart.Document.AppendChild(new Body()); _docBody = mainPart.Document.AppendChild(new Body());
} }
protected override void CreateWorkerWord(WorkerWordInfo info) protected override void CreateParagraph(WordParagraph paragraph)
{
_wordDocument = WordprocessingDocument.Create(info.FileName, WordprocessingDocumentType.Document);
MainDocumentPart mainPart = _wordDocument.AddMainDocumentPart();
mainPart.Document = new Document();
_docBody = mainPart.Document.AppendChild(new Body());
}
protected override void CreateParagraph(WordParagraph paragraph)
{ {
if (_docBody == null || paragraph == null) if (_docBody == null || paragraph == null)
{ {
@ -108,15 +101,5 @@ namespace FactoryBusinessLogic.OfficePackage.Implements
_wordDocument.MainDocumentPart!.Document.Save(); _wordDocument.MainDocumentPart!.Document.Save();
_wordDocument.Dispose(); _wordDocument.Dispose();
} }
protected override void SaveWorkerWord(WorkerWordInfo info) }
{
if (_docBody == null || _wordDocument == null)
{
return;
}
_docBody.AppendChild(CreateSectionProperties());
_wordDocument.MainDocumentPart!.Document.Save();
_wordDocument.Dispose();
}
}
} }

View File

@ -8,9 +8,8 @@ namespace FactoryContracts.BusinessLogicsContracts
{ {
List<PlanProductionProductReportViewModel> GetProductsByPlanProduction(List<PlanProductionSearchModel> plans); List<PlanProductionProductReportViewModel> GetProductsByPlanProduction(List<PlanProductionSearchModel> plans);
List<WorkpieceTimeReportViewModel> GetWorkpieces(ClientSearchModel client, ReportBindingModel model); List<WorkpieceTimeReportViewModel> GetWorkpieces(ClientSearchModel client, ReportBindingModel model);
void SaveProudctsToWordFile(ReportBindingModel model, List<int> plans); void SavePlanProductionsToWordFile(ReportBindingModel model);
void SaveProductsToExcelFile(ReportBindingModel model, List<int> plans); void SavePlanProductionsToExcelFile(ReportBindingModel model);
void SaveWorkpiecesToPdfFile(ClientSearchModel client, ReportBindingModel model); void SaveMachinesToPdfFile(ReportBindingModel model);
}
}
} }

View File

@ -17,8 +17,5 @@ namespace FactoryContracts.StoragesContracts
PlanProductionViewModel? Update(PlanProductionBindingModel model); PlanProductionViewModel? Update(PlanProductionBindingModel model);
PlanProductionViewModel? Delete(PlanProductionBindingModel model); PlanProductionViewModel? Delete(PlanProductionBindingModel model);
}
List<PlanProductionProductReportViewModel> GetProducts(List<int> ids);
}
} }

View File

@ -9,10 +9,8 @@ namespace FactoryContracts.StoragesContracts
List<WorkpieceViewModel> GetFullList(); List<WorkpieceViewModel> GetFullList();
List<WorkpieceViewModel> GetFilteredList(WorkpieceSearchModel model); List<WorkpieceViewModel> GetFilteredList(WorkpieceSearchModel model);
List<WorkpieceTimeReportViewModel> GetWorkpiecesByPeriod(ClientSearchModel client, ReportBindingModel model);
WorkpieceViewModel? GetElement(WorkpieceSearchModel model);
WorkpieceViewModel? GetElement(WorkpieceSearchModel model);
WorkpieceViewModel? Insert(WorkpieceBindingModel model); WorkpieceViewModel? Insert(WorkpieceBindingModel model);

View File

@ -3,6 +3,6 @@
public class PlanProductionProductReportViewModel public class PlanProductionProductReportViewModel
{ {
public string ProductionName { get; set; } = string.Empty; public string ProductionName { get; set; } = string.Empty;
public List<ProductViewModel> Products { get; set; } = new(); public List<string> Products { get; set; } = new();
} }
} }

View File

@ -3,7 +3,7 @@
public class WorkpieceTimeReportViewModel public class WorkpieceTimeReportViewModel
{ {
public string WorkpieceName { get; set; } = string.Empty; public string WorkpieceName { get; set; } = string.Empty;
public List<ExecutionPhaseViewModel> ExecutionPhases { get; set; } = new(); public List<string> ExecutionPhases { get; set; } = new();
public List<MachineViewModel> Machines { get; set; } = new(); public List<string> Machines { get; set; } = new();
} }
} }

View File

@ -123,21 +123,5 @@ namespace FactoryDatabaseImplement.Implements
} }
} }
public List<PlanProductionProductReportViewModel> GetProducts(List<int> ids) }
{
using var context = new FactoryDatabase();
return context.PlanProductions
.Where(plan => ids.Contains(plan.Id))
.Select(plan => new PlanProductionProductReportViewModel()
{
ProductionName = plan.ProductionName,
Products = context.WorkpieceProducts
.Include(x => x.Product)
.Where(product => plan.Id == product.Product.Id)
.Select(x => x.Product.GetViewModel)
.ToList()
})
.ToList();
}
}
} }

View File

@ -9,21 +9,6 @@ namespace FactoryDatabaseImplement.Implements
{ {
public class WorkpieceStorage : IWorkpieceStorage public class WorkpieceStorage : IWorkpieceStorage
{ {
public List<WorkpieceTimeReportViewModel> GetWorkpiecesByPeriod(ClientSearchModel client, ReportBindingModel model)
{
using var context = new FactoryDatabase();
return context.Workpieces
.Include(x => x.Client)
// not sure if its true
.Where(x => x.ClientId == client.Id && x.DateCreate >= model.DateFrom && x.DateCreate <= model.DateTo)
.Select(x => new WorkpieceTimeReportViewModel()
{
WorkpieceName = x.WorkpieceName,
ExecutionPhases = x.ExecutionPhases.Select(x => x.PlanProduction.GetViewModel).ToList(),
Machines = x.Machines.Select(x => x.Product.GetViewModel).ToList(),
})
.ToList();
}
public List<WorkpieceViewModel> GetFullList() public List<WorkpieceViewModel> GetFullList()
{ {
using var context = new FactoryDatabase(); using var context = new FactoryDatabase();

View File

@ -1,6 +1,5 @@
using DocumentFormat.OpenXml.Office2010.Excel; using DocumentFormat.OpenXml.Office2010.Excel;
using FactoryContracts.BindingModels; using FactoryContracts.BindingModels;
using FactoryContracts.BusinessLogicsContracts;
using FactoryContracts.ViewModels; using FactoryContracts.ViewModels;
using FactoryDatabaseImplement.Models; using FactoryDatabaseImplement.Models;
using FactoryDataModels.Enums; using FactoryDataModels.Enums;
@ -15,15 +14,13 @@ namespace FactoryWorkerApp.Controllers
{ {
private readonly ILogger<HomeController> _logger; private readonly ILogger<HomeController> _logger;
private readonly WorkerLogic _logic; private readonly WorkerLogic _logic;
private readonly IWorkerReportLogic _workerReportLogic;
private bool IsLoggedIn { get { return Client.user != null; } } private bool IsLoggedIn { get { return Client.user != null; } }
private int UserId { get { return Client.user!.Id; } } private int UserId { get { return Client.user!.Id; } }
public HomeController(ILogger<HomeController> logger, WorkerLogic logic, IWorkerReportLogic workerReportLogic) public HomeController(ILogger<HomeController> logger, WorkerLogic logic)
{ {
_logger = logger; _logger = logger;
_logic = logic; _logic = logic;
_workerReportLogic = workerReportLogic;
} }
public IActionResult Index() public IActionResult Index()
@ -228,7 +225,24 @@ namespace FactoryWorkerApp.Controllers
{ {
return View(); return View();
} }
[HttpGet]
public IActionResult ProductProductionReport()
{
List<PlanProductionProductReportViewModel> reports = new List<PlanProductionProductReportViewModel>
{
new PlanProductionProductReportViewModel
{
ProductionName = "План производства X",
Products = new List<string> { "Изделие 1", "Изделие 2" }
},
new PlanProductionProductReportViewModel
{
ProductionName = "План производства Y",
Products = new List<string> { "Изделие 3", "Изделие 4" }
}
};
return View(reports);
}
[HttpGet] [HttpGet]
public IActionResult WorkpieceTimeChoose() public IActionResult WorkpieceTimeChoose()
{ {

View File

@ -108,6 +108,7 @@
`; `;
$('#productsTable tbody').append(newRow); $('#productsTable tbody').append(newRow);
updateSum();
$('#productSelect').val(''); $('#productSelect').val('');
} else { } else {
alert('Выберите изделие для добавления'); alert('Выберите изделие для добавления');

View File

@ -1,5 +1,3 @@
using DocumentFormat.OpenXml.ExtendedProperties;
using FactoryBusinessLogic.OfficePackage;
using FactoryContracts.BindingModels; using FactoryContracts.BindingModels;
using FactoryContracts.BusinessLogicsContracts; using FactoryContracts.BusinessLogicsContracts;
using FactoryContracts.SearchModels; using FactoryContracts.SearchModels;
@ -15,10 +13,8 @@ namespace FactoryWorkerApp
private readonly IPlanProductionLogic _planProductionLogic; private readonly IPlanProductionLogic _planProductionLogic;
private readonly IProductLogic _productLogic; private readonly IProductLogic _productLogic;
private readonly IExecutionPhaseLogic _executionPhaseLogic; private readonly IExecutionPhaseLogic _executionPhaseLogic;
private readonly IWorkerReportLogic _workerReport;
public WorkerLogic(ILogger<WorkerLogic> logger, IClientLogic clientLogic, IWorkpieceLogic workpieceLogic, IPlanProductionLogic planProductionLogic, IExecutionPhaseLogic executionPhaseLogic, IProductLogic productLogic)
public WorkerLogic(ILogger<WorkerLogic> logger, IClientLogic clientLogic, IWorkpieceLogic workpieceLogic, IPlanProductionLogic planProductionLogic, IExecutionPhaseLogic executionPhaseLogic, IProductLogic productLogic, IWorkerReportLogic reportLogic)
{ {
_logger = logger; _logger = logger;
_clientLogic = clientLogic; _clientLogic = clientLogic;
@ -26,7 +22,6 @@ namespace FactoryWorkerApp
_planProductionLogic = planProductionLogic; _planProductionLogic = planProductionLogic;
_executionPhaseLogic = executionPhaseLogic; _executionPhaseLogic = executionPhaseLogic;
_productLogic = productLogic; _productLogic = productLogic;
_workerReport = reportLogic;
} }
public ClientViewModel? Login(string login, string password) public ClientViewModel? Login(string login, string password)