public void Save(ExportImportAudit exportImport)
 {
     var exist = _ctx.ExportImportAudits.FirstOrDefault(p=>p.DocumentId==exportImport.DocumentId);
     if(exist==null)
     {
         exist = new ExportImportAudit(IntegrationModule.FCL, DocumentAuditStatus.New, exportImport.DocumentId, exportImport.DocumentReference, exportImport.ExternalDocumentRef);
         exist.DateUploaded = DateTime.Now;
         _ctx.ExportImportAudits.Add(exist);
         
     }
     else
     {
        exist.ExternalDocumentRef = exportImport.ExternalDocumentRef;
     }
     _ctx.SaveChanges();
 }
예제 #2
0
        private void MarkAsExported(PzCussonsOrderIntegrationDto dto)
        {
            var exportedItem = new ExportImportAudit(IntegrationModule.PZCussons, DocumentAuditStatus.Exported,
                                                     Guid.NewGuid(), dto.GenericOrderReference,
                                                     dto.ExternalOrderReference)
                                   {

                                       AuditStatus = DocumentAuditStatus.Exported,
                                       ExternalDocumentRef = dto.ExternalOrderReference,
                                       DateUploaded = DateTime.Now



                                   };


            ObjectFactory.GetInstance<IExportImportAuditRepository>().Save(exportedItem);
        }
예제 #3
0
 public static void MarkAsExported(FclExportOrderDto n)
 {
     var exportedItem = new ExportImportAudit()
     {
         IntegrationModule = IntegrationModule.FCL,
         AuditStatus = DocumentAuditStatus.Exported,
         DocumentReference = n.GenericOrderReference,
         ExternalDocumentRef = n.ExternalOrderReference,
         DocumentType = DocumentType.Order,
         DateUploaded = DateTime.Now,
         DocumentId = Guid.NewGuid()
     };
     ObjectFactory.GetInstance<IExportImportAuditRepository>().Save(exportedItem);
 }
예제 #4
0
 public static void MarkPaymentAsExported(IEnumerable<FclPaymentExportDto> dtos)
 {
    
         foreach (var n in dtos.ToList())
         {
             var exportedItem = new ExportImportAudit()
                                    {
                                        IntegrationModule = IntegrationModule.FCL,
                                        AuditStatus = DocumentAuditStatus.Exported,
                                        DocumentReference =n.GenericOrderReference,
                                        ExternalDocumentRef = n.ExternalOrderReference,
                                        DocumentType = DocumentType.Receipt,
                                        DateUploaded = DateTime.Now,
                                        DocumentId = Guid.NewGuid()
                                    };
             ObjectFactory.GetInstance<IExportImportAuditRepository>().Save(exportedItem);
         }
             
     
     
     
 }
        public bool MarkInventoryDocumentAsImported(IEnumerable<string> docrefs, IntegrationModule module)
        {
            try
            {
                var orderRefs = docrefs.Distinct().ToList();
                var logRepo = ObjectFactory.GetInstance<IExportImportAuditRepository>();
                foreach (var orderRef in orderRefs)
                {
                    if (logRepo.IsExported(orderRef)) continue;
                    var exported = new ExportImportAudit()
                    {
                        IntegrationModule = module,
                        ExternalDocumentRef = orderRef,
                        DocumentReference = orderRef,
                        DocumentId = Guid.NewGuid(),
                        DocumentType = DocumentType.InventoryTransferNote,//GO=> TODo:receipt/invoices..? not an issue=>we track with ref
                        AuditStatus = DocumentAuditStatus.Imported
                    };
                    logRepo.Save(exported);
                }
                return true;
            }
            catch (Exception ex)
            {
                return false;
            }

        }