public void AddMessageTest()
 {
     //int AddMessage(int moduleId, int parentId, String userName, String title, String body)
     DesktopModulesFacade facade = new DesktopModulesFacade();
     PortalDiscussion discussion = new PortalDiscussion();
     discussion.ModuleID = 0;
     discussion.CreatedByUser = "******";
     discussion.Title = "t";
     discussion.Body = "b";
     facade.AddMessage(discussion, 0);
 }
        public int AddMessage(PortalDiscussion discussion, int parentId)
        {
            // TODO: add access security here..
            // TODO: add argument validation here..

            int retval;
            // Run within the context of a database transaction.
            // The Decorator Design Pattern.
            using (TransactionDecorator transaction = new TransactionDecorator())
            {
                retval = discussionDAO.AddMessage(discussion.ModuleID, parentId,
                                                  discussion.CreatedByUser, discussion.Title, discussion.Body);
                transaction.Complete();
            }
            return retval;
        }