public string PrintSuperBillInnerShift(SuperBillInnerShift billShift) { var copy = billShift.Copy(); _dataExport.CreateSuperBillInnerShift(copy, _dataManagersFactory.GetDataManager<Order>().GetListCollection()); return _dataExport.SaveReport(); }
public void Save(SuperBillInnerShift task) { _dataManager.InsertOrUpdate(task); }
public void Delete(SuperBillInnerShift doc) { _dataManager.Delete(doc); }
public void CreateSuperBillInnerShift(SuperBillInnerShift bill, List<Order> orders) { _pck = new ExcelPackage(); var workSheet = _pck.Workbook.Worksheets.Add("Сводная накладная на внутреннее перемещение"); CreateHeaderBillInnerShift(workSheet); workSheet.Cells["C2"].Value = bill.Id; workSheet.Cells["C3"].Value = bill.Date; workSheet.Cells["B5"].Value = string.IsNullOrEmpty(bill.Sender) ? "Цех № " + (int)bill.ProductionSender : bill.Sender; workSheet.Cells["B6"].Value = string.IsNullOrEmpty(bill.Getter) ? "Цех № " + (int)bill.ProductionGetter : bill.Getter; var row = 9; foreach (var positionTaskToDept in bill.GetGrouppedPositions()) { workSheet.Cells[row, 1].Value = positionTaskToDept.Name; SetStyleToAllLinesSquare(workSheet.Cells[row, 1], ExcelBorderStyle.Thin); var order = orders.FirstOrDefault(x => x.Id == bill.OrderId); workSheet.Cells[row, 2].Value = order == null ? bill?.OrderId.ToString() : order.OrderNo; SetStyleToAllLinesSquare(workSheet.Cells[row, 2], ExcelBorderStyle.Thin); workSheet.Cells[row, 3].Value = positionTaskToDept.Designation; SetStyleToAllLinesSquare(workSheet.Cells[row, 3], ExcelBorderStyle.Thin); workSheet.Cells[row, 4].Value = positionTaskToDept.Profile; SetStyleToAllLinesSquare(workSheet.Cells[row, 4], ExcelBorderStyle.Thin); workSheet.Cells[row, 5].Value = positionTaskToDept.StandartSize; SetStyleToAllLinesSquare(workSheet.Cells[row, 5], ExcelBorderStyle.Thin); workSheet.Cells[row, 6].Value = positionTaskToDept.CountDetails; SetStyleToAllLinesSquare(workSheet.Cells[row, 6], ExcelBorderStyle.Thin); workSheet.Cells[row, 7].Value = string.Empty; SetStyleToAllLinesSquare(workSheet.Cells[row, 7], ExcelBorderStyle.Thin); row++; } workSheet.Cells[row + 2, 1].Value = "Отпустил:"; workSheet.Cells[row + 2, 1].Style.HorizontalAlignment = ExcelHorizontalAlignment.Right; workSheet.Cells[row + 3, 1].Value = "Принял:"; workSheet.Cells[row + 3, 1].Style.HorizontalAlignment = ExcelHorizontalAlignment.Right; }