public RatingInfo(User user)
     : this(user.Rating)
 {
     if (user.IsAdmin)
     {
         Caption = "管理员(Administrator)";
         Color = "#000000";
     }
 }
Exemple #2
0
 /// <summary>
 /// 为指定用户组增加用户
 /// </summary>
 /// <param name="grp"></param>
 /// <param name="user"></param>
 /// <exception cref="PermissionDeniedException"></exception>
 public void AddUser(User user)
 {
     CheckPriviledge();
     using (var db = new CHDB())
     {
         (from u in db.USERs
          where u.ID==user.ID
          select u).Single().GROUPs.Add
          (
             (from g in db.GROUPs
             where g.ID==ID
             select g).Single()
             );
         db.SaveChanges();
     }
 }