Ejemplo n.º 1
0
        private void CreateShifts()
        {
            _shifts.Clear();


            for (DateTime current = StartTime; current < EndTime; current = current.AddDays(1))
            {
                Shift matchingShift = null;
                foreach (var s in ProductionShifts)
                {
                    if (s.DaysList.Contains(current.DayOfWeek))
                    {
                        if (s.StartDate <= current)
                        {
                            if (s.EndDate >= current)
                            {
                                matchingShift = s;

                                PressShift newShift = new PressShift(new DateTime(current.Year, current.Month, current.Day, matchingShift.StartTime.Hour, matchingShift.StartTime.Minute, matchingShift.StartTime.Second),
                                                                     matchingShift.Duration, s.Name);
                                _shifts.Add(newShift);
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public PressShiftControl()
        {
            InitializeComponent();
            Shift = DataContext as PressShift;
            if (Shift == null)
            {
                Shift = Content as PressShift;
            }


            ProductSelectionBox.ItemsSource = StaticInventoryTracker.PressMasterList;
        }
Ejemplo n.º 3
0
        public PressShift GetShift(DateTime start, DateTime end)
        {
            PressShift shift = null;

            foreach (var pressShift in _shifts)
            {
                if (pressShift.EndTime + PressManager.Instance.DelayTime <= end && pressShift.EndTime + PressManager.Instance.DelayTime > start)
                {
                    shift = pressShift;
                    break;
                }
            }

            return(shift);
        }
Ejemplo n.º 4
0
        public PressShiftControl(PressShift shift)
        {
            InitializeComponent();
            if (shift != null)
            {
                Shift       = shift;
                DataContext = Shift;
            }
            else
            {
                Shift = DataContext as PressShift;
            }

            ProductSelectionBox.ItemsSource = StaticInventoryTracker.PressMasterList;
        }