Esempio n. 1
0
 public TrackingStoreCarton(TrackingDataSet.CartonDetailForStoreTableRow carton)
 {
     this.mCartonNumber = carton.CartonNo;
     this.mWeight       = carton.Weight;
     if (!carton.IsPudtNull())
     {
         this.mPickupDate = carton.Pudt;
     }
     this.mShipperName = carton.ShpName;
     if (!carton.IsCtnStsNull())
     {
         this.mCartonStatus = carton.CtnSts;
     }
     if (!carton.IsScnStsNull())
     {
         this.mScanStatus = carton.ScnSts;
     }
     if (!carton.IsPodDateNull())
     {
         this.mPODDate = carton.PodDate;
     }
     if (!carton.IsPodDateNull())
     {
         this.mPODTime = carton.PodTime;
     }
 }
Esempio n. 2
0
 public TrackingStoreTL(TrackingDataSet.CartonDetailForStoreTableRow tl)
 {
     this.mTL      = tl.TL;
     this.mCartons = tl.CartonCount;
     this.mWeight  = tl.Weight;
     this.mCBOL    = tl.CBOL;
     if (!tl.IsOFD1Null())
     {
         this.mOFD = tl.OFD1;
     }
     if (!tl.IsPodDateNull())
     {
         this.mPOD = tl.PodDate;
     }
     this.mAgentNumber = tl.AG;
     this.mAgentName   = tl.AgName;
 }
Esempio n. 3
0
        public TrackingDataSet TrackCartonsForStoreSummary(string clientID, string storeNumber, DateTime from, DateTime to, string by)
        {
            //Get TL summary
            TrackingDataSet       tlSummary = new TrackingDataSet();
            TrackingServiceClient client    = null;

            try {
                client = new TrackingServiceClient();
                DataSet ds = null;
                if (by.ToLower() == "delivery")
                {
                    ds = client.TrackCartonsForStoreByDeliveryDate(clientID, storeNumber, from, to, null);
                }
                else
                {
                    ds = client.TrackCartonsForStoreByPickupDate(clientID, storeNumber, from, to, null);
                }
                client.Close();

                //Snag the carton detail
                TrackingDataSet detail = new TrackingDataSet();
                if (ds.Tables["CartonDetailForStoreTable"] != null && ds.Tables["CartonDetailForStoreTable"].Rows.Count > 0)
                {
                    detail.Merge(ds, true, MissingSchemaAction.Ignore);
                }

                //Build a summary by TL; start with a dataset of unique
                TrackingDataSet tls = new TrackingDataSet();
                tls.Merge(detail.CartonDetailForStoreTable.DefaultView.ToTable(true, new string[] { "TL" }));
                foreach (TrackingDataSet.CartonDetailForStoreTableRow tl in tls.CartonDetailForStoreTable.Rows)
                {
                    //Get one of the cartons from this TL group
                    TrackingDataSet.CartonDetailForStoreTableRow tlCarton0 = (TrackingDataSet.CartonDetailForStoreTableRow)(detail.CartonDetailForStoreTable.Select("TL='" + tl.TL + "'", "TL ASC"))[0];

                    tl.Store       = tlCarton0.Store;
                    tl.CartonCount = detail.CartonDetailForStoreTable.Select("TL='" + tl.TL + "'").Length;
                    tl.Weight      = int.Parse(detail.CartonDetailForStoreTable.Compute("Sum(weight)", "TL='" + tl.TL + "'").ToString());
                    tl.CBOL        = tlCarton0.IsCBOLNull() ? "" : tlCarton0.CBOL;
                    object minDate = detail.CartonDetailForStoreTable.Compute("Min(PodDate)", "TL='" + tl.TL + "' AND (IsNull(PodDate,#01/01/1900#) <> #01/01/1900#)");
                    if (minDate != System.DBNull.Value)
                    {
                        tl.PodDate = DateTime.Parse(minDate.ToString());
                    }
                    else
                    {
                        if (!tlCarton0.IsOFD1Null())
                        {
                            tl.OFD1 = tlCarton0.OFD1;
                        }
                    }
                    tl.AG     = !tlCarton0.IsAGNull() ? tlCarton0.AG : "";
                    tl.AgName = tlCarton0.Trf == "N" ? tlCarton0.AgName : tlCarton0.AgName + " (Transfer)";
                    tl.AcceptChanges();
                }
                tlSummary.Merge(tls);
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <TrackingFault> tfe) { client.Abort(); throw new ApplicationException(tfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(tlSummary);
        }