/// <method> /// Get received messages by user id /// </method> public List <Message> GetIncomeMessages(int _id) { var messageList = new List <Message>(); Message message; DataTable dataTable = _msgDAO.SearchIncomeMessages(_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["CreateDate"].ToString()); message.File1 = (byte[])dr["File1"]; message.File2 = (byte[])dr["File2"]; message.File3 = (byte[])dr["File3"]; message.IV = (byte[])dr["IV"]; messageList.Add(message); } return(messageList); }