Exemplo n.º 1
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;
 }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
 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;
 }