Exemple #1
0
        private void PrintTimeCell(object sender, PrintEventArgs e)
        {
            XRTableCell          cell = (XRTableCell)sender;
            EmployeePlanningWeek employeePlanningWeek = GetCurrentEmployeeWeek();
            EmployeeDayView      dayView = DayViewList.GetByEmployeeId(employeePlanningWeek.EmployeeId);

            if (dayView == null)
            {
                return;
            }
            StoreDay storeDay = _planningContext.StoreDays[dayView.ViewDate];

            if (storeDay == null)
            {
                return;
            }

            foreach (XRControl child in cell.Controls)
            {
                XRLabel      shape    = child as XRLabel;
                TimeCellInfo cellInfo = child.Tag as TimeCellInfo;
                if (shape == null || cellInfo == null)
                {
                    continue;
                }

                short currentTime = Convert.ToInt16(cellInfo.DayTime.TotalMinutes);

                Color color = storeDay.IsOpeningTime(currentTime) ? Color.White : Color.LightGray;
                if (!cellInfo.ManualFill)
                {
                    Color workingTimeColor = dayView.GetColor(currentTime / 15);
                    if (workingTimeColor != Color.White)
                    {
                        color = workingTimeColor;
                    }
                }
                ReportPainter.AcceptShape(shape, cell, color);
            }
        }
        private void PrintPlannedCell(object sender, PrintEventArgs e)
        {
            XRTableCell cell = (XRTableCell)sender;

            if (_plannedDayView == null)
            {
                return;
            }
            StoreDay storeDay = _recordingContext.StoreDays[_recordingContext.ViewDate];

            if (storeDay == null)
            {
                return;
            }

            foreach (XRControl child in cell.Controls)
            {
                XRLabel      shape    = child as XRLabel;
                TimeCellInfo cellInfo = child.Tag as TimeCellInfo;
                if (shape == null || cellInfo == null)
                {
                    continue;
                }

                short currentTime = Convert.ToInt16(cellInfo.DayTime.TotalMinutes);

                Color color = storeDay.IsOpeningTime(currentTime) ? Color.White : Color.LightGray;
                if (!cellInfo.ManualFill)
                {
                    Color workingTimeColor = _plannedDayView.GetColorByTime(currentTime);
                    if (workingTimeColor != Color.White)
                    {
                        color = workingTimeColor;
                    }
                }

                ReportPainter.AcceptShape(shape, cell, color);
            }
        }