Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/23/10 10:50:26 (14 years ago)
Author:
kgrading
Message:

implemented the server on the client, using push & force push, added refresh buttons, added auto calender methods that traverse the tree... (#908)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.Server.Core/3.2/ClientManager.cs

    r3022 r3203  
    128128        return response;
    129129      }
     130
    130131      clientGroup.Resources.Add(resource);
    131132      DaoLocator.ClientGroupDao.AddRessourceToClientGroup(resource.Id, clientGroup.Id);
    132       //clientGroupAdapter.Update(clientGroup);
     133
     134      //If our resource is in fact a client => set the callendar from the resource as current one.
     135     
     136      ClientDto dbr = DaoLocator.ClientDao.FindById(resource.Id);
     137      if(dbr != null) {
     138        DaoLocator.ClientDao.SetServerSideCalendar(dbr, clientGroup.Id); 
     139      }
    133140
    134141      response.Success = true;
     
    153160        return response;
    154161      }
    155       foreach (ResourceDto resource in clientGroup.Resources) {
    156         if (resource.Id == resourceId) {
    157           clientGroup.Resources.Remove(resource);
    158           DaoLocator.ClientGroupDao.RemoveRessourceFromClientGroup(resource.Id, clientGroup.Id);
    159           //clientGroupAdapter.Update(clientGroup);
    160           response.Success = true;
    161           response.StatusMessage = ApplicationConstants.RESPONSE_CLIENT_RESOURCE_REMOVED;
    162           return response;
    163         }
    164       }
    165       response.Success = false;
    166       response.StatusMessage = ApplicationConstants.RESPONSE_CLIENT_RESOURCE_NOT_FOUND;
    167 
    168       return response;
     162     
     163      DaoLocator.ClientGroupDao.RemoveRessourceFromClientGroup(resourceId, clientGroup.Id);
     164     
     165      response.Success = true;
     166      response.StatusMessage = ApplicationConstants.RESPONSE_CLIENT_RESOURCE_REMOVED;
     167      return response;               
    169168    }
    170169
     
    212211    }
    213212
    214     public Response SetUptimeCalendarForResource(Guid guid, IEnumerable<AppointmentDto> appointments) {
     213    public Response SetUptimeCalendarForResource(Guid guid, IEnumerable<AppointmentDto> appointments, bool isForced) {
    215214      DaoLocator.UptimeCalendarDao.SetUptimeCalendarForResource(guid, appointments);
     215      DaoLocator.UptimeCalendarDao.NotifyClientsOfNewCalendar(guid, isForced);
    216216      return new Response {Success = true};
    217217    }
Note: See TracChangeset for help on using the changeset viewer.