Beispiel #1
0
        public static StationAssignments GetStationAssignments(Workstation workstation)
        {
            //Return a collection of current freight assignments for the specified workstation
            StationAssignments assignments = null;

            try {
                if (workstation == null)
                {
                    throw new ApplicationException("Workstation is null.");
                }

                assignments = new StationAssignments();
                StationAssignmentDS dsAssignments = new StationAssignmentDS();
                dsAssignments.Merge(Mediator.FillDataset(USP_FREIGHTCLIENTSHIPPER, TBL_FREIGHTCLIENTSHIPPER, new object[] { workstation.WorkStationID }));
                foreach (StationAssignmentDS.FreightClientShipperTableRow row in dsAssignments.FreightClientShipperTable)
                {
                    Client         client   = EnterpriseFactory.CreateClient(row.ClientNumber, row.ClientDivision, row.Client, row.ClientAddressLine1, row.ClientAddressLine2, row.ClientAddressCity, row.ClientAddressState, row.ClientAddressZip);
                    Shipper        shipper  = EnterpriseFactory.CreateShipper(row.FreightType, row.ShipperNumber, row.Shipper, row.ShipperAddressLine1, row.ShipperAddressLine2, row.ShipperAddressCity, row.ShipperAddressState, row.ShipperAddressZip, row.ShipperUserData);
                    InboundFreight shipment = FreightFactory.CreateInboundFreight(row.TerminalID, row.FreightID, row.FreightType, row.TDSNumber, row.VendorKey, row.TrailerNumber, row.PickupDate, row.PickupNumber, row.CubeRatio, client, shipper);
                    SortProfile    profile  = CreateSortProfile(shipment, row.SortTypeID, row.SortType, row.LabelID, row.ExcLocation);
                    assignments.Add(new StationAssignment("", workstation, shipment, profile));
                }
            }
            catch (ApplicationException ex) { throw ex; }
            catch (Exception ex) { throw new ApplicationException("Unexpected error while getting station assignments (freight-client-shipper).", ex); }
            return(assignments);
        }
Beispiel #2
0
        public DataSet ToDataSet()
        {
            //Custom ToString() method
            StationAssignmentDS ds = null;

            try {
                //
                ds = new StationAssignmentDS();
                for (int i = 0; i < base.InnerList.Count; i++)
                {
                    StationAssignment a = (StationAssignment)base.InnerList[i];
                    ds.Merge(a.ToDataSet());
                }
            }
            catch (Exception) { }
            return(ds);
        }
Beispiel #3
0
        public static StationAssignmentDS GetFreightAssignments(string worhstationID)
        {
            //Get a view of TLs for the specified terminal
            StationAssignmentDS assignments = null;

            try {
                assignments = new StationAssignmentDS();
                DataSet ds = _Client.GetFreightAssignments(worhstationID);
                if (ds != null)
                {
                    assignments.Merge(ds);
                }
            }
            catch (TimeoutException te) { _Client.Abort(); }
            catch (System.ServiceModel.CommunicationException ce) { _Client.Abort(); }
            return(assignments);
        }
