Пример #1
0
        //# __________ PROTOCOL :: PUBLIC __________ #//
        public VmItemManifest AddItem(
            VmTag tag,
            int itemManifestFileIndex,
            int nestId,
            double kilograms)
        {
            lock( this )
            {
                String tagValue = tag.Value;
                VmItemManifest im = new VmItemManifest();
                im.TagValue     = tag.Value;
                im.ItemId       = VmAirportData.Default.AirportOutputData.IdentityFile.GetNextIdentity();
                im.NestId       = nestId;
                im.Kilograms    = kilograms;
                im.FirstTouchTimestamp = JwTimestamp.CreateNowUtc();
                VmAirportData.Default.AirportOutputData.ItemManifestFile.InsertAt(im, itemManifestFileIndex);

                VmItemReverseManifest rim = new VmItemReverseManifest();
                rim.ItemId = im.ItemId;
                rim.TagValue = im.TagValue;
                VmAirportData.Default.AirportOutputData.ItemReverseManifestFile.InsertWhereAppropriate(rim.ItemId+"", rim);

                return im;
            }
        }
Пример #2
0
 public bool HandleItemInput(VmTag tag)
 {
     if( tag.IsUnknown() )
     {
         VmApplication.Default.ShowNotification(
             VmLanguage.Default.GetInvalidTag());
         _subpanel.FocusUponTag();
         return false;
     }
     Engine.RecordDelegate(tag);
     return true;
 }
Пример #3
0
 public bool HandleItemInput(VmTag tag)
 {
     if( tag.IsUnknown() )
     {
         VmApplication.Default.ShowNotification(
             VmLanguage.Default.GetInvalidTag());
         _subpanel.FocusUponTag();
         return false;
     }
     PickerEngine.Nest =
         VmNestManager.Default.GetDelegate(tag.Value);
     return true;
 }
Пример #4
0
        public override void Handle(VmTag tag)
        {
            MakeNewScan();

            /*
            VmItemManager.Default.Tag = tag;

            if( tag.IsUnknown() )
                MakeInvalid();
            else if( NeedsDestinationFiltering(tag) )
                MakeRequiresConsolidation();
            else if( HandleValidScan(tag) )
                MakeNewScan();
            else
                MakeDuplicate();
            */
        }
Пример #5
0
 public String GetRouteIndexMapping(VmTag tag)
 {
     VmDistributionAndRoutingTagParser dAndRParser = new VmDistributionAndRoutingTagParser(tag.Value);
     String routeIndexNumber = dAndRParser.GetNationalRoutingIndex();
     return GetRouteIndexMapping(routeIndexNumber);
 }
Пример #6
0
 //# __________ PROTOCOL :: FRAMEWORK __________ #//
 public abstract void Handle(VmTag tag);
Пример #7
0
 public JwDate InferTagDate(VmTag tag)
 {
     VmDistributionAndRoutingTagParser dAndR = new VmDistributionAndRoutingTagParser(tag.Value);
     int dayOfMonthIndex = dAndR.GetDayOfMonth();
     return InferTagDate(dayOfMonthIndex);
 }
Пример #8
0
 //# __________ PROTOCOL :: PUBLIC __________ #//
 public void ShowFirstPanel()
 {
     Tag = null;
     ShowRecordItemPanel();
 }
Пример #9
0
 // deprecated in favor of getDelegate
 public VmNest LazyGetDelegate(VmTag tag)
 {
     return GetDelegate(tag.Value);
 }
Пример #10
0
 //# __________ PROTOCOL :: PRIVATE __________ #//
 public void Show(
     bool tagIsDuplicate,
     VmTag tag,
     VmNest nest,
     VmItemEventStatistics itemStatistics,
     VmAliasEventStatistics aliasStatistics)
 {
     _tagSubpanel.ShowTag(tagIsDuplicate, tag);
     if( ShowNestFlag ) ShowNest(nest);
     if( ShowStatisticsFlag ) ShowStatistics(itemStatistics, aliasStatistics);
 }
Пример #11
0
 //# __________ PROTOCOL :: INTERFACE (VmScanPanelIF) __________ #//
 /*
 public bool HandleKeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
 {
     return _tagSubpanel.HandleScanFromKeyPress(sender, e);
 }
 */
 public void HandleScan(VmTag tag)
 {
     _model.Tag = tag;
     _parentPanel.HandleScan(tag);
 }
