return the new Id of the created time log event.
tidied code too.
This commit is contained in:
parent
526aca3d58
commit
34b427293a
@ -20,38 +20,12 @@ namespace WindowsDataCenter
|
||||
[Route("")]
|
||||
public IHttpActionResult PostData([FromBody] CardData cData)
|
||||
{
|
||||
//var cardIdQuery = _connection.Query<CardUniqueId>(
|
||||
// "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())
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user