Esempio n. 1
0
        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();
            }
        }
Esempio n. 2
0
 public static RepoRol instance()
 {
     return(repo == null ? repo = new RepoRol() : repo);
 }