예제 #1
0
 internal bool changeModLevel(int forumId, int subForumId, string moderatorName, Moderator.modLevel newLevel, ForumGeneratorContext db)
 {
     Moderator moderator = this.getModerator(moderatorName);
     moderator.level = newLevel;
     db.Entry(db.Moderators.Find(moderator.moderatorId)).CurrentValues.SetValues(moderator);
     db.SaveChanges();
     return true;
 }
예제 #2
0
 internal User logout(string userName, string password, ForumGeneratorContext db)
 {
     lock (db)
     {
         User user = getUser(userName).logout(password);
         db.Entry(db.Users.Find(user.memberID)).CurrentValues.SetValues(user);
         db.SaveChanges();
         return user;
     }
 }
예제 #3
0
 internal Discussion editDiscussion(string newContent, ForumGeneratorContext db)
 {
     this.content = newContent;
     //lock (db)
     //{
         db.Entry(db.Discussions.Find(this.discussionId)).CurrentValues.SetValues(this);
         db.SaveChanges();
     //}
     return this;
 }
예제 #4
0
 internal User changeAdmin(int newAdminUserId, ForumGeneratorContext db)
 {
     User currentMember = getUser(newAdminUserId);
     this.admin = currentMember;
     lock (db)
     {
         db.Entry(db.Forums.Find(this.forumId)).CurrentValues.SetValues(this);
         db.SaveChanges();
     }
     return this.admin;
 }