Exemplo n.º 1
0
 /// <summary>
 /// Gets next event in theachers calendar.
 /// </summary>
 /// <returns>Next event or event with default messages if there is no next event.</returns>
 private ScheduledEventViewModel GetNextEvent()
 {
     ScheduledEventViewModel nextEvent;
     try
     {
         // Try to get next event.
         var eventObject = _facade.GetNextEvent(ViewModelLocator.CurrentTeacher.Id);
         nextEvent = new ScheduledEventViewModel(eventObject);
     }
     catch (NoObjectsFoundException e)
     {
         // No next event.
         nextEvent = new ScheduledEventViewModel {TimeString = "�� �����������"};
     }
     return nextEvent;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Gets current event in teachers calendar.
        /// </summary>
        /// <returns>Current event or event with default messages if there is no events now.</returns>
        private ScheduledEventViewModel GetCurrentEvent()
        {
            ScheduledEventViewModel currentEvent;
            try
            {
                // Try to get current event.
                var eventObject = _facade.GetCurrentEvent(ViewModelLocator.CurrentTeacher.Id);
                currentEvent = new ScheduledEventViewModel(eventObject);
            }
            catch (NoObjectsFoundException e)
            {
                // No current event now.
                currentEvent = new ScheduledEventViewModel(new EventObject()
                {
                    Title = "������. ����������� ������. �������",
                    Importance = 5,
                    Place = "202/2",
                    Description = "���"
                }) { TimeString = "8:00 - 9:35" };

            }
            return currentEvent;
        }