diff --git a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Controllers/SwipeDataController.cs b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Controllers/SwipeDataController.cs index 3e5bc87..b2230de 100644 --- a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Controllers/SwipeDataController.cs +++ b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Controllers/SwipeDataController.cs @@ -20,38 +20,12 @@ namespace WindowsDataCenter [Route("")] public IHttpActionResult PostData([FromBody] CardData cData) { - //var cardIdQuery = _connection.Query( - // "select * from CardUniqueIds where CardUId = ?", - // cData.CardUId); - - //var userId = 0; - //if (!cardIdQuery.Any()) - //{ - // //new card, create it! - // userId = _connection.Insert(new CardUniqueId() - // { - // UserId_FK = -1, - // CardUId = cData.CardUId - // }); - //} - //else - //{ - // userId = cardIdQuery.First().UserId_FK; - //} - - //var timeLog = new TimeLog - //{ - // SwipeEventDateTime = DateTime.UtcNow, - // UserId_FK = userId - //}; - - //var tLogId = _connection.Insert(timeLog); - //TODO: TEST - _repo.LogEventTime(new Identifier {UniqueId = cData.CardUId}); + int logId; + _repo.LogEventTime(new Identifier {UniqueId = cData.CardUId}, out logId); return ResponseMessage(new HttpResponseMessage(HttpStatusCode.OK) { - Content = new StringContent("TODO: return ID") + Content = new StringContent(logId.ToString()) }); }