Example #1
0
        public TrackingItems TrackCartonsByCartonNumber(string[] itemNumbers, string clientNumber, string vendorNumber)
        {
            //
            TrackingItems items = new TrackingItems();

            try {
                string numbers = "";
                for (int i = 0; i < itemNumbers.Length; i++)
                {
                    if (i > 0)
                    {
                        numbers += ",";
                    }
                    numbers += itemNumbers[i];
                }
                TrackingDataset cartons = new TrackingDataset();
                cartons.Merge(new EnterpriseRGateway().GetCartonsByCartonNumber(numbers, clientNumber, vendorNumber));

                //Return records for all found items
                foreach (TrackingDataset.TrackingTableRow carton in cartons.TrackingTable.Rows)
                {
                    //Keep the response item if it matches a requested item (use CTN number)
                    for (int i = 0; i < itemNumbers.Length; i++)
                    {
                        if (carton.CTN.Trim() == itemNumbers[i])
                        {
                            //Keep it
                            TrackingItem item = new TrackingItem(itemNumbers[i], carton);
                            items.Add(item);
                            itemNumbers[i] = "";    //Mark as found by nulling it
                            break;
                        }
                    }
                }

                //Return a record for all unfound requests
                for (int i = 0; i < itemNumbers.Length; i++)
                {
                    if (itemNumbers[i].Length > 0)
                    {
                        items.Add(new TrackingItem(itemNumbers[i]));
                    }
                }
            }
            catch (Exception ex) { throw new FaultException <TrackingFault>(new TrackingFault(ex.Message), "Service Error"); }
            return(items);
        }
Example #2
0
        public TrackingItems TrackCartonsForBOL(string clientNumber, string BOLNumber)
        {
            //
            TrackingItems items = new TrackingItems();

            try {
                TrackingDataset cartons = new TrackingDataset();
                cartons.Merge(new EnterpriseRGateway().GetCartonsForBOL(clientNumber, BOLNumber));

                //Return records for all items
                foreach (TrackingDataset.TrackingTableRow carton in cartons.TrackingTable.Rows)
                {
                    TrackingItem item = new TrackingItem(carton.CTN, carton);
                    items.Add(item);
                }
            }
            catch (Exception ex) { throw new FaultException <TrackingFault>(new TrackingFault(ex.Message), "Service Error"); }
            return(items);
        }
Example #3
0
        public TrackingItems TrackPalletShipment(string shipmentNumber)
        {
            //
            TrackingItems items = new TrackingItems();

            try {
                TrackingDataset pallets = new TrackingDataset();
                pallets.Merge(new EnterpriseRGateway().TrackLTLPallets(shipmentNumber));

                //Return records for all found items
                foreach (TrackingDataset.TrackingTableRow pallet in pallets.TrackingTable.Rows)
                {
                    TrackingItem item = new TrackingItem(pallet.CTN, pallet);
                    items.Add(item);
                }
            }
            catch (Exception ex) { throw new FaultException <TrackingFault>(new TrackingFault(ex.Message), "Service Error"); }
            return(items);
        }
Example #4
0
    private void showItem(Argix.TrackingItem item)
    {
        //Display detail
        Argix.TrackingItems detail = new Argix.TrackingItems();
        Argix.TrackingItem  row    = null;
        if (item.PODScanDate.Trim().Length > 0)
        {
            row            = new Argix.TrackingItem();
            row.ItemNumber = item.ItemNumber;
            row.DateTime   = item.PODScanDate;
            row.Status     = item.PODScanStatus;
            row.Location   = item.PODScanLocation;
            detail.Add(row);
        }
        if (item.ActualStoreDeliveryDate.Trim().Length > 0)
        {
            row            = new Argix.TrackingItem();
            row.ItemNumber = item.ItemNumber;
            row.DateTime   = item.ActualStoreDeliveryDate;
            row.Status     = item.ActualStoreDeliveryStatus;
            row.Location   = item.ActualStoreDeliveryLocation;
            detail.Add(row);
        }
        if (item.ActualArrivalDate.Trim().Length > 0)
        {
            row            = new Argix.TrackingItem();
            row.ItemNumber = item.ItemNumber;
            row.DateTime   = item.ActualArrivalDate;
            row.Status     = item.ActualArrivalStatus;
            row.Location   = item.ActualArrivalLocation;
            detail.Add(row);
        }
        if (item.ActualDepartureDate.Trim().Length > 0)
        {
            row            = new Argix.TrackingItem();
            row.ItemNumber = item.ItemNumber;
            row.DateTime   = item.ActualDepartureDate;
            row.Status     = item.ActualDepartureStatus;
            row.Location   = item.ActualDepartureLocation;
            detail.Add(row);
        }
        if (item.SortFacilityArrivalDate.Trim().Length > 0)
        {
            row            = new Argix.TrackingItem();
            row.ItemNumber = item.ItemNumber;
            row.DateTime   = item.SortFacilityArrivalDate;
            row.Status     = item.SortFacilityArrivalStatus;
            row.Location   = item.SortFacilityLocation;
            detail.Add(row);
        }
        this.grdDetail.DataSource = detail;
        this.grdDetail.DataBind();

        //Display summary
        this.lblDetail_ID.Text    += item.ItemNumber;
        this.lblDetail_Status.Text = item.Status.ToString();
        this.lblDetailSum.Text     = "in " + item.Location + " on " + item.DateTime;
        this.lblFromInfo.Text      = item.VendorName;
        this.lblFromInfo.Text     += "\nPickup " + item.PickupDate;
        this.lblFromInfo.Text     += "\nBOL# " + item.BOLNumber;
        this.lblFromInfo.Text     += "\nLabel# " + item.LabelNumber + " on TL# " + item.TLNumber;
        this.lblToInfo.Text        = item.StoreName;
        this.lblToInfo.Text       += "\n" + item.StoreAddress1 + ", " + item.StoreAddress2;
        this.lblToInfo.Text       += "\n" + item.StoreCity + ", " + item.StoreState + " " + item.StoreZip;
        this.lblToInfo.Text       += "\nSigner: " + item.Signer;
        this.lbShipInfo.Text       = "Ship date: " + item.DateTime;
        this.lbShipInfo.Text      += "\nPieces: ";
        this.lbShipInfo.Text      += "\nTotal weight: " + item.Weight.ToString() + " lbs";
        this.lbShipInfo.Text      += "\n";
    }
