Ejemplo n.º 1
0
        /// <summary>
        /// Post location and other information for tracking a user.
        /// </summary>
        /// <param name="tracking">Contains location and other information to track a user.</param>
        /// <returns>Relevant information about the user route.</returns>
        public TrackingResponseModel Post([FromBody] TrackingModel tracking)
        {
            /*
             * var epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
             * return epoch.AddSeconds(unixTime);
             */

            var response = new TrackingResponseModel();

            ZoneResponse zoneResponse = _zoneService.GetZone(11, 11);

            if (zoneResponse.HasError)
            {
                response.HasError = true;
                response.Error    = zoneResponse.Error;
            }
            else
            {
                response.Zones.Add(new ZoneModel()
                {
                    Name = zoneResponse.Name, Number = zoneResponse.Number
                });
            }
            return(response);
        }
Ejemplo n.º 2
0
        public string[] GetZones()
        {
            //Call the API endpoint for all zones
            var response = ApiGet("zones");
            //Deserialize JSON to object
            var result = ZoneResponse.FromJson(response);

            //Return array of zones
            return(result.Select(x => x.Name).ToArray());
        }
 public ZoneResponse ProcessESB(ZoneRequest objRequest)
 {
     try
     {
         {
             objZoneResponse.ZoneGrid = objclsDashboard.GetESBLatencyData(objRequest.DateTime, objRequest.LatencyType, objRequest.SerID, objRequest.MetID);
             return(objZoneResponse);
         }
     }
     catch (Exception)
     {
         return(objZoneResponse);
     }
     finally
     {
         objZoneResponse = null;
         objclsDashboard = null;
     }
 }