Exemplo n.º 1
0
        /// <summary>
        /// ######### ##### #### # ######### #########.
        /// </summary>
        /// <param name="day">##### ####</param>
        public void AddNewDay(DayInCalendarObject day)
        {
            DayInCalendarChangedObject existedDay = Days.SingleOrDefault(d => d.EntityId == day.Id);

            if (existedDay != null)
            {
                Days.Remove(existedDay);
            }
            Days.Add(new DayInCalendarChangedObject(day, ChangedStatus.New));
        }
Exemplo n.º 2
0
        /// <summary>
        /// ######### ########## #### # ######### #########.
        /// </summary>
        /// <param name="day">########## ####</param>
        public void AddChangedDay(DayInCalendarObject day)
        {
            var changedStatus = ChangedStatus.Changed;
            DayInCalendarChangedObject existedDay = Days.SingleOrDefault(d => d.EntityId == day.Id);

            if (existedDay != null)
            {
                changedStatus = existedDay.ChangedStatus == ChangedStatus.New
                                        ? ChangedStatus.New
                                        : ChangedStatus.Changed;
                Days.Remove(existedDay);
            }
            Days.Add(new DayInCalendarChangedObject(day, changedStatus));
        }
Exemplo n.º 3
0
        /// <summary>
        /// ######### ######### #### # ######### #########.
        /// </summary>
        /// <param name="day">######### ####</param>
        public void AddRemovedDay(DayInCalendarObject day)
        {
            DayInCalendarChangedObject existedDay = Days.SingleOrDefault(d => d.EntityId == day.Id);

            if (existedDay != null)
            {
                RemoveChangedDayIntervals(existedDay);
                Days.Remove(existedDay);
                if (existedDay.ChangedStatus == ChangedStatus.New)
                {
                    return;
                }
            }
            Days.Add(new DayInCalendarChangedObject(day, ChangedStatus.Deleted));
        }
Exemplo n.º 4
0
 private void RemoveChangedDayIntervals(DayInCalendarChangedObject day)
 {
     Intervals.RemoveAll(i => i.WorkingTimeInterval.DayInCalendarId == day.EntityId);
 }