Exemple #1
0
        public TradelaneFile GetDriverManifest(ExpressDownloadPDFModel DownloadPDFModel)
        {
            TradelaneFile File = new TradelaneShipmentsController().CreateDocument(DownloadPDFModel.TradelaneShipmentId, DownloadPDFModel.CustomerId, FrayteTradelaneShipmentDocumentEnum.DriverManifest, "");

            File.FilePath            = AppSettings.WebApiPath + "UploadFiles/Tradelane" + "/" + DownloadPDFModel.TradelaneShipmentId + "/" + File.FileName;
            File.TradelaneShipmentId = DownloadPDFModel.TradelaneShipmentId;
            if (File.FileName != null && File.FilePath != null)
            {
                var FilePath = AppSettings.UploadFolderPath + "/Tradelane" + "/" + DownloadPDFModel.TradelaneShipmentId + "/" + File.FileName;
                new ExpressManifestRepository().SendDriverManifest(DownloadPDFModel, FilePath);
            }
            return(File);
        }
        public FratyteError SaveMawbAllocation(List <MawbAllocationModel> MAList)
        {
            var File     = new TradelaneShipmentsController().CreateDocument(MAList.FirstOrDefault().TradelaneId, 0, FrayteTradelaneShipmentDocumentEnum.CoLoadForm, "");
            var FilePath = AppSettings.UploadFolderPath + "/Tradelane" + "/" + MAList.FirstOrDefault().TradelaneId + "/" + File.FileName;

            if (File.FileName != null && File.FileName != "")
            {
            }
            else
            {
                FilePath = "";
            }
            return(new MawbAllocationRepository().SaveMawbAllocation(MAList, FilePath, "Tradelane"));
        }
Exemple #3
0
        public IHttpActionResult SaveTradelaneIntegration(ExpressTradelaneIntegration integratedShipment)
        {
            TradelaneBooking shipment = new TradelaneBooking();

            new ExpressManifestRepository().MapIntegratedShipmentToTradelaneShipment(integratedShipment, shipment);
            TradelaneBooking dbShipment = new TradelaneBookingRepository().SaveShipment(shipment, "Express");

            if (!dbShipment.Error.Status)
            {
                TradelaneEmailModel model = new TradelaneEmailRepository().TradelaneEmailObj(dbShipment.TradelaneShipmentId);
                // Fill all the required info in the email model
                integratedShipment.MAWBList.FirstOrDefault().TradelaneId = dbShipment.TradelaneShipmentId;
                // model.ShipmentDetail.ShipFrom = new TradelBookingAdress();
                model.ShipmentDetail.ShipFrom.IsMailSend = dbShipment.ShipFrom.IsMailSend;
                //  model.ShipmentDetail.ShipTo = new TradelBookingAdress();
                model.ShipmentDetail.ShipTo.IsMailSend      = dbShipment.ShipTo.IsMailSend;
                model.ShipmentDetail.NotifyParty.IsMailSend = dbShipment.NotifyParty.IsMailSend;

                new TradelaneEmailRepository().FillBookingInformationEmailModel(model);
                // Update Status for AWB
                // Send Shipment info email created by
                //  new TradelaneEmailRepository().SendEmail_E1(model);

                // Customer Confirmation email
                new TradelaneEmailRepository().SendEmail_E2_1(model);

                // Send MAWB AllocationEMail
                new TradelaneEmailRepository().FillModel_E3(model);
                new TradelaneEmailRepository().SendEmail_E3(model);


                // Add shipment tracking
                new TradelaneBookingRepository().SaveShipmentTracking(shipment);
                //  Add FLight Detail
                new TradelaneBookingRepository().SaveShipmentFlightDetail(shipment);
                new ExpressManifestRepository().UpdateExpressShipmentStatus(integratedShipment.Shipment.Packages);

                // Update MAWBAllocation
                var File     = new TradelaneShipmentsController().CreateDocument(dbShipment.TradelaneShipmentId, 0, FrayteTradelaneShipmentDocumentEnum.CoLoadForm, "");
                var FilePath = AppSettings.UploadFolderPath + "/Tradelane" + "/" + integratedShipment.MAWBList.FirstOrDefault().TradelaneId + "/" + File.FileName;
                if (File.FileName != null && File.FileName != "")
                {
                }
                else
                {
                    FilePath = "";
                }

                new MawbAllocationRepository().SaveExpressMawbAllocation(integratedShipment.MAWBList, FilePath, "Express");

                // update tradelane Shipment id  in express  table
                new ExpressManifestRepository().SaveExportManifest(dbShipment.TradelaneShipmentId, integratedShipment.Shipment);

                var file = new TradelaneShipmentsController().CreateDocument(dbShipment.TradelaneShipmentId, 0, FrayteTradelaneShipmentDocumentEnum.ExportManifest, "");
                new TradelaneBookingRepository().SaveShipmentDocument(dbShipment.TradelaneShipmentId, FrayteTradelaneShipmentDocumentEnum.ExportManifest, file.FileName, integratedShipment.Shipment.CreatedBy);

                var file1 = new TradelaneShipmentsController().CreateDocument(dbShipment.TradelaneShipmentId, dbShipment.CreatedBy, FrayteTradelaneShipmentDocumentEnum.DriverManifest, "");
                new TradelaneBookingRepository().SaveShipmentDocument(dbShipment.TradelaneShipmentId, FrayteTradelaneShipmentDocumentEnum.DriverManifest, file1.FileName, integratedShipment.Shipment.CreatedBy);

                new MawbAllocationRepository().SendMawbAllocationMail(integratedShipment.MAWBList, FilePath, "Express");
            }
            return(Ok(integratedShipment));
        }