예제 #1
0
        public bool Remove(int id)
        {
            var  users = this.GetAll().ToList();
            User user  = users.FirstOrDefault(u => u.Id == id);

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

            users.Remove(user);
            UserAwardDao.RemoveUserAwards(user.Id);
            ImageDao.RemoveUserImage(user.Id, ImageFolder);

            var usersAsTxt = users.Select(UserAsTxt);

            File.WriteAllLines(UsersFilePath, usersAsTxt);

            return(true);
        }
예제 #2
0
 public bool RemoveImage(int id)
 {
     return(ImageDao.RemoveUserImage(id, ImageFolder));
 }