Exemplo n.º 1
0
 public void RemoveDay(TrackingDay day)
 {
     TrackingDays.Remove(day);
 }
Exemplo n.º 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);
            //    }
            //}
        }
Exemplo n.º 3
0
 public void AddDay(TrackingDay day)
 {
     Window.AddDayControl(day);
     TrackingDays.Add(day);
     day.Update();
 }