コード例 #1
0
ファイル: GatesDao.cs プロジェクト: tassotirap/ep1_movel
        public void saveGatePost(gate_posts gate_post)
        {
            if (gate_post.EntityKey == null)
                contexto.AddTogate_posts(gate_post);

            contexto.SaveChanges();
        }
コード例 #2
0
ファイル: Ep1.Designer.cs プロジェクト: tassotirap/ep1_movel
 /// <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;
 }
コード例 #3
0
ファイル: Ep1.Designer.cs プロジェクト: tassotirap/ep1_movel
 /// <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);
 }
コード例 #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;
            }
        }