Beispiel #1
0
        public void saveGatePost(gate_posts gate_post)
        {
            if (gate_post.EntityKey == null)
                contexto.AddTogate_posts(gate_post);

            contexto.SaveChanges();
        }
Beispiel #2
0
 /// <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;
 }
Beispiel #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the gate_posts EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTogate_posts(gate_posts gate_posts)
 {
     base.AddObject("gate_posts", gate_posts);
 }
Beispiel #4
0
        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;
            }
        }