Пример #1
0
        public HttpResponseMessage TestMemeberApplicationPost(LocationData objLocationData)
        {
            log.Debug("Eneter into the TestMemeberApplicationPost");
            Notification objNotifications = new Notification();

            try
            {
                //RecieveDateTime
                using (RTLSDbContext db = new RTLSDbContext())
                {
                    TrackMember objCheckMemeber = new TrackMember();
                    objCheckMemeber.MacAddress      = objLocationData.mac;
                    objCheckMemeber.VisitedDateTime = objLocationData.LastSeenDatetime;
                    objCheckMemeber.PostDateTime    = objLocationData.PostDateTime;
                    objCheckMemeber.RecieveDateTime = DateTime.Now;
                    objCheckMemeber.X = objLocationData.x;
                    objCheckMemeber.Y = objLocationData.y;
                    db.CheckMembers.Add(objCheckMemeber);
                    db.SaveChanges();
                    objNotifications.result.returncode = Convert.ToInt32(FatiApiResult.Success);
                    objNotifications.result.errmsg     = "SuccessFully Created";
                }
            }
            catch (Exception ex)
            {
                objNotifications.result.returncode = Convert.ToInt32(FatiApiResult.Failure);
                objNotifications.result.errmsg     = "Error Occured";
            }
            return(new HttpResponseMessage()
            {
                Content = new StringContent(JsonConvert.SerializeObject(objNotifications), Encoding.UTF8, "application/json")
            });
        }