public Transit GetTransit(Address from, Address to, DateTime pickupDate, string pkgweight) { if (NetInfo.CheckForInternetConnection()) { Address shipFrom = from; Address shipTo = to; try { Transit t = new Transit(); //t.Initialize(ASCIIEncoding.ASCII.GetString(Convert.FromBase64String(MainForm._UPSaccount.A)), // ASCIIEncoding.ASCII.GetString(Convert.FromBase64String(MainForm._UPSaccount.I)), // ASCIIEncoding.ASCII.GetString(Convert.FromBase64String(MainForm._UPSaccount.P))); //t.Initialize("6D1E455E9EE5C60E", "jnoble21", "SUS12qaz"); t.Initialize(UPSacct.A, UPSacct.I, UPSacct.P); t.AddShipFrom(shipFrom); t.AddShipTo(shipTo); t.AddPickup(pickupDate); t.SetUnits(); t.SetInvoice(); t.SetPackage(pkgweight, "1"); t.tntResponse = t.Estimate(); return(t); } catch { return(null); } } return(null); }
public Rate GetRate(Address shipFrom, Address shipTo, Address shipper, UPScode code, Package package, string option = "Rate") { if (NetInfo.CheckForInternetConnection()) { try { _Rate = new Rate(option, UPSacct.A, UPSacct.I, UPSacct.P, UPSacct.N); _Rate = _Rate.SubmitRateRequest(shipFrom, shipFrom, shipTo, code, package); return(_Rate); } catch { return(null); } } return(null); }
public Ship GetShip(Address shipFrom, Address shipTo, Address shipper, UPScode code, Package package, string refers = "", string refers2 = "") { if (NetInfo.CheckForInternetConnection()) { try { _Ship = new Ship(UPSacct.A, UPSacct.I, UPSacct.P, UPSacct.N); _Ship.Testmode = TESTMODE; _Ship = _Ship.ProcessShipment(shipFrom, shipFrom, shipTo, code, package, refers, refers2); return(_Ship); } catch (Exception ex) { return(null); } } return(null); }