public void modificarUsuario(string user, string pass, List <string> rolesSeleccionados, string intentosLogin, string userId) { SqlConnection conexion = ServerSQL.instance().levantarConexion(); SqlCommand command = QueryFactory.instance().modificarDatosUsuario(user, pass, intentosLogin, userId, conexion); command.ExecuteNonQuery(); SqlCommand command1 = QueryFactory.instance().borrarRolesUsuario(userId, conexion); command1.ExecuteNonQuery(); for (int i = 0; i < rolesSeleccionados.Count; i++) { int idRol = RepoRol.instance().getIdRol(rolesSeleccionados[i]); SqlCommand command2 = QueryFactory.instance().modificarRolesUsuario(userId, idRol, conexion); command2.ExecuteNonQuery(); } }
public static RepoRol instance() { return(repo == null ? repo = new RepoRol() : repo); }