public ExpressTradelaneIntegration TradelaneHubInitials(int customerId, int hubId) { ExpressTradelaneIntegration integrationShipment = new ExpressTradelaneIntegration(); integrationShipment.Shipment = new ExpressManifestRepository().TradelaneHubInitials(customerId, hubId); return(integrationShipment); }
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)); }