Exemplo n.º 1
0
 public static string GetTrackerHistory(string trackerId, string selectedDate, int timeInterval)
 {
     if (HttpContext.Current.User.Identity.IsAuthenticated)
     {
         //Date is being passed in as mm/dd/yyyy
         string[] _parseDateString          = selectedDate.Split('/');
         DateTime _startDate                = new DateTime(int.Parse(_parseDateString[2]), int.Parse(_parseDateString[0]), int.Parse(_parseDateString[1]), (timeInterval - 1) * 6, 0, 0);
         DateTime _endDate                  = new DateTime(_startDate.Year, _startDate.Month, _startDate.Day, (timeInterval * 6) - 1, 59, 59);
         GTSLocationMessageHistory _history = UIGTSTracer.GetTrackerInfoByDate(trackerId, _startDate, _endDate);
         string _serialedMessages           = JsonConvert.SerializeObject(_history);
         return("{\"History\":" + _serialedMessages + "}");
     }
     return("{\"History\": []}");
 }