Esempio n. 1
0
        public void RefreshStationAssignments()
        {
            //Refresh current station assignments
            try {
                //Validate operator state
                if (!this.mOperatorWorking)
                {
                    throw new ApplicationException("Station Operator not started for work; call StartWork() before RefreshStationAssignments().");
                }

                //Clear assignment info
                SortFactory.CreateBrain(null);
                this.mAssignments.Clear();

                //Refresh station assignments; select first assignment as current and select the appropriate Brain
                this.mAssignments = SortFactory.GetStationAssignments(this.mStation);
                ArgixTrace.WriteLine(new TraceMessage("Assignments changed... " + this.mAssignments.Count.ToString() + " new assignments...", AppLib.EVENTLOGNAME, LogLevel.Warning, "SortOperator"));
                if (this.mAssignments.Count > 0)
                {
                    this.mBrain         = SortFactory.CreateBrain(this.mAssignments.Item(0).SortProfile);
                    CurrentInboundLabel = this.mAssignments.Item(0).SortProfile.InboundLabel;
                }
            }
            catch (ApplicationException ex) { throw ex; }
            catch (Exception ex) { throw new ApplicationException("Unexpected error while refreshing station assignments.", ex); }
            finally { if (this.StationAssignmentsChanged != null)
                      {
                          this.StationAssignmentsChanged(this, EventArgs.Empty);
                      }
            }
        }
Esempio n. 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);
        }
Esempio n. 3
0
        internal StationAssignments PreviewStationAssignments()
        {
            //Preview upcoming freight assignments
            StationAssignments assignments = null;

            try {
                assignments = null;                     //SortFactory.PreviewStationAssignments(this.mStation);
            }
            catch (ApplicationException ex) { throw ex; }
            catch (Exception ex) { throw new ApplicationException("Unexpected error while previewing assignments.", ex); }
            return(assignments);
        }
Esempio n. 4
0
        public StationOperator(string connectionString, bool useConnectionState)
        {
            //Constructor - this is done for dll purposes, NEED to think more, maybe move to config file, but will need dll start up
            try {
                //Init this object
                Config._ConnectionString          = connectionString;
                Config._WebSvcUrl                 = "";
                Config._UseWebSvc                 = false;
                Config._UseConnState              = useConnectionState;
                AppLib.Mediator.DataStatusUpdate += new DataStatusHandler(OnDataStatusUpdate);
                EnterpriseFactory.Mediator        = FreightFactory.Mediator = SortFactory.Mediator = AppLib.Mediator;

                Brain.Self  = this;
                this.mBrain = SortFactory.CreateBrain(null);
                //this.mStation = SortFactory.CreateWorkstation("");
                this.mStation     = SortFactory.CreateWorkstation(Environment.MachineName);
                this.mAssignments = new StationAssignments();
                this.mSortedItems = new SortedItems();
                this.mSetup       = new dlgStationSetup(dlgStationSetup.SCALETYPE_AUTOMATIC);
            }
            catch (Exception ex) { throw new ApplicationException("Unexpected error while creating Station Operator instance.", ex); }
        }