Exemple #1
0
        public void createUser(User user)
        {
            NpgsqlConnection connection = DBConnectionService.getFreeConnection();
            NpgsqlCommand command = new NpgsqlCommand(createUsersCommand, connection);

            // cmd.Parameters.Add(new NpgsqlParameter("pw", tb2.Text));
            command.Parameters.AddWithValue("@login", NpgsqlTypes.NpgsqlDbType.Text, user.login);
            command.Parameters.AddWithValue("@pass", NpgsqlTypes.NpgsqlDbType.Text, user.password);
            command.Parameters.AddWithValue("@nicename", NpgsqlTypes.NpgsqlDbType.Text, user.nicename);
            command.Parameters.AddWithValue("@email", NpgsqlTypes.NpgsqlDbType.Text, user.email);
            command.Parameters.AddWithValue("@url", NpgsqlTypes.NpgsqlDbType.Text, user.url);
            command.Parameters.AddWithValue("@registered", NpgsqlTypes.NpgsqlDbType.TimestampTZ, user.registered);
            command.Parameters.AddWithValue("@activation_key", NpgsqlTypes.NpgsqlDbType.Text, user.activationKey);
            command.Parameters.AddWithValue("@status", NpgsqlTypes.NpgsqlDbType.Integer, user.status);
            command.Parameters.AddWithValue("@display_name", NpgsqlTypes.NpgsqlDbType.Text, user.viewName);
            int result = command.ExecuteNonQuery();

            DBConnectionService.returnConnection(connection);
        }
Exemple #2
0
 public static void updateUser(User user)
 {
     UsersRepository.Singleton.updateUser(user);
 }
Exemple #3
0
 public static void createUser(User user)
 {
     UsersRepository.Singleton.createUser(user);
 }