public void saveGatePost(gate_posts gate_post) { if (gate_post.EntityKey == null) contexto.AddTogate_posts(gate_post); contexto.SaveChanges(); }
/// <summary> /// Create a new gate_posts object. /// </summary> /// <param name="id">Initial value of the id property.</param> /// <param name="gate_id">Initial value of the gate_id property.</param> /// <param name="distance">Initial value of the distance property.</param> /// <param name="date">Initial value of the date property.</param> public static gate_posts Creategate_posts(global::System.Int32 id, global::System.Int32 gate_id, global::System.Double distance, global::System.DateTime date) { gate_posts gate_posts = new gate_posts(); gate_posts.id = id; gate_posts.gate_id = gate_id; gate_posts.distance = distance; gate_posts.date = date; return gate_posts; }
/// <summary> /// Deprecated Method for adding a new object to the gate_posts EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddTogate_posts(gate_posts gate_posts) { base.AddObject("gate_posts", gate_posts); }
public void SetGate(int gateId, double distance) { try { OperationContext context = OperationContext.Current; MessageProperties messageProperties = context.IncomingMessageProperties; RemoteEndpointMessageProperty endpointProperty = messageProperties[RemoteEndpointMessageProperty.Name] as RemoteEndpointMessageProperty; gate_posts gate_post = new gate_posts { date = DateTime.Now, gate_id = gateId, distance = distance, ip = endpointProperty.Address }; gatesDao.saveGatePost(gate_post); } catch (Exception e) { throw e; } }