Exemplo n.º 1
0
        /// <method>
        /// Get Message By Id
        /// </method>
        public Message GetMessageById(int _id)
        {
            Message   message   = new Message();
            DataTable dataTable = new DataTable();

            dataTable = _msgDAO.SearchById(_id);

            foreach (DataRow dr in dataTable.Rows)
            {
                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"];
            }
            return(message);
        }