Ejemplo n.º 1
0
        public string PrintSuperBillShift(SuperBillShift billShift)
        {
            var copy = billShift.Copy();

            _dataExport.CreateSuperBillShift(copy, _dataManagersFactory.GetDataManager<Order>().GetListCollection());
            return _dataExport.SaveReport();
        }
 public void Delete(SuperBillShift doc)
 {
     _dataManager.Delete(doc);
 }
Ejemplo n.º 3
0
        public void CreateSuperBillShift(SuperBillShift bill, List<Order> orders)
        {
            _pck = new ExcelPackage();
            var workSheet = _pck.Workbook.Worksheets.Add("Сводная накладная на кооперацию");
            CreateHeaderBillShift(workSheet);

            workSheet.Cells["C2"].Value = bill.Id;
            workSheet.Cells["C3"].Value = bill.Date;

            workSheet.Cells["B5"].Value = bill.Sender;
            workSheet.Cells["B6"].Value = 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.CountDetails;
                SetStyleToAllLinesSquare(workSheet.Cells[row, 4], ExcelBorderStyle.Thin);

                workSheet.Cells[row, 5].Value = string.Empty;
                SetStyleToAllLinesSquare(workSheet.Cells[row, 5], 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(SuperBillShift task)
 {
     _dataManager.InsertOrUpdate(task);
 }