public List<InboxDTO> getInboxMessagesByDate(DateTime date) { List<InboxDTO> inboxDtoList = new List<InboxDTO>(); InboxDAO inboxDao = new InboxDAO(); List<InboxDTO> inboxList = inboxDao.findAll(); foreach (InboxDTO inboxDto in inboxList) { if (inboxDto.date.Equals(date)) { inboxDtoList.Add(inboxDto); } } return inboxDtoList; }
public List<InboxDTO> getInboxMessagesByUsername(String username) { List<InboxDTO> inboxDtoList = new List<InboxDTO>(); InboxDAO inboxDao = new InboxDAO(); List<InboxDTO> inboxList = inboxDao.findAll(); foreach (InboxDTO inboxDto in inboxList) { if (inboxDto.userName.Equals(username)) { inboxDtoList.Add(inboxDto); } } return inboxDtoList; }
public List<InboxDTO> getUserUnreadInboxMessages(String username) { List<InboxDTO> inboxDtoList = new List<InboxDTO>(); InboxDAO inboxDao = new InboxDAO(); List<InboxDTO> inboxList = inboxDao.findAll(); foreach (InboxDTO inboxDto in inboxList) { if (inboxDto.unread.Equals("unread")) { inboxDtoList.Add(inboxDto); } } return inboxDtoList; }