Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/20/11 14:06:33 (13 years ago)
Author:
ascheibe
Message:

#1233
Admin UI:

  • added subgroups
  • groups can now have calendars
  • calendar bugfixes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Administration/3.4/Views/ScheduleView.cs

    r6437 r6451  
    7272
    7373      foreach (HiveAppointment app in offlineTimes) {
    74         if (app.StartDate >= e.StartDate && app.StartDate <= e.EndDate) {
     74        if (app.StartDate >= e.StartDate && app.StartDate <= e.EndDate && !app.Deleted) {
    7575          apps.Add(app);
    7676        }
     
    103103          Locked = true,
    104104          Subject = "Offline",
    105           Changed = false
     105          Changed = false,
     106          Id = app.Id
    106107        });
    107108      }
     
    169170
    170171    private void DeleteRecurringAppointment(Guid recurringId) {
    171       offlineTimes.RemoveAll(a => a.RecurringId.ToString() == ((HiveAppointment)dvOnline.SelectedAppointment).RecurringId.ToString());
     172      foreach (HiveAppointment app in offlineTimes) {
     173        if (app.RecurringId == recurringId) {
     174          app.Deleted = true;
     175        }
     176      }
    172177    }
    173178
     
    217222
    218223    private void DeleteAppointment() {
    219       offlineTimes.Remove((HiveAppointment)dvOnline.SelectedAppointment);
     224      try {
     225        HiveAppointment app = offlineTimes.First(s => s.Equals((HiveAppointment)dvOnline.SelectedAppointment));
     226        app.Deleted = true;
     227      }
     228      catch (InvalidOperationException) {
     229        // this is a ui bug where a selected all day appointment is not properly selected :-/
     230      }
    220231    }
    221232
     
    246257
    247258    private void btnClearCal_Click(object sender, System.EventArgs e) {
    248       offlineTimes.Clear();
     259      foreach (HiveAppointment app in offlineTimes) {
     260        app.Deleted = true;
     261      }
     262      dvOnline.Invalidate();
    249263    }
    250264
     
    319333      List<Appointment> appointments = new List<Appointment>();
    320334      foreach (HiveAppointment app in offlineTimes) {
    321         if (app.Changed) {
     335        if (app.Deleted) {
     336          ServiceLocator.Instance.CallHiveService(service => {
     337            if (app.Id != Guid.Empty) {
     338              service.DeleteAppointment(app.Id);
     339            }
     340          });
     341        } else if (app.Changed) {
    322342          Appointment apdto = new Appointment {
    323343            AllDayEvent = app.AllDayEvent,
     
    339359          }
    340360        });
    341 
    342         //TODO: refresh Content
    343361      }
    344362    }
Note: See TracChangeset for help on using the changeset viewer.