예제 #1
0
        public void Update()
        {
            Control.ClearShifts();
            _shifts.Clear();

            if (CoatingDay.ChildrenLogic.Count == 0)
            {
                return;
            }

            var coatingScheduleLogic = CoatingDay.ChildrenLogic[0];
            var line     = coatingScheduleLogic as CoatingScheduleLine;
            var newShift = new TrackingShift(line);

            Control.ShiftControls.Add(new TrackingShiftControl(newShift));
            _shifts.Add(newShift);
            newShift.PopulateSummaries();
            newShift.RemoveSales();


            for (int index = 1; index < CoatingDay.ChildrenLogic.Count; index++)
            {
                coatingScheduleLogic = CoatingDay.ChildrenLogic[index];
                line     = coatingScheduleLogic as CoatingScheduleLine;
                newShift = new TrackingShift(line);
                Control.ShiftControls.Add(new TrackingShiftControl(newShift));
                _shifts.Add(newShift);
                newShift.PopulateSummaries();
            }
        }
예제 #2
0
        private void Export(TrackingShift shift, Worksheet worksheet)
        {
            int currentCol = 1;
            int colWidth   = 4;

            // output shift name
            OutputText(shift.ShiftTitle, currentCol++, 1, _curRow, worksheet);

            // output each summary
            foreach (var itemSummary in shift.ItemSummaries)
            {
                var foreground = DoubleToBrushConverter.GetBrushColor(itemSummary.RunningUnits);
                var background = MasterToBrushConverter.GetExcelColor(itemSummary.Item);
                SetWidth(currentCol, colWidth, worksheet);
                OutputText(itemSummary.RunningUnits.ToString("N1"), currentCol++, 1, _curRow, worksheet, foreground, background);
                SetWidth(currentCol, colWidth, worksheet);
                OutputText(itemSummary.AddedUnits.ToString("N1"), currentCol++, 1, _curRow, worksheet);
                SetWidth(currentCol, colWidth, worksheet);
                OutputText("-" + itemSummary.RemovedUnits.ToString("N1"), currentCol++, 1, _curRow, worksheet);
            }
        }
 public void AddControl(TrackingShift shift)
 {
     _shiftControls.Add(new TrackingShiftControl(shift));
 }
예제 #4
0
 public TrackingShiftControl(TrackingShift shift)
 {
     Shift = shift;
     InitializeComponent();
     Shift.Control = this;
 }