Пример #12
0
 //# __________ PROTOCOL :: PUBLIC __________ #//
 public VmLocationToDestinationMappingResult GetLocationByDispatchDestination(VmTag tag)
 {
     if( tag.IsUpu() )
     {
         VmS9TagParser s9 = new VmS9TagParser(tag.Value);
         return UpuDispatchDestinationMapping.GetMappedLocationCode(
             s9.GetDestinationCountryCode(),
             s9.GetDestinationLocationCode(),
             s9.GetDestinationOfficeOfExchangeQualifier());
     }
     else if( tag.IsJourneyId() )
     {
         VmJourneyIdParser journeyId = new VmJourneyIdParser(tag.Value);
         return UpuDispatchDestinationMapping.GetMappedLocationCode(
             null,
             journeyId.GetDestinationAirportCode(),
             null);
     }
     else if( tag.IsUsDomestic() )
     {
         String locationCode = (VmProperties.Default.ShouldUsePlannedRouteTransferAirportAsDestination() )
             ? tag.TransferLocation
             : tag.DestinationAirportCode;
         return new VmLocationToDestinationMappingResult(locationCode);
     }
     else
     {
         return new VmLocationToDestinationMappingResult(tag.DestinationAirportCode);
     }
 }
Пример #13
0
 //# __________ PROTOCOL :: PANELS __________ #//
 public void ShowFirstPanel(VmTag tag)
 {
     Tag = tag;
     if( tag.IsUsDomestic() && tag.HasUnknownTransferLocation() )
     {
         String locationCode = GetRouteIndexMapping(tag);
         if( locationCode == null )
         {
             ShowChooseDestinationPanel();
             return;
         }
         tag.TransferLocation = locationCode;
         tag.DestinationAirportCode = locationCode;
     }
     ShowFirstPanel();
 }
Пример #14
0
        public void Prepare(VmTag tag)
        {
            DestinationAirportCode = (VmProperties.Default.ShouldUsePlannedRouteTransferAirportAsDestination())
                ? tag.TransferLocation
                : tag.DestinationAirportCode;
            DestinationMappingResult =
                VmAirportData.Default.GetLocationByDispatchDestination(tag);
            AliasedAirportCode = DestinationMappingResult.LocationCode;

            if( _destinationConsolidator.ShouldUseImpromptuNest(AliasedAirportCode) ) AliasedAirportCode = "???";
        }
Пример #15
0
 public VmNest OpenLastNestAppropriateForTag(VmTag tag)
 {
     VmLocationToDestinationMappingResult result =
         VmAirportData.Default.GetLocationByDispatchDestination(tag);
     String locationCode  = result.LocationCode;
     return OpenLastNestForLocationCode(locationCode);
 }
Пример #16
0
 public void MapRouteIndexNumberToTransferLocation(VmTag tag, String transferLocation)
 {
     VmDistributionAndRoutingTagParser dAndRParser = new VmDistributionAndRoutingTagParser(tag.Value);
     String routeIndexNumber = dAndRParser.GetNationalRoutingIndex();
     _routeIndexToDestinationMappings[routeIndexNumber] = transferLocation;
 }
Пример #17
0
 public static String ExtractDestination(VmTag tag)
 {
     //            if( tag.IsUs() ) return
     return null;
 }
Пример #18
0
 public void HandleTagChange(VmTag tag)
 {
     bool hasChanged = (_lastTag == null || ( ! JwUtility.IsEqual(_lastTag, tag) ) );
     Color color = (hasChanged) ? Color.White : VmUiConstants.BACKGROUND_COLOR;
     JwUi.SetChildrenBackColor(_subpanel, color);
     _lastTag = tag;
 }
Пример #19
0
 public void HandleScan(VmTag tag)
 {
     Tag = tag;
     DoExitEvent();
 }
Пример #20
0
 //# __________ PROTOCOL :: PUBLIC __________ #//
 public void ShowTag(VmTag tag)
 {
     if( tag.IsUnknown() )
         _ShowInvalid(tag);
     else
         _ShowValidTag(tag);
 }
Пример #21
0
        //# __________ PROTOCOL :: PUBLIC (PLANNED ROUTE CLOSE OUT) __________ #//
        public VmPlannedRouteCloseOut GetPlannedRouteCloseOut(VmTag tag)
        {
            if( ! tag.IsUsDomestic() ) return null;

            VmDistributionAndRoutingTagParser dAndR = new VmDistributionAndRoutingTagParser(tag.Value);
            return
                GetPlannedRouteCloseOut(
                    dAndR.GetDayOfMonth(),
                    dAndR.GetNationalRoutingIndex());
        }
Пример #22
0
 public void _ShowInvalid(VmTag tag)
 {
     HandleTagChange(tag);
     ClearFields();
     _valueLabel.Text =  tag.Value;
     _laneLabel.Text = VmLanguage.Default.GetInvalidTag();
     _bottomLayout.LeftControl = null;
     //            _laneWrapper.HideLayout();
     //            _weightWrapper.HideLayout();
     //            _invalidWrapper.ShowLayout();
     //            _duplicateWrapper.HideLayout();
 }
