Beispiel #1
0
 public IList<Data> GetDataByUserAndSignalBetweenLocalDates(User user, Signal signal, DateTime startLocalDateTime, DateTime endLocalDateTime)
 {
     JavaScriptSerializer serializer = new JavaScriptSerializer();
     AdvanticWS.DataControllerPortTypeClient client = new AdvanticWS.DataControllerPortTypeClient();
     string response = client.getData(user.UserName, signal.id.ToString(), startLocalDateTime.ToString(DATETIMEFORMAT),endLocalDateTime.ToString(DATETIMEFORMAT), "M");
     DataResponse dataResponse = serializer.Deserialize<DataResponse>(response);
     return dataResponse.lecturas;
 }
Beispiel #2
0
 public IList<Signal> GetSignalsByUserAndDevice(User user, Device device)
 {
     JavaScriptSerializer serializer = new JavaScriptSerializer();
     AdvanticWS.DataControllerPortTypeClient client = new AdvanticWS.DataControllerPortTypeClient();
     string response = client.getSignals(user.UserName,device.id.ToString());
     SignalResponse signalResponse = serializer.Deserialize<SignalResponse>(response);
     return signalResponse.senales;
 }
Beispiel #3
0
 public IList<Device> GetDevicesByUserAndLocation(User user, Location location)
 {
     JavaScriptSerializer serializer = new JavaScriptSerializer();
     AdvanticWS.DataControllerPortTypeClient client = new AdvanticWS.DataControllerPortTypeClient();
     string response = client.getDevices(user.UserName,location.id.ToString());
     DeviceResponse deviceResponse = serializer.Deserialize<DeviceResponse>(response);
     return deviceResponse.dispositivos;
 }
 public IList<AdvanticSignal> GetAdvanticSignal(User user, Location location, Device device)
 {
     List<AdvanticSignal> advanticSignalList = new List<AdvanticSignal>();
     SignalService signalService = new SignalService();
     IList<Signal> signalList = signalService.GetSignalsByUserAndDevice(user, device);
     advanticSignalList.AddRange(createAdvanticSignalByUserAndLocationAndDeviceAndSignal(user, location, device,signalList));
     return advanticSignalList;
 }
 public IList<AdvanticSignal> GetAdvanticSignal(User user, Location location)
 {
     List<AdvanticSignal> advanticSignalList = new List<AdvanticSignal>();
     DeviceService deviceService = new DeviceService();
     IList<Device> deviceList = deviceService.GetDevicesByUserAndLocation(user, location);
     foreach (Device device in deviceList)
         advanticSignalList.AddRange(GetAdvanticSignal(user,location,device));
     return advanticSignalList;
 }
 public IList<AdvanticSignal> GetAdvanticSignal(String userId)
 {
     List<AdvanticSignal> advanticSignalList = new List<AdvanticSignal>();
     LocationService locationService = new LocationService();
     User user= new User(userId);
     List<Location> locationList = locationService.GetLocationsByUser(user);
     foreach (Location location in locationList)
         advanticSignalList.AddRange(GetAdvanticSignal(user, location));
     return advanticSignalList;
 }
 private IList<AdvanticSignal> createAdvanticSignalByUserAndLocationAndDeviceAndSignal(User user, Location location, Device device,IList<Signal> signalList)
 {
     List<AdvanticSignal> advanticSignalList = new List<AdvanticSignal>();
     foreach (Signal signal in signalList)
     {
         advanticSignalList.Add(new AdvanticSignal()
         {
             User=user,
             Location=location,
             Device=device,
             Signal=signal
         });
     }
     return advanticSignalList;
 }