Procházet zdrojové kódy

Removed Store.BulkUpdate

Kenric Nugteren před 1 rokem
rodič
revize
974784f9fc
2 změnil soubory, kde provedl 0 přidání a 70 odebrání
  1. 0 1
      prs.stores/PRSStores.projitems
  2. 0 69
      prs.stores/ShipmentStore.cs

+ 0 - 1
prs.stores/PRSStores.projitems

@@ -75,7 +75,6 @@
     <Compile Include="$(MSBuildThisFileDirectory)ScheduleStore.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)SetoutGroupStore.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)SetoutStore.cs" />
-    <Compile Include="$(MSBuildThisFileDirectory)ShipmentStore.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)StagingSetoutStore.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)StockAreaStore.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)StockLocationStore.cs" />

+ 0 - 69
prs.stores/ShipmentStore.cs

@@ -1,69 +0,0 @@
-using System.Collections.Generic;
-using System.Linq;
-using Comal.Classes;
-using InABox.Core;
-
-namespace Comal.Stores
-{
-    internal class ShipmentStore : BaseStore<Shipment>
-    {
-        public override void BulkUpdate(IEnumerable<Shipment> entities)
-        {
-            base.BulkUpdate(entities);
-
-            var updates = new List<DeliveryItem>();
-
-            foreach (var shipment in entities)
-            {
-                var items = Provider.Load(new Filter<DeliveryItem>(d => d.ShipmentLink.ID).IsEqualTo(shipment.ID));
-                foreach (var item in items)
-                {
-                    item.Location.Latitude = shipment.TrackerLink.Location.Latitude;
-                    item.Location.Longitude = shipment.TrackerLink.Location.Longitude;
-                    item.Location.Timestamp = shipment.TrackerLink.Location.Timestamp;
-                }
-
-                updates.AddRange(items);
-            }
-
-            if (updates.Any())
-                Provider.Save(updates);
-        }
-
-        protected override void AfterSave(Shipment entity)
-        {
-            base.AfterSave(entity);
-
-            //Deprecated - now handled automagically by ShipmentLink.Location :-)
-            //IStore<DeliveryItem> iStore = FindSubStore<DeliveryItem>();
-            //var items = iStore.Load(new Filter<DeliveryItem>(x => x.ShipmentLink.ID).IsEqualTo(entity.ID));
-            //for (int i=0; i< items.Count(); i++) 
-            //{
-            //	DeliveryItem item = items[i];
-
-            //             bool bChanged = false;
-
-            //             if  (item.Location.Longitude != entity.Location.Longitude)
-            //             {
-            //                 item.Location.Longitude = entity.Location.Longitude;
-            //                 bChanged = true;
-            //             }
-
-            //             if (item.Location.Latitude != entity.Location.Latitude)
-            //             {
-            //                 item.Location.Latitude = entity.Location.Latitude;
-            //                 bChanged = true;
-            //             }
-
-            //             if (item.Location.Timestamp != entity.Location.Timestamp)
-            //             {
-            //                 item.Location.Timestamp = entity.Location.Timestamp;
-            //                 bChanged = true;
-            //             }
-
-            //             if (bChanged)
-            //                 iStore.Save(ref item, "Item Updated from by change in Shipment details");
-            //}
-        }
-    }
-}