Ejemplo n.º 1
0
        public string PrintBillShifts(BillShift billShift)
        {
            var copy = billShift.Copy();
            copy.Positions = copy.GetGrouppedPositions();

            _dataExport.CreateBillShift(copy, _dataManagersFactory.GetDataManager<Order>().GetListCollection());
            return _dataExport.SaveReport();
        }
Ejemplo n.º 2
0
        public void CreateBillShift(BillShift 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.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.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 BillShift UpdateBillShift(TicketAutUser ticket, BillShift doc)
 {
     _logger.Trace("Trace method Update for document: {0}. Id: {2}. User: {1}", typeof(BillShift).Name, ticket, doc.Id);
     _dataManagers.Update(doc, ticket);
     return(doc);
 }
 public BillShift InsertBillShift(TicketAutUser ticket, BillShift doc)
 {
     _logger.Trace("Trace method Insert for document: {0}. User: {1}", typeof(BillShift).Name, ticket);
     _dataManagers.Insert(doc, ticket);
     return(doc);
 }
 public List <HistoryRecord <BillShift> > GetHistoryDocBillShift(BillShift doc)
 {
     _logger.Trace("Trace method GetHistoryList for document: {0}", typeof(BillShift).Name);
     return(_historyManager.GetHistoryDoc(doc));
 }
Ejemplo n.º 6
0
 public void Delete(BillShift doc)
 {
     _dataManagersFactory.GetDataManager<BillShift>().Delete(doc);
 }
Ejemplo n.º 7
0
 public void Save(BillShift task)
 {
     _dataManagersFactory.GetDataManager<BillShift>().InsertOrUpdate(task);
 }