Example #5
0
        public TrackingItems TrackCartons(string[] itemNumbers, string companyID)
        {
            //Get tracking information for the specified items and company
            TrackingItems items = null;

            //Get tracking response for the specified requests
            items = new TrackingItems();
            string numbers = "";

            for (int i = 0; i < itemNumbers.Length; i++)
            {
                if (i > 0)
                {
                    numbers += ",";
                }
                numbers += itemNumbers[i];
            }

            //Get tracking data response
            DataSet ds = new DataService().FillDataset(SQL_CONN, USP_BYCARTON, TBL_BYCARTON, new object[] { numbers, companyID, null });

            if (ds != null && ds.Tables[TBL_BYCARTON].Rows.Count > 0)
            {
                TrackingDS cartons = new TrackingDS();
                DataView   view    = ds.Tables[TBL_BYCARTON].DefaultView;
                view.Sort = "CTN,BL DESC,SCNTP DESC,SCD DESC,SCT DESC";
                DataTable dt = view.Table.Clone();
                Hashtable ht = new Hashtable();
                for (int i = 0; i < view.Count; i++)
                {
                    string key = view[i]["CTN"].ToString().Trim() + view[i]["BL"].ToString().Trim();
                    if (!ht.ContainsKey(key))
                    {
                        ht.Add(key, null);
                        dt.ImportRow(view[i].Row);
                    }
                }
                cartons.TrackingTable.Merge(dt);

                //Return records for all found items
                foreach (TrackingDS.TrackingTableRow carton in cartons.TrackingTable.Rows)
                {
                    //Keep the response item if it matches a requested item
                    for (int i = 0; i < itemNumbers.Length; i++)
                    {
                        if (carton.CTN.Trim() == itemNumbers[i])
                        {
                            //Keep it
                            TrackingItem item = new TrackingItem(itemNumbers[i], carton);
                            items.Add(item);
                            itemNumbers[i] = "";    //Mark as found by nulling it
                            break;
                        }
                    }
                }

                //Return a record for all unfound requests
                for (int i = 0; i < itemNumbers.Length; i++)
                {
                    if (itemNumbers[i].Length > 0)
                    {
                        items.Add(new TrackingItem(itemNumbers[i]));
                    }
                }
            }
            return(items);
        }
Example #6
0
        public TrackingItems TrackCartons(string[] itemNumbers, string companyID)
        {
            //Get tracking information for the specified items and company
            TrackingItems items = null;

            try {
                //Get tracking response for the specified requests
                items = new TrackingItems();
                string numbers = "";
                for (int i = 0; i < itemNumbers.Length; i++)
                {
                    if (i > 0)
                    {
                        numbers += ",";
                    }
                    numbers += itemNumbers[i];
                }

                //Get tracking data response
                TrackingDataset _cartons = new TrackingDataset();
                _cartons.Merge(new EnterpriseRGateway().GetCartonsByCartonNumber(numbers, companyID, null));
                if (_cartons.TrackingTable.Rows.Count > 0)
                {
                    TrackingDataset cartons = new TrackingDataset();
                    DataView        view    = _cartons.TrackingTable.DefaultView;
                    view.Sort = "CTN,BL DESC,SCNTP DESC,SCD DESC,SCT DESC";
                    DataTable dt = view.Table.Clone();
                    Hashtable ht = new Hashtable();
                    for (int i = 0; i < view.Count; i++)
                    {
                        string key = view[i]["CTN"].ToString().Trim() + view[i]["BL"].ToString().Trim();
                        if (!ht.ContainsKey(key))
                        {
                            ht.Add(key, null);
                            dt.ImportRow(view[i].Row);
                        }
                    }
                    cartons.TrackingTable.Merge(dt);

                    //Return records for all found items
                    foreach (TrackingDataset.TrackingTableRow carton in cartons.TrackingTable.Rows)
                    {
                        //Keep the response item if it matches a requested item
                        for (int i = 0; i < itemNumbers.Length; i++)
                        {
                            if (carton.CTN.Trim() == itemNumbers[i])
                            {
                                //Keep it
                                TrackingItem item = new TrackingItem(itemNumbers[i], carton);
                                items.Add(item);
                                itemNumbers[i] = "";    //Mark as found by nulling it
                                break;
                            }
                        }
                    }

                    //Return a record for all unfound requests
                    for (int i = 0; i < itemNumbers.Length; i++)
                    {
                        if (itemNumbers[i].Length > 0)
                        {
                            items.Add(new TrackingItem(itemNumbers[i]));
                        }
                    }
                }
            }
            catch (Exception ex) { throw new FaultException <TrackingFault>(new TrackingFault(ex.Message), "Service Error"); }
            return(items);
        }