static void Main(string[] args) { var stopWatch = Stopwatch.StartNew(); stopWatch.Start(); //Get Bank Exchange Rates BNCRManager bank = new BNCRManager(); var exchangeRates = bank.GetExchangeRate(); List <ShippingRate> rates = new List <ShippingRate>(); FedExManager fedExManager = new FedExManager(); rates.AddRange(fedExManager.GetRates()); USPSManager uspsManager = new USPSManager(); rates.AddRange(uspsManager.GetRates()); var ratesInColones = rates.Select(c => { c.Price = c.Price * exchangeRates.PurchasePrice; return(c); }).ToList(); stopWatch.Stop(); Console.WriteLine($"Sequential Time {stopWatch.ElapsedMilliseconds}"); Console.WriteLine("Shipping Method Price (Colones)"); foreach (var rate in rates) { Console.WriteLine($"{rate.Method} {rate.Price}"); } //Console.ReadKey(); }
public bool ValidateGolfCourseAddress(PrivilegeRequestViewModel privilegeRequestVm) { var address = new Address { Address2 = privilegeRequestVm.CourseAddress, City = privilegeRequestVm.City, State = privilegeRequestVm.StateCode, Zip = privilegeRequestVm.Zip, }; var uspsManager = new USPSManager(_uspsUserId); try { var validatedAddress = uspsManager.ValidateAddress(address); } catch (USPSManagerException uspsManagerException) { return(false); } return(true); }
private static long CalculateSequential() { var stopWatch = Stopwatch.StartNew(); stopWatch.Start(); //Get Bank Exchange Rates BNCRManager bank = new BNCRManager(); var exchangeRates = bank.GetExchangeRate(); List <ShippingRate> rates = new List <ShippingRate>(); FedExManager fedExManager = new FedExManager(); rates.AddRange(fedExManager.GetRates()); USPSManager uspsManager = new USPSManager(); rates.AddRange(uspsManager.GetRates()); var ratesInColones = rates.Select(c => { c.Price = c.Price * exchangeRates.PurchasePrice; return(c); }).ToList(); stopWatch.Stop(); return(stopWatch.ElapsedMilliseconds); }
public TrackingControl() { USPS = new USPSManager(); UPS = new UPSManager(); FedEx = new FedExManager(); }