Beispiel #4
0
        public DataSet ToDataSet()
        {
            //Return a dataset containing values for this object
            StationAssignmentDS ds = null;

            try {
                ds = new StationAssignmentDS();
                StationAssignmentDS.FreightClientShipperTableRow assignment = ds.FreightClientShipperTable.NewFreightClientShipperTableRow();
                assignment.StationNumber       = this.mStation.Number;
                assignment.WorkStationID       = this.mStation.WorkStationID;
                assignment.SortTypeID          = this.SortProfile.SortTypeID;
                assignment.FreightID           = this.mFreight.FreightID;
                assignment.SortType            = this.SortProfile.SortType;
                assignment.FreightType         = this.mFreight.FreightType;
                assignment.TerminalID          = this.mStation.TerminalID;
                assignment.TDSNumber           = this.mFreight.TDSNumber;
                assignment.TrailerNumber       = this.mFreight.TrailerNumber;
                assignment.VendorKey           = this.mFreight.VendorKey;
                assignment.ClientNumber        = this.mFreight.Client.Number;
                assignment.ClientDivision      = this.mFreight.Client.Division;
                assignment.PickupDate          = this.mFreight.PickupDate;
                assignment.PickupNumber        = this.mFreight.PickupNumber;
                assignment.Client              = this.mFreight.Client.Name;
                assignment.ClientAddressLine1  = this.mFreight.Client.AddressLine1;
                assignment.ClientAddressLine2  = this.mFreight.Client.AddressLine2;
                assignment.ClientAddressCity   = this.mFreight.Client.City;
                assignment.ClientAddressState  = this.mFreight.Client.State;
                assignment.ClientAddressZip    = this.mFreight.Client.ZIP;
                assignment.CubeRatio           = 0.0m;
                assignment.ShipperNumber       = this.mFreight.Shipper.NUMBER;
                assignment.Shipper             = this.mFreight.Shipper.NAME;
                assignment.ShipperAddressLine1 = this.mFreight.Shipper.ADDRESS_LINE1;
                assignment.ShipperAddressLine2 = this.mFreight.Shipper.ADDRESS_LINE2;
                assignment.ShipperAddressCity  = this.mFreight.Shipper.CITY;
                assignment.ShipperAddressZip   = this.mFreight.Shipper.ZIP;
                assignment.ShipperAddressState = this.mFreight.Shipper.STATE;
                assignment.LabelID             = this.mProfile.LabelID;
                assignment.ExcLocation         = this.mProfile.ExceptionLocation;
                ds.FreightClientShipperTable.AddFreightClientShipperTableRow(assignment);
                ds.AcceptChanges();
            }
            catch (Exception) { }
            return(ds);
        }
Beispiel #5
0
 public void RefreshIndirectAssignments()
 {
     //Load trip assignments
     try {
         this.mIndirectAssignments.Clear();
         StationAssignmentDS assignments = new StationAssignmentDS();
         assignments.Merge(this.mMediator.FillDataset(App.USP_INDIRECTASSIGNMENTS, App.TBL_INDIRECTASSIGNMENTS, null));
         foreach (StationAssignmentDS.IndirectAssignmentTableRow row in assignments.IndirectAssignmentTable)
         {
             SortStation    station = EnterpriseFactory.GetStation(row.StationNumber);
             InboundFreight freight = FreightFactory.CreateInboundFreight(0, row.TripNumber, "", "", 0);
             this.mIndirectAssignments.Add(station.Number + freight.FreightID, new StationFreightAssignment(station, freight, ""));
         }
     }
     catch (Exception ex) { throw ex; }
     finally { if (IndirectAssignmentsChanged != null)
               {
                   IndirectAssignmentsChanged(this, EventArgs.Empty);
               }
     }
 }
Beispiel #6
0
 public void RefreshDirectAssignments()
 {
     //Load direct freight assignments
     try {
         this.mDirectAssignments.Clear();
         StationAssignmentDS assignments = new StationAssignmentDS();
         assignments.Merge(this.mMediator.FillDataset(App.USP_DIRECTASSIGNMENTS, App.TBL_DIRECTASSIGNMENTS, null));
         foreach (StationAssignmentDS.DirectAssignmentTableRow row in assignments.DirectAssignmentTable)
         {
             SortStation    station = EnterpriseFactory.GetStation(row.StationNumber);
             Client         client  = EnterpriseFactory.CreateClient(row.ClientNumber, row.ClientDivision, row.Client, "", "", "", "", "");
             Shipper        shipper = EnterpriseFactory.CreateShipper(row.FreightType, row.ShipperNumber, row.Shipper, "", "", "", "", "", "");
             InboundFreight freight = FreightFactory.CreateInboundFreight(row.TerminalID, row.FreightID, row.FreightType, row.TDSNumber, "", row.TrailerNumber, row.Pickup, row.Pickup, 0, client, shipper);
             this.mDirectAssignments.Add(station.Number + freight.FreightID, new StationFreightAssignment(station, freight, row.SortType));
         }
     }
     catch (Exception ex) { throw ex; }
     finally { if (DirectAssignmentsChanged != null)
               {
                   DirectAssignmentsChanged(this, EventArgs.Empty);
               }
     }
 }