Ejemplo n.º 1
0
        public override DataSet ToDataSet()
        {
            //Return a dataset containing values for this terminal
            InboundFreightDS ds = null;

            try {
                ds = new InboundFreightDS();
                InboundFreightDS.DirectInboundFreightTableRow shipment = ds.DirectInboundFreightTable.NewDirectInboundFreightTableRow();
                shipment.FreightID            = base.mFreightID;
                shipment.TerminalID           = base.mTerminalID;
                shipment.FreightType          = this.mFreightType;
                shipment.CurrentLocation      = this.mCurrentLocation;
                shipment.TDSNumber            = this.mTDSNumber;
                shipment.TrailerNumber        = base.mTrailerNumber;
                shipment.StorageTrailerNumber = this.mStorageTrailerNumber;
                if (this.mClient != null)
                {
                    shipment.ClientNumber = this.mClient.Number;
                }
                if (this.mClient != null)
                {
                    shipment.ClientName = this.mClient.Name;
                }
                if (this.mShipper != null)
                {
                    shipment.ShipperNumber = this.mShipper.NUMBER;
                }
                if (this.mShipper != null)
                {
                    shipment.ShipperName = this.mShipper.NAME;
                }
                shipment.PickupDate     = this.mPickupDate;
                shipment.PickupNumber   = this.mPickupNumber;
                shipment.Status         = this.mStatus;
                shipment.Cartons        = base.mCartonCount;
                shipment.Pallets        = this.mPallets;
                shipment.CarrierNumber  = int.Parse(base.mCarrier);
                shipment.DriverNumber   = this.mDriverNumber;
                shipment.FloorStatus    = this.mFloorStatus;
                shipment.SealNumber     = this.mSealNumber;
                shipment.UnloadedStatus = this.mUnloadedStatus;
                shipment.VendorKey      = this.mVendorKey;
                shipment.ReceiveDate    = this.mReceiveDate;
                shipment.CubeRatio      = this.mCubeRatio;
                ds.DirectInboundFreightTable.AddDirectInboundFreightTableRow(shipment);
                if (this.mClient != null)
                {
                    ds.Merge(this.mClient.ToDataSet());
                }
                if (this.mShipper != null)
                {
                    ds.Merge(this.mShipper.ToDataSet());
                }
                ds.AcceptChanges();
            }
            catch (Exception) { }
            return(ds);
        }
Ejemplo n.º 2
0
 //Interface
 public DirectInboundFreight(InboundFreightDS.DirectInboundFreightTableRow shipment, Client client, Shipper shipper)
 {
     //Constructor
     try {
         if (shipment != null)
         {
             if (!shipment.IsFreightIDNull())
             {
                 base.mFreightID = shipment.FreightID.Trim();
             }
             if (!shipment.IsTerminalIDNull())
             {
                 base.mTerminalID = shipment.TerminalID;
             }
             if (!shipment.IsFreightTypeNull())
             {
                 this.mFreightType = shipment.FreightType.Trim();
             }
             if (!shipment.IsCurrentLocationNull())
             {
                 this.mCurrentLocation = shipment.CurrentLocation.Trim();
             }
             if (!shipment.IsTDSNumberNull())
             {
                 this.mTDSNumber = shipment.TDSNumber;
             }
             if (!shipment.IsTrailerNumberNull())
             {
                 base.mTrailerNumber = shipment.TrailerNumber.Trim();
             }
             if (!shipment.IsStorageTrailerNumberNull())
             {
                 this.mStorageTrailerNumber = shipment.StorageTrailerNumber.Trim();
             }
             if (!shipment.IsPickupDateNull())
             {
                 this.mPickupDate = shipment.PickupDate.Trim();
             }
             if (!shipment.IsPickupNumberNull())
             {
                 this.mPickupNumber = shipment.PickupNumber.Trim();
             }
             if (!shipment.IsStatusNull())
             {
                 this.mStatus = shipment.Status.Trim();
             }
             if (!shipment.IsCartonsNull())
             {
                 base.mCartonCount = shipment.Cartons;
             }
             if (!shipment.IsPalletsNull())
             {
                 this.mPallets = shipment.Pallets;
             }
             if (!shipment.IsCarrierNumberNull())
             {
                 base.mCarrier = shipment.CarrierNumber.ToString().Trim();
             }
             if (!shipment.IsDriverNumberNull())
             {
                 this.mDriverNumber = shipment.DriverNumber;
             }
             if (!shipment.IsFloorStatusNull())
             {
                 this.mFloorStatus = shipment.FloorStatus.Trim();
             }
             if (!shipment.IsSealNumberNull())
             {
                 this.mSealNumber = shipment.SealNumber.Trim();
             }
             if (!shipment.IsUnloadedStatusNull())
             {
                 this.mUnloadedStatus = shipment.UnloadedStatus.Trim();
             }
             if (!shipment.IsVendorKeyNull())
             {
                 this.mVendorKey = shipment.VendorKey.Trim();
             }
             if (!shipment.IsReceiveDateNull())
             {
                 this.mReceiveDate = shipment.ReceiveDate.Trim();
             }
             if (!shipment.IsCubeRatioNull())
             {
                 this.mCubeRatio = shipment.CubeRatio;
             }
         }
         this.mClient  = client;
         this.mShipper = shipper;
     }
     catch (Exception ex) { throw new ApplicationException("Unexpected error while creating new inbound shipment instance.", ex); }
 }