public void Register(string userName, string password, int studentId) { var hashedPassword = HashPasswordService.Hash(password); var sql = $"INSERT INTO [User] (Login, PasswordHash, StudentID) VALUES ('{userName}', '{hashedPassword}', {studentId})"; ExecuteNonQueryInternal(sql); }
public void ResetPassword(string userName, string newPassword) { var sql = $"UPDATE [User] SET [PasswordHash] = '{HashPasswordService.Hash(newPassword)}' WHERE [Login] = '{userName}'"; ExecuteNonQueryInternal(sql); }