Пример #23
0
 public VmItemManifest LazyCreateItem(VmTag tag, int nestId)
 {
     lock( this )
     {
         VmSortedFileRecord record = VmAirportData.Default.AirportOutputData.ItemManifestFile.Find(tag.Value);
         if( ! record.WasFound() )
         {
             return VmItemManager.Default.AddItem(
                 tag,
                 record.Index,
                 nestId,
                 tag.Kilograms);
         }
         return (VmItemManifest)record.Model;
     }
 }
Пример #24
0
 public void _ShowValidTag(VmTag tag)
 {
     HandleTagChange(tag);
     ClearFields();
     _valueLabel.Text =  tag.Value;
     _laneLabel.Text =
         tag.OriginCountryCode +
         " " +
         tag.OriginAirportCode +
         " > " +
         tag.DestinationCountryCode +
         " " +
         tag.DestinationAirportCode;
     double weight = (VmProperties.Default.ShouldUseMetric() ) ? tag.Kilograms : tag.GetPounds();
     double d = Math.Round(weight, 1);
     _weightLabel.Text = d + "";
     _bottomLayout.LeftControl =
         ( VmProperties.Default.ShouldShowTagType() )
             ? GetTagType(tag)
             : null;
 }
Пример #25
0
 //# __________ PROTOCOL :: PARSING __________ #//
 public static VmTag Parse(String value)
 {
     VmTag tag = new VmTag();
     tag.Value = value;
     tag.ParseValue();
     return tag;
 }
Пример #26
0
 /*
 public Control MakeTagInvalidWrapper()
 {
     JwLabel invalidLabel = VmUiBuilder.MakeValueLabel(VmLanguage.Default.GetInvalidTag());
     _invalidWrapper = new JwVisibilityWrapper(invalidLabel, false);
     return _invalidWrapper;
 }
 */
 /*
 public Control MakeDuplicateWrapper()
 {
     JwLabel duplicateLabel = VmUiBuilder.MakeValueLabel(VmLanguage.Default.GetDuplicate());
     _duplicateWrapper = new JwVisibilityWrapper(duplicateLabel, false);
     return _duplicateWrapper;
 }
 */
 public JwPictureBox GetTagType(VmTag tag)
 {
     if( ! _pictureBoxMap.ContainsKey(tag.Type) )
     {
         if( tag.Type == VmTag.US_DOMESTIC && VmProperties.Default.ShouldAllowUsDomesticTag() )
         {
             AddTagTypeImage(
                 VmTag.US_DOMESTIC,
                 VmImageManager.Default.GetTagUsDomesticImage());
         }
         else if( tag.Type == VmTag.UPU && VmProperties.Default.ShouldAllowUpuTag() )
         {
             AddTagTypeImage(
                 VmTag.UPU,
                 VmImageManager.Default.GetTagUpuImage());
         }
         if( tag.Type == VmTag.CARGO && VmProperties.Default.ShouldAllowCargoTag() )
         {
             AddTagTypeImage(
                 VmTag.CARGO,
                 VmImageManager.Default.GetTagCargoImage());
         }
     }
     return _pictureBoxMap[tag.Type];
 }
Пример #27
0
 public void RecordDelegate(VmTag tag)
 {
     Nest = VmNestManager.Default.LazyGetDelegate(tag);
     // kludge (err) - refactor
     // NOTE - THE EXISING CODE CLOSES THE ENGINE FROM THE PANEL...
     // THIS NEEDS TO BE FIXED.
 }
Пример #28
0
 public bool HandleItemInput(VmTag tag)
 {
     _tag = tag;
     return true;
 }
Пример #29
0
 //# __________ PROTOCOL :: PUBLIC __________ #//
 public VmLocationToDestinationMappingResult GetLocationByDispatchDestination(VmTag tag)
 {
     return AirportInputData.GetLocationByDispatchDestination(tag);
 }
Пример #30
0
 //# __________ PROTOCOL :: PRIVATE __________ #//
 public void ShowTag(bool isDuplicate, VmTag tag)
 {
     //            _scanTextBox.Focus();
     if( tag != null )
     {
         if( isDuplicate )
             // (err) kludge - superfluous
             throw new Exception("not supporting duplicate.");
     //                    _tagSubpanel.ShowDuplicate(tag);
         else
             _tagSubpanel.ShowTag(tag);
     }
     else _tagSubpanel.ShowInitial();
 }