Exemplo n.º 1
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); }
        }
Exemplo n.º 2
0
 public void StartWork()
 {
     //
     try {
         //Apply configuration parameters and update object model
         FreightFactory.DefaultIBLabelID = AppLib.Config.IBLabelDefault;
         Brain.UPSAllowed                = AppLib.Config.UPSAllowed;
         Brain.ShipOverride              = AppLib.Config.ShipOverride;
         SortedItems.MaxItems            = AppLib.Config.SortedItemsLength;
         SortedItems.DuplicateCheckCount = AppLib.Config.SortedItemsCheckDuplicatesLength;
         this.mSortedItems               = new SortedItems();
         SortedItem.WeightMax            = AppLib.Config.WeightMax;
         SortedItem.LanePrefix           = AppLib.Config.LanePrefix;
         this.mErrorLabelNumber          = AppLib.Config.OBLabelError;
         //this.mStation = SortFactory.CreateWorkstation(Environment.MachineName);
         SortedItem.ErrorLabelTemplate = SortFactory.CreateOBLabelTemplate(this.mErrorLabelNumber, this.Station.PrinterType);
         this.mOperatorWorking         = true;
         RefreshCache();
     }
     catch (ApplicationException ex) { throw ex; }
     catch (Exception ex) { throw new ApplicationException("Unexpected error when starting Station Operator.", ex); }
 }