private void DHL_Test(int OrderID) { SC_WebService SCWS = new SC_WebService(Session["ApiUserName"].ToString(), Session["ApiPassword"].ToString()); IRepository <Orders> Orders = new GenericRepository <Orders>(db); Orders order = Orders.Get(OrderID); Packages package = order.Packages.First(p => p.IsEnable.Value); try { DHL_API DHL = new DHL_API(package.Method.Carriers.CarrierAPI); ShipmentResponse result = DHL.Create(package); //String OutputImage = "JVBERi0xLjQKJeLjz9MKMiAwIG9iago8PC9MZW5ndGggNTEvRmlsdGVyL0ZsYXRlRGVjb2RlPj5zdHJlYW0KeJwr5HIK4TJQMLU01TOyUAhJ4XIN4QrkKlQwVDAAQgiZnKugH5FmqOCSrxDIBQD9oQpWCmVuZHN0cmVhbQplbmRvYmoKNCAwIG9iago8PC9CYXNlRm9udC9IZWx2ZXRpY2EtQm9sZC9UeXBlL0ZvbnQvRW5jb2RpbmcvV2luQW5zaUVuY29kaW5nL1N1YnR5cGUvVHlwZTE+PgplbmRvYmoKNSAwIG9iago8PC9CYXNlRm9udC9IZWx2ZXRpY2EvVHlwZS9Gb250L0VuY29kaW5nL1dpbkFuc2lFbmNvZGluZy9TdWJ0eXBlL1R5cGUxPj4KZW5kb2JqCjMgMCBvYmoKPDwvVHlwZS9YT2JqZWN0L1Jlc291cmNlczw8L1Byb2NTZXRbL1BERi9UZXh0L0ltYWdlQi9JbWFnZUMvSW1hZ2VJXS9Gb250PDwvRjEgNCAwIFIvRjIgNSAwIFI+Pj4+L1N1YnR5cGUvRm9ybS9CQm94WzAgMCA4NDEuODkgNTk1LjI4XS9NYXRyaXhbMSAwIDAgMSAwIDBdL0Zvcm1UeXBlIDEvTGVuZ3RoIDQzMDIvRmlsdGVyL0ZsYXRlRGVjb2RlPj5zdHJlYW0KeJytm1tzHbeVhd/5K/rRzkTtxh3wm2MpvpRsc0R6pGQ8DxpZFplpkolMlcv/PvuCxl44YlJS1cSVile413cat40NnD7/ONuW1NLq63JD/7ot+1mNbq0N/7UH7GdXZ8/Pbs/c8tuZX76l8L+duW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oaVRleHQgMi4xLjcgYnkgMVQzWFQpL01vZERhdGUoRDoyMDE3MTExNjAzNDQwMVopL0NyZWF0aW9uRGF0ZShEOjIwMTcxMTE2MDM0NDAxWik+PgplbmRvYmoKeHJlZgowIDE0CjAwMDAwMDAwMDAgNjU1MzUgZiAKMDAwMDAwNDg0NSAwMDAwMCBuIAowMDAwMDAwMDE1IDAwMDAwIG4gCjAwMDAwMDAzMTMgMDAwMDAgbiAKMDAwMDAwMDEzMiAwMDAwMCBuIAowMDAwMDAwMjI1IDAwMDAwIG4gCjAwMDAwMDg1OTcgMDAwMDAgbiAKMDAwMDAwODQzNSAwMDAwMCBuIAowMDAwMDA1MDA3IDAwMDAwIG4gCjAwMDAwMDUzMDcgMDAwMDAgbiAKMDAwMDAwNTEyNCAwMDAwMCBuIAowMDAwMDA1MjE4IDAwMDAwIG4gCjAwMDAwMDg2NjYgMDAwMDAgbiAKMDAwMDAwODcxMiAwMDAwMCBuIAp0cmFpbGVyCjw8L1Jvb3QgMTIgMCBSL0lEIFs8MWU2NWUwZThhZTE1MTNiYzMxODdmZmQ4ZGE0YTQ5Mjk+PDY3ZjIzMGRlM2I1YzIwNWE4ZGU2YzNkMDE1ODk3NDY2Pl0vSW5mbyAxMyAwIFIvU2l6ZSAxND4+CnN0YXJ0eHJlZgo4ODIzCiUlRU9GCg=="; //System.IO.File.WriteAllBytes(@"C:\Downloads\DHL_test.pdf", Crop(Convert.FromBase64String(OutputImage), 97f, 30f, 356f, 553f)); //System.IO.File.WriteAllBytes(@"C:\Users\qdtuk\Downloads\DHL_test.pdf", Crop(result.LabelImage.First().OutputImage, 97f, 30f, 356f, 553f)); //System.IO.File.WriteAllBytes(@"C:\Users\qdtuk\Downloads\DHL_Invoice_test.pdf", result.LabelImage.First().MultiLabels.First().DocImageVal); } catch (Exception e) { } }
private TrackResult DHL_Track(CarrierAPI api, string trackingNumber) { TrackResult result = new TrackResult(); DHL_API DHL = new DHL_API(api); TrackingResponse DHL_Result = DHL.Tracking(trackingNumber); TimeZoneConvert timeZone = new TimeZoneConvert(); if (DHL_Result != null && DHL_Result.AWBInfo.Any(awb => awb.ShipmentInfo != null && !string.IsNullOrEmpty(awb.ShipmentInfo.ConsigneeName))) { List <ShipmentEvent> DHL_EventList = DHL_Result.AWBInfo.First(awb => awb.ShipmentInfo != null && !string.IsNullOrEmpty(awb.ShipmentInfo.ConsigneeName)).ShipmentInfo.Items.Skip(1).Cast <ShipmentEvent>().ToList(); if (DHL_EventList.Any()) { if (DHL_EventList.Any(e => e.ServiceEvent.EventCode == "PU")) { result.PickupDate = DHL_EventList.Where(e => e.ServiceEvent.EventCode == "PU").Select(e => timeZone.InitDateTime(e.Date.Add(e.Time.TimeOfDay), EnumData.TimeZone.TST).Utc).First(); result.DeliveryStatus = (int)OrderService.DeliveryStatusType.Intransit; } result.DeliveryNote = DHL_EventList.Select(e => timeZone.InitDateTime(e.Date.Add(e.Time.TimeOfDay), EnumData.TimeZone.TST).Utc.ToString() + " " + e.ServiceEvent.Description).Last(); if (DHL_EventList.Any(e => e.ServiceEvent.EventCode == "OK")) { result.DeliveryDate = DHL_EventList.Where(e => e.ServiceEvent.EventCode == "OK").Select(e => timeZone.InitDateTime(e.Date.Add(e.Time.TimeOfDay), EnumData.TimeZone.TST).Utc).First(); result.DeliveryStatus = (int)OrderService.DeliveryStatusType.Delivered; } } } else { result.DeliveryNote = DHL_Result.AWBInfo.First().Status.ActionStatus; //result.DeliveryStatus = (int)OrderService.DeliveryStatusType.Delivered; } return(result); }