コード例 #1
0
        public ClientDataset GetCustomers(string companyType)
        {
            //Get customer list
            ClientDataset         customers = new ClientDataset();
            TrackingServiceClient client    = null;

            try {
                customers.ClientTable.AddClientTableRow(ID_ARGIX, "", "Argix Logistics Inc.", companyType, "");

                client = new TrackingServiceClient();
                DataSet ds = client.GetCustomers();
                client.Close();

                if (ds != null && ds.Tables["ClientTable"] != null)
                {
                    ClientDataset _customers = new ClientDataset();
                    _customers.Merge(ds);
                    customers.Merge(_customers.ClientTable.Select("CompanyType='" + companyType + "'", "CompanyName ASC"));
                }
                customers.AcceptChanges();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message, te); }
            catch (FaultException <TrackingFault> tfe) { client.Abort(); throw new ApplicationException(tfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message, fe); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message, ce); }
            return(customers);
        }
コード例 #2
0
        public TrackingItems TrackCartonsByShipment(string clientNumber, string contractNumber, string searchBy)
        {
            //Get a list of cartons (details) for the specified client and contract (i.e. PO, PRO) number
            TrackingItems         items  = null;
            TrackingServiceClient client = null;

            try {
                client = new TrackingServiceClient();
                switch (searchBy)
                {
                case SEARCHBY_PO:
                    items = client.TrackCartonsForPO(clientNumber, contractNumber);
                    break;

                case SEARCHBY_PRO:
                    items = client.TrackCartonsForPRO(clientNumber, contractNumber);
                    break;

                case SEARCHBY_BOL:
                    items = client.TrackCartonsForBOL(clientNumber, contractNumber);
                    break;
                }
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message, te); }
            catch (FaultException <TrackingFault> tfe) { client.Abort(); throw new ApplicationException(tfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message, fe); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message, ce); }
            return(items);
        }
コード例 #3
0
        public TrackingItems TrackCartons(string[] trackingNumbers, string searchBy, string companyType, string companyID)
        {
            //Get a list of cartons (details) for the specified tracking number (carton or label sequence)
            TrackingItems         items  = null;
            TrackingServiceClient client = null;

            try {
                client = new TrackingServiceClient();
                //string[] _numbers = trackingNumbers.Split(new char[]{','});
                string _client = companyID != ID_ARGIX && companyType.ToLower() == "client" ? companyID : null;
                string _vendor = companyID != ID_ARGIX && companyType.ToLower() == "vendor" ? companyID : null;
                switch (searchBy)
                {
                case SEARCHBY_LABELNUMBER:
                    items = client.TrackCartonsByLabelNumber(trackingNumbers, _client, _vendor);
                    break;

                case SEARCHBY_CARTONNUMBER:
                    items = client.TrackCartonsByCartonNumber(trackingNumbers, _client, _vendor);
                    break;

                case SEARCHBY_PLATENUMBER:
                    items = client.TrackCartonsByPlateNumber(trackingNumbers, _client, _vendor);
                    break;
                }
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message, te); }
            catch (FaultException <TrackingFault> tfe) { client.Abort(); throw new ApplicationException(tfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message, fe); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message, ce); }
            return(items);
        }
コード例 #4
0
        public StoreDataset GetStoresForSubStore(string subStoreNumber, string clientNumber, string vendorNumber)
        {
            //Get a list of client\vendor stores for the specified sub-store number
            StoreDataset          stores = new StoreDataset();
            TrackingServiceClient client = null;

            try {
                client = new TrackingServiceClient();
                DataSet ds = client.GetStoresForSubStore(subStoreNumber, clientNumber, vendorNumber);
                client.Close();
                if (ds != null && ds.Tables["StoreTable"] != null && ds.Tables["StoreTable"].Rows.Count > 0)
                {
                    stores.Merge(ds);
                    for (int i = 0; i < stores.StoreTable.Rows.Count; i++)
                    {
                        stores.StoreTable[i].DESCRIPTION = stores.StoreTable[i].NAME + " " +
                                                           stores.StoreTable[i].ADDRESSLINE1 + ", " +
                                                           stores.StoreTable[i].ADDRESS_LINE2 + " " +
                                                           stores.StoreTable[i].CITY + ", " +
                                                           stores.StoreTable[i].STATE + " " +
                                                           stores.StoreTable[i].ZIP;
                    }
                }
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message, te); }
            catch (FaultException <TrackingFault> tfe) { client.Abort(); throw new ApplicationException(tfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message, fe); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message, ce); }
            return(stores);
        }
コード例 #5
0
        public TrackingStoreItems TrackCartonsByStoreDetail(string clientNumber, string store, DateTime fromDate, DateTime toDate, string vendorID, bool searchByPickup, string tlNumber)
        {
            //
            TrackingStoreItems    items  = null;
            TrackingServiceClient client = null;

            try {
                client = new TrackingServiceClient();
                items  = client.TrackCartonsForStoreDetail(clientNumber, store, fromDate, toDate, vendorID, (searchByPickup ? "pickup" : "delivery"), tlNumber);
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message, te); }
            catch (FaultException <TrackingFault> tfe) { client.Abort(); throw new ApplicationException(tfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message, fe); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message, ce); }
            return(items);
        }
コード例 #6
0
        public ClientDataset GetClients(string vendorID)
        {
            //Return a list of clients filtered by vendorID (vendorID=null returns all Argix clients)
            ClientDataset         clients = new ClientDataset();
            TrackingServiceClient client  = null;

            try {
                client = new TrackingServiceClient();
                DataSet ds = client.GetClients(vendorID);
                if (ds != null)
                {
                    clients.Merge(ds);
                }
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message, te); }
            catch (FaultException <TrackingFault> tfe) { client.Abort(); throw new ApplicationException(tfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message, fe); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message, ce); }
            return(clients);
        }