Beispiel #1
0
        public void ResetAllItemsInProduction()
        {
            var currentOrder = GetFirstOrderInProductionAndNotCompleted();

            var items = ERPContext.Set <ITEM>().Where(i => i.OrderID == currentOrder.OrderID);

            var currentItemsInProduction = items.Where(it => it.ITEMTRACKER.Any(it1 => it1.ItemStatus == (int)ItemStatus.InProduction)

                                                       && it.ITEMTRACKER.Any(it2 => it2.ItemStatus != (int)ItemStatus.Complete));

            var itemTrackers = from currentItems in currentItemsInProduction
                               from trackers in ERPContext.Set <ITEMTRACKER>()
                               .Where(it => it.ItemID == currentItems.ItemID)
                               .OrderByDescending(it => it.ItemTrackerID).Take(1)

                               select trackers;


            foreach (var tracker in itemTrackers)
            {
                ITEMTRACKER newTracker = new ITEMTRACKER()
                {
                    ItemID         = tracker.ItemID,
                    OrderID        = tracker.OrderID,
                    ItemStatus     = (int)ItemStatus.Confirmed,
                    MeasuredWeight = null
                };

                ERPContext.Set <ITEMTRACKER>().Add(newTracker);
            }
        }
        private void UpdateItemTracker(List <ITEM> orderItems)
        {
            foreach (ITEM item in orderItems)
            {
                ITEMTRACKER trackingInfo = new ITEMTRACKER()
                {
                    ItemID = item.ItemID, OrderID = item.OrderID, ItemStatus = 0, TimeStamp = DateTime.Now, MeasuredWeight = null
                };

                _uOW.ORDERs.UpdateItemTracker(trackingInfo);

                _uOW.Complete();
            }
        }
Beispiel #3
0
 public void UpdateItemTracker(ITEMTRACKER trackingInfo)
 {
     ERPContext.ITEMTRACKER.Add(trackingInfo);
 }