public static void InsertPosition(string imei, Position position) { try { var tracker = TrackerLogic.GetTracker(imei); if (tracker == null) return; InsertPosition(tracker, position); } catch (Exception ex) { Debug.WriteLine("StealME.MessageType:" + ex.Message); } }
public static void InsertPosition(Tracker tracker, Position position) { try { position.TrackerId = new Guid("5B9BA752-284E-4B85-BB80-992D610CD806"); position.Id = Guid.NewGuid(); position.CreationDate = DateTime.Now; var context = DataHandler.GetContext(); context.Position.AddObject(position); context.SaveChanges(); SMLogger.LogThis("Position inserted."); } catch (Exception ex) { Debug.WriteLine("StealME.MessageType:" + ex.Message); } }
partial void DeletePosition(Position instance);
partial void UpdatePosition(Position instance);
partial void InsertPosition(Position instance);
private void detach_Positions(Position entity) { this.SendPropertyChanging(); entity.Tracker = null; }
private void attach_Positions(Position entity) { this.SendPropertyChanging(); entity.Tracker = this; }
/// <summary> /// Deprecated Method for adding a new object to the Position EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToPosition(Position position) { base.AddObject("Position", position); }
/// <summary> /// Create a new Position object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="trackerId">Initial value of the TrackerId property.</param> /// <param name="creationDate">Initial value of the CreationDate property.</param> /// <param name="latitude">Initial value of the Latitude property.</param> /// <param name="longtitude">Initial value of the Longtitude property.</param> public static Position CreatePosition(global::System.Guid id, global::System.Guid trackerId, global::System.DateTime creationDate, global::System.String latitude, global::System.String longtitude) { Position position = new Position(); position.Id = id; position.TrackerId = trackerId; position.CreationDate = creationDate; position.Latitude = latitude; position.Longtitude = longtitude; return position; }