Exemplo n.º 1
0
 void refreshTabs(FilterType filterType, SaveTrainingDayResult saveResult)
 {
     this.filterType = filterType;
     //tsbFilterAll.IsChecked = filterType == FilterType.All;
     //tsbFilterOnlyReservation.IsChecked = filterType == FilterType.OnlyReservations;
     //tsbFilterOnlyNotReservation.IsChecked = filterType == FilterType.OnlyNotReservations;
     tabs.Clear();
     for (int index = day.Objects.Count - 1; index >= 0; index--)
     {
         var  entry        = day.Objects.ElementAt(index);
         bool showByFilter = filterType == FilterType.All || (filterType == FilterType.OnlyReservations && entry.ReservationId.HasValue) || (filterType == FilterType.OnlyNotReservations && !entry.ReservationId.HasValue);
         if (showByFilter && !createNewEntryControl(entry, false, saveResult))
         {
             //exception during creating new entry so we delete it from training day
             day.RemoveEntry(entry);
         }
     }
     NotifyOfPropertyChange(() => IsFilterAll);
     NotifyOfPropertyChange(() => IsFilterOnlyNotReservations);
     NotifyOfPropertyChange(() => IsFilterOnlyReservations);
 }
Exemplo n.º 2
0
 public void Fill(TrainingDayDTO day, UserDTO user)
 {
     this.SuspendLayout();
     this.day     = day;
     User         = user;
     txtDate.Text = day.TrainingDate.ToShortDateString();
     xtraTabControl1.TabPages.Clear();
     for (int index = day.Objects.Count - 1; index >= 0; index--)
     {
         var entry = day.Objects[index];
         if (!createNewEntryControl(entry, false))
         {
             //exception during creating new entry so we delete it from training day
             day.RemoveEntry(entry);
         }
     }
     updateButtons();
     this.ResumeLayout();
 }