Example #1
0
        public static BearwareTrip GetTripAssignment(string stationNumber)
        {
            //Get the trip assigned to the specified station
            BearwareTrip trip = null;

            try {
                DataSet ds = App.Mediator.FillDataset(USP_TRIP_ASSIGNMENT, TBL_TRIP_ASSIGNMENT, new object[] { stationNumber });
                if (ds.Tables[TBL_TRIP_ASSIGNMENT].Rows.Count == 0)
                {
                    throw new ApplicationException("There are no trips assigned to station " + stationNumber + ".");
                }
                else if (ds.Tables[TBL_TRIP_ASSIGNMENT].Rows.Count > 0)
                {
                    BearwareDS dsAssignment = new BearwareDS();
                    dsAssignment.Merge(ds);
                    BearwareDS.BwareTripTableRow row = (BearwareDS.BwareTripTableRow)dsAssignment.BwareTripTable.Rows[0];
                    trip               = new BearwareTrip();
                    trip.Number        = row.Number.TrimEnd();
                    trip.CartonCount   = row.IsCartonCountNull() ? 0 : row.CartonCount;
                    trip.Carrier       = row.IsCarrierNull() ? "" : row.Carrier.TrimEnd();
                    trip.TrailerNumber = row.IsTrailerNumberNull() ? "" : row.TrailerNumber.TrimEnd();
                }
            }
            catch (Exception ex) { throw new ApplicationException("Unexpected error reading trip assignments for station " + stationNumber + ".", ex); }
            return(trip);
        }
Example #2
0
        public DataSet ToDataSet()
        {
            //Return a dataset containing values for this object
            BearwareDS ds = null;

            try {
                ds = new BearwareDS();
                ds.Merge(this.mStation.ToDataSet());
                ds.Merge(this.mFreight.ToDataSet());
                ds.AcceptChanges();
            }
            catch (Exception) { }
            return(ds);
        }
Example #3
0
        public DataSet ToDataSet()
        {
            //Return a dataset containing values for this terminal
            BearwareDS ds = null;

            try {
                ds = new BearwareDS();
                BearwareDS.BwareTripTableRow trip = ds.BwareTripTable.NewBwareTripTableRow();
                trip.Number        = this.mNumber;
                trip.CartonCount   = this.mCartonCount;
                trip.Carrier       = this.mCarrier;
                trip.TrailerNumber = this.mTrailerNumber;
                if (this.mStarted != Convert.ToDateTime(null))
                {
                    trip.Started = this.mStarted;
                }
                if (this.mExported != Convert.ToDateTime(null))
                {
                    trip.Exported = this.mExported;
                }
                if (this.mStopped != Convert.ToDateTime(null))
                {
                    trip.Stopped = this.mStopped;
                }
                if (this.mImported != Convert.ToDateTime(null))
                {
                    trip.Imported = this.mImported;
                }
                if (this.mScanned != Convert.ToDateTime(null))
                {
                    trip.Scanned = this.mScanned;
                }
                if (this.mOSDSend != Convert.ToDateTime(null))
                {
                    trip.OSDSend = this.mOSDSend;
                }
                if (this.mReceived != Convert.ToDateTime(null))
                {
                    trip.Received = this.mReceived;
                }
                if (this.mCartonsExported != -1)
                {
                    trip.CartonsExported = this.mCartonsExported;
                }
                ds.BwareTripTable.AddBwareTripTableRow(trip);
            }
            catch (Exception) { }
            return(ds);
        }
Example #4
0
 //Interface
 static FreightFactory()
 {
     _InboundFreight = new BearwareDS();
     _Assignments    = new BearwareDS();
 }