예제 #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
 //# __________ PROTOCOL :: PUBLIC (NESTED ITEMS)__________ #//
 public void AddItemToNest(VmItemManifest item, int nestId)
 {
     if( nestId == -1 )
     {
         item.NestId = -1;
         return;
     }
     _AddNestedItem(item, nestId);
     item.NestId = nestId;
     VmItemManager.Default.UpdateItem(item);
 }
예제 #3
0
 public void UpdateItem(VmItemManifest item)
 {
     lock( this )
     {
         VmAirportData.Default.AirportOutputData.ItemManifestFile.ReplaceWith(
             item.TagValue,
             item);
     }
 }
예제 #4
0
 //# __________ PROTOCOL :: PRIVATE (NESTED ITEM) __________ #//
 public void _RemoveNestedItem(VmItemManifest item, int nestId)
 {
     if( nestId == -1 ) return;
     VmAirportData.Default.AirportOutputData.GetNestedItemFile(nestId).Delete(item.ItemId+"");
     VmNest n = GetNest(nestId);
     n.RemoveTag(item.Kilograms);
 }
예제 #5
0
        public void _AddNestedItem(VmItemManifest item, int nestId)
        {
            VmNestedItem ni = new VmNestedItem();
            ni.ItemId       = item.ItemId;
            ni.Kilograms    = item.Kilograms;
            VmAirportData.Default.AirportOutputData.GetNestedItemFile(nestId).InsertWhereAppropriate(item.ItemId+"", ni);

            VmNest n = GetNest(nestId);
            n.AddTag(item.Kilograms);
        }
예제 #6
0
 public void RemoveItemFromNest(VmItemManifest item)
 {
     _RemoveNestedItem(item, item.NestId);
     item.NestId = -1;
     VmItemManager.Default.UpdateItem(item);
 }
예제 #7
0
 public void MoveItemToNest(
     VmItemManifest im,
     int newNestId)
 {
     int oldNestId = im.NestId;
     _RemoveNestedItem(im, oldNestId);
     AddItemToNest(im, newNestId);
 }