/// <method> /// Get sent messages by user id /// </method> public List <Message> GetSentMessages(int _id) { var messageList = new List <Message>(); Message message; DataTable dataTable = _msgDAO.SearchSentMessages(_id); foreach (DataRow dr in dataTable.Rows) { message = new Message(); message.Id = Int32.Parse(dr["Id"].ToString()); message.From = _userBus.getUserById(Int32.Parse(dr["FromUser"].ToString())); message.To = _userBus.getUserById(Int32.Parse(dr["ToUser"].ToString())); message.When = DateTime.Parse(dr["When"].ToString()); message.File1 = (Byte[])dr["File1"]; message.File2 = (Byte[])dr["File2"]; message.File3 = (Byte[])dr["File3"]; messageList.Add(message); } return(messageList); }