// Entry Point. public void GetTrackingResult(string trackingNo) { shippingResult = new ShippingResult(); string shippingResultInString = string.Empty; if (!string.IsNullOrEmpty(trackingNo)) { CarrierName carrier = getCarrierName(trackingNo); CredentialValidation(carrier); switch (carrier) { case CarrierName.UPS: trackingFacility = new UPSTracking(); break; case CarrierName.USPS: trackingFacility = new USPSTracking(); break; case CarrierName.FedEx: trackingFacility = new FedExTracking(); break; default: trackingFacility = new USPSTracking(); break; } shippingResult = trackingFacility.GetTrackingResult(trackingNo); } }
// Entry Point. public void GetTrackingResult(string trackingNo) { shippingResult = new ShippingResult(); string strShippingResult = string.Empty; try { if (!string.IsNullOrEmpty(trackingNo)) { CarrierName carrier = getCarrierName(trackingNo); CredentialValidation(carrier); trackingFacility = new UPSTracking(trackingNo); shippingResult = trackingFacility.GetTrackingResult(); } } catch (Exception e) { Console.WriteLine(e); } }