Esempio n. 1
0
        private ForumSystem()
        {
            Forum f1 = new Forum("soccer", 1);
            Forum f2 = new Forum("Barbies", 1);
            Forum f3 = new Forum("Dancing", 1);
            Forum f4 = new Forum("Food", 1);

            SubForum sf1 = new SubForum("Hapoel Beer-Sheva", 1, f1);
            SubForum sf2 = new SubForum("Maccabi Haifa", 2, f1);

            sf1.createNewDiscussion("Dor Alu", new Message("Dor Alu", "Love soccer", "I really like soccer"));

            f1.subForumDict.Add(1, sf1);
            f1.subForumDict.Add(2, sf2);

            UserAccount u1 = new UserAccount("kulik", "1234", f1);
            UserAccount u2 = new UserAccount("maayan", "1234", f2);
            UserAccount u3 = new UserAccount("keren", "1234", f3);
            UserAccount u4 = new UserAccount("ben", "1234", f4);

            forumDict.Add(1, f1);
            forumDict.Add(2, f2);
            forumDict.Add(3, f3);
            forumDict.Add(4, f4);

            _users.Add(u1.UserName, u1);
            _users.Add(u2.UserName, u2);
            _users.Add(u3.UserName, u3);
            _users.Add(u4.UserName, u4);

            f1.addUser(u1);
            f2.addUser(u2);
            f3.addUser(u3);
            f4.addUser(u4);
        }
Esempio n. 2
0
        /**
         *
         * @param ForumId
         * @param subForumId
         * @param subject
         * @param UserId
         */
        public bool newDisscussion(int ForumId, SubForum subf, string subject, string UserId, string title, string content)
        {
            Forum f = findForum(ForumId);

            if (f == null)
            {
                return(false);
            }

            //SubForum sf = f.findSubForum(subForumId);
            return(subf.createNewDiscussion(subject, new Message(subject, title, content)));
        }
Esempio n. 3
0
 public Disscusion(SubForum sf, string subject, Message _opening)
 {
     parentSf     = sf;
     this.subject = subject;
     opening      = _opening;
 }