Exemple #1
0
 public string PrintBillInnerShift(BillInnerShift billShift)
 {
     var copy = billShift.Copy();
     copy.Positions = copy.GetGrouppedPositions();
     _dataExport.CreateBillInnerShift(copy, _dataManagersFactory.GetDataManager<Order>().GetListCollection(), _dataManagersFactory.GetDataManager<TechRoute>().GetListCollection());
     return _dataExport.SaveReport();
 }
 public void Delete(BillInnerShift doc)
 {
     _dataManagersFactory.GetDataManager<BillInnerShift>().Delete(doc);
 }
Exemple #3
0
        public void CreateBillInnerShift(BillInnerShift bill, List<Order> orders, List<TechRoute> routes)
        {
            _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 = "Цех № ";
            workSheet.Cells["B6"].Value = "Цех № ";

            var row = 9;

            foreach (var positionTaskToDept in bill.Positions)
            {
                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);

                workSheet.Cells[row, 8].Value = routes.FirstOrDefault(x => x.Id == positionTaskToDept.Drawing.TechRouteId)?.Name;
                SetStyleToAllLinesSquare(workSheet.Cells[row, 8], 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;
        }
 public void Save(BillInnerShift task)
 {
     _dataManagersFactory.GetDataManager<BillInnerShift>().InsertOrUpdate(task);
 }