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(); } }
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)); }
public TrackingShiftControl(TrackingShift shift) { Shift = shift; InitializeComponent(); Shift.Control = this; }