private void detach_t_Datens(t_Daten entity) { this.SendPropertyChanging(); entity.t_Tracker = null; }
partial void Deletet_Daten(t_Daten instance);
private void attach_t_Datens(t_Daten entity) { this.SendPropertyChanging(); entity.t_Tracker = this; }
partial void Updatet_Daten(t_Daten instance);
partial void Insertt_Daten(t_Daten instance);
/// <summary> /// Calculate the Tables of t_Data and Insert all needed Entries /// Will be trigered form a 1 sec-Timer /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void CalculateTabels_Elapsed(object sender, ElapsedEventArgs e) { try { DataService.DatabaseDataContext dataContext = new DatabaseDataContext(DB_PATH); List<t_GPS_IN> Positions = dataContext.t_GPS_INs.Where(a => !a.Processed).OrderBy(t => t.TimestampTracker).ToList(); List<t_Tracker> Trackers = dataContext.t_Trackers.ToList(); if (Positions.Count > 0)LogManager.AddLog(DB_PATH, 4, "RecieverService.cs:CalculateTabels_Elapsed:Lists","Positions.Count=" + Positions.Count + " Trackers.count=" + Trackers.Count); foreach (t_Tracker tr in Trackers) { List<t_GPS_IN> Positions_Tracker = Positions.Where(a => a.IMEI == tr.IMEI).OrderBy(a => a.TimestampTracker).ToList(); foreach (t_GPS_IN GPS_IN in Positions_Tracker) { t_Daten InsertData = new t_Daten(); InsertData.ID_Tracker = tr.ID; InsertData.Timestamp = GPS_IN.TimestampTracker; InsertData.Latitude = decimal.Round(ConvertCoordinates(GPS_IN.latitude), 16); InsertData.Longitude = decimal.Round(ConvertCoordinates(GPS_IN.longitude), 16); InsertData.Altitude = decimal.Parse(GPS_IN.altitude); dataContext.t_Datens.InsertOnSubmit(InsertData); GPS_IN.Processed = true; } } dataContext.SubmitChanges(); } catch (Exception ex) { LogManager.AddLog(DB_PATH, 0, "RecieverService.cs:CalculateTabels_Elapsed:Error", ex.ToString()); } }
/// <summary> /// /// </summary> /// <param name="IntervallStart"></param> /// <param name="IntervallEnd"></param> /// <returns></returns> public List<t_Daten> GetPathData(DateTime IntervallStart, DateTime IntervallEnd) { try { DatabaseDataContext dataContext = new DatabaseDataContext(DB_PATH); LogManager.AddLog(DB_PATH, 4, "ANRLDataService.svc.cs:GetPathData", IntervallStart.ToString() + " " + IntervallEnd.ToString()); //@todo ... add delay for anti-cheating-reasons if () { } List<t_Daten> tmp = new List<t_Daten>(); t_Daten tmp_t_Daten = new t_Daten(); foreach (t_Daten t in dataContext.t_Datens.Where(d => d.Timestamp >= IntervallStart && d.Timestamp < IntervallEnd)) { tmp_t_Daten = new t_Daten(); tmp_t_Daten.ID = t.ID; tmp_t_Daten.Timestamp = t.Timestamp; tmp_t_Daten.Latitude = t.Latitude; tmp_t_Daten.Longitude = t.Longitude; tmp_t_Daten.Altitude = t.Altitude; tmp_t_Daten.Speed = t.Speed; tmp_t_Daten.Penalty = t.Penalty; tmp_t_Daten.ID_Polygon = t.ID_Polygon; tmp_t_Daten.ID_Tracker = t.ID_Tracker; tmp.Add(tmp_t_Daten); } return tmp; } catch (Exception ex) { LogManager.AddLog(DB_PATH, 0, "ANRLDataService.svc.cs:GetPathData", ex.ToString()); } return null; }
private void detach_t_Datens(t_Daten entity) { this.SendPropertyChanging(); entity.t_Flugzeug = null; }