Suppose that you have the following table:
LogID UserID Date Action
1 Bob 2013-05-23 13:30:27 1
2 Bill 2013-05-23 13:31:36 1
3 Bob 2013-05-23 13:32:45 2
4 Bill 2013-05-23 13:35:12 2
You then create a GridView
and populate it with the Date
and Action
columns:
Date Action
2013-05-23 13:30:27 1
2013-05-23 13:31:36 1
2013-05-23 13:32:45 2
2013-05-23 13:35:12 2
What can you do so that (in the GridView
) instead of displaying either 1
or 2
under Action
, it displays Clock-In
or Clock-Out
, respectively?
Thanks in advance!
This is my query (the identifiers are irrelevant to the question). Where can I add a case statement here?
var Entries = from entries in db.EmployeeTimeClocks
where entries.Date.Value.Day == DateTime.Now.Day &&
entries.UserId == AppCommon.Security.CurrentUser.UserId
orderby entries.ID descending
select entries;