예제 #1
0
 public void RemoveDay(TrackingDay day)
 {
     TrackingDays.Remove(day);
 }
예제 #2
0
        public void Update()
        {
            RunningTotalsDictionary.Clear();
            TrackingDays.Clear();
            Window.DayControls.Clear();

            // update inventory data
            foreach (var inventoryItem in StaticInventoryTracker.AllInventoryItems)
            {
                if (Watches.Any(w => w.MasterID == inventoryItem.MasterID))
                {
                    ProductMasterItem keyMasterItem = null;

                    keyMasterItem = StaticInventoryTracker.ProductMasterList.FirstOrDefault(
                        m => m.MasterID == inventoryItem.MasterID);

                    // if master item exists.
                    if (keyMasterItem != null)
                    {
                        RunningTotalsDictionary[keyMasterItem.MasterID] = inventoryItem.Units;
                    }
                }
            }
            // update WiP data
            foreach (var inventoryItem in StaticInventoryTracker.WiPItems)
            {
                if (Watches.Any(w => w.MasterID == inventoryItem.MasterID))
                {
                    ProductMasterItem keyMasterItem = null;

                    keyMasterItem = StaticInventoryTracker.ProductMasterList.FirstOrDefault(
                        m => m.MasterID == inventoryItem.MasterID);

                    // if master item exists.
                    if (keyMasterItem != null)
                    {
                        RunningTotalsDictionary[keyMasterItem.MasterID] = inventoryItem.Units;
                    }
                }
            }


            if (CoatingSchedule.CurrentSchedule == null)
            {
                return;
            }

            foreach (var coatingScheduleLogic in CoatingSchedule.CurrentSchedule.ChildrenLogic)
            {
                var day = coatingScheduleLogic as CoatingScheduleDay;
                AddDay(new TrackingDay(day));
            }

            //foreach (var productMasterItem in Watches)
            //{
            //    double currentInv = 0;
            //    var inv = StaticInventoryTracker.InventoryItems.FirstOrDefault(x => x.MasterID == productMasterItem.MasterID);
            //    if (inv != null)
            //        currentInv = inv.Units;

            //    foreach (var trackingDay in TrackingDays)
            //    {
            //        currentInv = trackingDay.AddTracking(productMasterItem, currentInv);
            //    }
            //}
        }
예제 #3
0
 public void AddDay(TrackingDay day)
 {
     Window.AddDayControl(day);
     TrackingDays.Add(day);
     day.Update();
 }