Beispiel #1
0
        public RecordingDayRow(EmployeeWeek week, RecordingDayView dayview,
                               EmployeeWeek actualweek, RecordingDayView actualdayview, long orderHwgr)
        {
            _plannedWeek    = week;
            _plannedDayView = dayview;

            _actualWeek    = actualweek;
            _actualDayView = actualdayview;

            if (_plannedDayView != null)
            {
                _plannedDay = _plannedDayView.RecordingDay;
            }

            if (_actualDayView != null)
            {
                _actualDay = _actualDayView.RecordingDay;
            }

            if (_plannedWeek.FullName != null)
            {
                _fullname = _plannedWeek.FullName;
            }

            _OrderHWGR = orderHwgr;
        }
Beispiel #2
0
        public void AddRange(IList lst)
        {
            Clear();

            if (lst != null && lst.Count > 0)
            {
                RecordingDayView plannedView = null;
                RecordingDayView actualView  = null;

                foreach (RecordingDayRow row in lst)
                {
                    plannedView = row.PlannedView;
                    actualView  = row.ActualView;
                    short time = 0;
                    for (int i = 0; i < MAXRANGES; i++)
                    {
                        time = (short)(i * 15);
                        if (plannedView.IsWorkingTime(time))
                        {
                            _plannedSum[i] += 15;
                        }
                        if (actualView.IsWorkingTime(time))
                        {
                            _actualSum[i]           += 15;
                            TotalActualWorkingHours += 15;
                        }
                    }
                    TotalContractHours      += row.PlannedWeek.ContractHoursPerWeek;
                    TotalActualContractHours = row.ActualWeek.ContractHoursPerWeek;

                    TotalPlannedHours       += row.PlannedDay.CountDailyPlannedWorkingHours;
                    TotalActualPlannedHours += row.ActualDay.CountDailyPlannedWorkingHours;

                    TotalAdditionalHours       += row.PlannedDay.CountDailyAdditionalCharges;
                    TotalActualAdditionalHours += row.ActualDay.CountDailyAdditionalCharges;

                    TotalPlusMinusHours       += row.PlannedWeek.CountWeeklyPlusMinusHours;
                    TotalActualPlusMinusHours += row.ActualWeek.CountWeeklyPlusMinusHours;

                    TotalSaldo       += row.PlannedWeek.Saldo;
                    TotalActualSaldo += row.ActualWeek.Saldo;
                }
                //int max = 0;
                for (int i = 0; i < HOURS; i++)
                {
                    _plannedSumUnits[i] = GetSumPerHour(i, _plannedSum);
                    _actualSumUnits[i]  = GetSumPerHour(i, _actualSum);
                }
            }
        }
        private void BeforePrintRecordingTable(object sender, PrintEventArgs e)
        {
            _plannedDayView = _actualDayView = null;

            if (DataSource != null && ((IList)DataSource).Count > 0)
            {
                EmployeeWeek ew = GetCurrentEmployee();

                _plannedDayView = new RecordingDayView();
                _plannedDayView.RecordingDay = ew.GetDay(_recordingContext.ViewDate);

                _actualDayView = new RecordingDayView();
                EmployeeWeek emplWeek = _recordingContext.WorldActualState[ew.EmployeeId];
                if (emplWeek != null)
                {
                    _actualDayView.RecordingDay = emplWeek.GetDay(_recordingContext.ViewDate);
                }
            }
        }
Beispiel #4
0
        public static void DrawDailyViewCell2(RowCellCustomDrawEventArgs e, int index, DailyViewStyle view, StoreDay storeday, RecordingDayView dayView)
        {
            Rectangle cellBound = Rectangle.Inflate(e.Bounds, 1, 1);

            e.Cache.FillRectangle(Color.White, cellBound);

            Rectangle rect;
            int       squareWidth = cellBound.Width;
            Color     squareColor = Color.White;
            //int index = infoColumn.FromTime / 15;
            int squareCount = 1;


            if (view == DailyViewStyle.View30)
            {
                cellBound   = Rectangle.Inflate(cellBound, -2, 0);
                squareWidth = ((cellBound.Width - 1) / 2);
                squareCount = 2;
            }
            else if (view == DailyViewStyle.View60)
            {
                cellBound = Rectangle.Inflate(cellBound, -2, 0);

                squareWidth = ((cellBound.Width - 3) / 4);
                squareCount = 4;
            }

            int   positionX   = cellBound.X;
            int   currentTime = index * 15;
            Color backColor   = Color.White;

            for (int i = 0; i < squareCount; i++)
            {
                currentTime = (index + i) * 15;

                if (!storeday.IsOpeningTime((short)currentTime))
                {
                    backColor = Color.LightGray;
                }
                else
                {
                    backColor = Color.White;
                }

                squareColor = dayView.GetColorByTime((short)currentTime);// (index + i);

                rect = new Rectangle(positionX, cellBound.Y, squareWidth, cellBound.Height);

                if (squareColor == Color.White)
                {
                    squareColor = backColor;
                }


                e.Cache.FillRectangle(squareColor, rect);


                positionX += squareWidth + 1;
            }

            e.Handled = true;
        }