protected override DayInCalendarObject GetDay(Guid treeGridRecordId)
        {
            Guid     calendarId = _page.DataSource.ActiveRowPrimaryColumnValue;
            DateTime date       = CurrentDaysGridData[treeGridRecordId].Date;

            var calendarUtils = new CalendarUtils(UserConnection);

            CalendarEditPageChangesStore.DayInCalendarChangedObject changedDay = ChangesStore.Days.SingleOrDefault(d =>
                                                                                                                   d.DayInCalendar.CalendarId == calendarId && d.DayInCalendar.Date.Date == date.Date &&
                                                                                                                   d.ChangedStatus != CalendarEditPageChangesStore.ChangedStatus.Deleted);
            if (changedDay != null)
            {
                return(changedDay.DayInCalendar);
            }
            DayInCalendarExtended day = calendarUtils.GetCalendarDayExtended(CalendarIdsChain, date,
                                                                             ChangesStore.GetDeletedDaysIds());

            return(new DayInCalendarObject(day));
        }
Exemplo n.º 2
0
        protected override DayInCalendarObject GetDay(Guid treeGridRecordId)
        {
            Guid calendarId      = _page.DataSource.ActiveRowPrimaryColumnValue;
            int  dayOfWeekNumber = CurrentDaysGridData[treeGridRecordId].DayOfWeekNumber;

            var calendarHelper = new CalendarUtils(UserConnection);

            CalendarEditPageChangesStore.DayInCalendarChangedObject changedDay = ChangesStore.Days.SingleOrDefault(d =>
                                                                                                                   d.DayInCalendar.CalendarId == calendarId && d.DayInCalendar.DayOfWeekNumber == dayOfWeekNumber &&
                                                                                                                   d.ChangedStatus != CalendarEditPageChangesStore.ChangedStatus.Deleted);
            if (changedDay != null)
            {
                return(changedDay.DayInCalendar);
            }
            DayInCalendar day = calendarHelper.GetWeekDay(CalendarIdsChain, dayOfWeekNumber,
                                                          ChangesStore.GetDeletedDaysIds());

            return(new DayInCalendarObject(day));
        }