//# __________ 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; } }
public bool HandleItemInput(VmTag tag) { if( tag.IsUnknown() ) { VmApplication.Default.ShowNotification( VmLanguage.Default.GetInvalidTag()); _subpanel.FocusUponTag(); return false; } Engine.RecordDelegate(tag); return true; }
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; }
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(); */ }
public String GetRouteIndexMapping(VmTag tag) { VmDistributionAndRoutingTagParser dAndRParser = new VmDistributionAndRoutingTagParser(tag.Value); String routeIndexNumber = dAndRParser.GetNationalRoutingIndex(); return GetRouteIndexMapping(routeIndexNumber); }
//# __________ PROTOCOL :: FRAMEWORK __________ #// public abstract void Handle(VmTag tag);
public JwDate InferTagDate(VmTag tag) { VmDistributionAndRoutingTagParser dAndR = new VmDistributionAndRoutingTagParser(tag.Value); int dayOfMonthIndex = dAndR.GetDayOfMonth(); return InferTagDate(dayOfMonthIndex); }
//# __________ PROTOCOL :: PUBLIC __________ #// public void ShowFirstPanel() { Tag = null; ShowRecordItemPanel(); }
// deprecated in favor of getDelegate public VmNest LazyGetDelegate(VmTag tag) { return GetDelegate(tag.Value); }
//# __________ 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); }
//# __________ 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); }
//# __________ 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); } }
//# __________ 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(); }
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 = "???"; }
public VmNest OpenLastNestAppropriateForTag(VmTag tag) { VmLocationToDestinationMappingResult result = VmAirportData.Default.GetLocationByDispatchDestination(tag); String locationCode = result.LocationCode; return OpenLastNestForLocationCode(locationCode); }
public void MapRouteIndexNumberToTransferLocation(VmTag tag, String transferLocation) { VmDistributionAndRoutingTagParser dAndRParser = new VmDistributionAndRoutingTagParser(tag.Value); String routeIndexNumber = dAndRParser.GetNationalRoutingIndex(); _routeIndexToDestinationMappings[routeIndexNumber] = transferLocation; }
public static String ExtractDestination(VmTag tag) { // if( tag.IsUs() ) return return null; }
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; }
public void HandleScan(VmTag tag) { Tag = tag; DoExitEvent(); }
//# __________ PROTOCOL :: PUBLIC __________ #// public void ShowTag(VmTag tag) { if( tag.IsUnknown() ) _ShowInvalid(tag); else _ShowValidTag(tag); }
//# __________ 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()); }
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(); }
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; } }
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; }
//# __________ PROTOCOL :: PARSING __________ #// public static VmTag Parse(String value) { VmTag tag = new VmTag(); tag.Value = value; tag.ParseValue(); return tag; }
/* 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]; }
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. }
public bool HandleItemInput(VmTag tag) { _tag = tag; return true; }
//# __________ PROTOCOL :: PUBLIC __________ #// public VmLocationToDestinationMappingResult GetLocationByDispatchDestination(VmTag tag) { return AirportInputData.GetLocationByDispatchDestination(tag); }
//# __________ 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(); }