public void ModificaUser(string dni, string nombre, string email, string password, string tit, int codHorarios, string avat, string frase)
{
CADTitulacion titu = new CADTitulacion();
if (!titu.Exists(tit))
{
titu.CrearTitulacion(tit);
}
string comando = "UPDATE [User] SET nombre = '" + nombre + "', email = '" + email + "', password = '" + password + "', titulacion = '" + tit + "', codHorarios = '"+ codHorarios + "', avatar = '" + avat + "', frase = '" + frase + "' WHERE dni = '" + dni + "'";
SqlConnection c = null;
SqlCommand comandoTBD;
try
{
c = new SqlConnection(conexionTBD);
comandoTBD = new SqlCommand(comando, c);
c.Open();
comandoTBD.CommandType = CommandType.Text;
comandoTBD.ExecuteNonQuery();
}
catch (SqlException)
{
throw;
}
finally
{
if (c != null) c.Close(); // Se asegura de cerrar la conexión.
}
}