예제 #1
0
        public void DeleteMeCompletely(Guid userID, string fullName, string email)
        {
            if (CurrentClimber.ID != userID)
            {
                throw new Exception("You can only delete your own account");
            }
            new ClimberProfileDA().DeleteUserCompletely(userID);
            CFLogger.RecordDeleteAccount(userID, fullName, email);

            CFDataCache.FlushClimberFromCache(userID);
        }
예제 #2
0
        public void DeleteUserCompletely(Guid userID)
        {
            if (!IsAdmin)
            {
                throw new Exception("Only admin can delete users");
            }

            new ClimberProfileDA().DeleteUserCompletely(userID);

            CFDataCache.FlushClimberFromCache(userID);
        }
예제 #3
0
        public void SaveClimberProfilePicture(ClimberProfile profile, string imageFileName, byte[] imageBytes)
        {
            ClimberProfileDA da = new ClimberProfileDA();

            string newImageName = ImageManager.SaveRawTypeImage(imageFileName, imageBytes, profile.ID, ImageType.CP);

            profile.ProfilePictureFile = newImageName;

            da.Update(profile);

            CFDataCache.FlushClimberFromCache(profile.ID);
        }
예제 #4
0
        public void SaveClimberProfile(ClimberProfile profile, string fullName, string nickName, bool isMale,
                                       Nation nationality, string climbingLevel, string contactPhoneNumber, bool showMessageBoard)
        {
            ClimberProfileDA da = new ClimberProfileDA();

            profile.FullName            = fullName;
            profile.NickName            = nickName;
            profile.IsMale              = isMale;
            profile.Nationality         = (byte)nationality;
            profile.ClimbingLevel       = climbingLevel;
            profile.ContractPhoneNumber = contactPhoneNumber;
            profile.ClimbingGradeLower  = 1;
            profile.ClimbingGradeUpper  = 2;

            da.Update(profile);

            UpdateMessageBoardVisibility(profile.MessageBoardID, showMessageBoard);

            CFDataCache.FlushClimberFromCache(profile.ID);
        }