Пример #1
0
        public static Brain CreateBrain(SortProfile sortProfile)
        {
            //Create a station operator brain for the given sort type
            Brain brain = null;

            if (sortProfile == null)
            {
                brain = new EmptyBrain();
            }
            else
            {
                switch (sortProfile.SortTypeID)
                {
                case 1: brain = new SANBrain(); break;

                case 2: brain = new RegularBrain(); break;

                case 14: brain = new ManifestXStoreBrain(); break;

                case 18: brain = new MultiManifestXStoreBrain(); break;

                default: brain = new EmptyBrain(); break;
                }
            }
            return(brain);
        }
Пример #2
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);
        }
Пример #3
0
        public static SortProfile CreateSortProfile(InboundFreight shipment, int sortTypeID, string sortType, int labelID, int excLocation)
        {
            //Create a sort profile for the specified freight based upon its' type (i.e. Tsort, Returns),
            //the client/shipper relationship, and how it was scheduled by Freight Assign to be sorted (i.e. San, Regular, SKU, etc)
            SortProfile sortProfile = null;

            try {
                //The freight type of the shipment determines whether a regular or returns profile is needed
                //Create a sort profile that specifies freight type, sort type, and inbound label
                SortProfileDS sortProfileDS = new SortProfileDS();
                SortProfileDS.SortProfileTableRow profile = sortProfileDS.SortProfileTable.NewSortProfileTableRow();
                sortProfileDS.EnforceConstraints = false;
                profile.FreightType              = shipment.FreightType;
                profile.SortTypeID               = sortTypeID;
                profile.SortType                 = sortType;
                profile.ClientNumber             = shipment.Client.Number;
                profile.ClientDivision           = shipment.Client.Division;
                profile.VendorNumber             = shipment.Shipper.NUMBER;
                profile.Status                   = "";
                profile.LabelID                  = labelID;
                profile.ExceptionLocation        = excLocation;
                sortProfileDS.EnforceConstraints = true;
                sortProfile = new SortProfile(profile);
            }
            catch (ApplicationException ex) { throw ex; }
            catch (Exception ex) { throw new ApplicationException("Unexpected exception creating sort profile.", ex); }
            return(sortProfile);
        }
Пример #4
0
 public StationAssignment(string assignmentID, Workstation sortStation, InboundFreight inboundFreight, SortProfile sortProfile)
 {
     //Constructor
     try {
         //Configure this assignment from the assignment configuration information
         this.mAssignmentID = assignmentID;
         this.mStation      = sortStation;
         this.mFreight      = inboundFreight;
         this.mProfile      = sortProfile;
     }
     catch (Exception ex) { throw new ApplicationException("Unexpected error while creating new Station Assignment instance.", ex); }
 }