Ejemplo n.º 1
0
 public ServicioSoporte()
 {
     try
     {
         conexion    = new ConexionBD();
         repositorio = new RepositorioSoportes(conexion.AbrirConexion());
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Ejemplo n.º 2
0
 public void Editar(Soporte soporte)
 {
     try
     {
         _conexion    = new ConexionBd();
         _repositorio = new RepositorioSoportes(_conexion.AbrirConexion());
         _repositorio.Editar(soporte);
         _conexion.CerrarConexion();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Ejemplo n.º 3
0
 public void Guardar(Soporte soporte)
 {
     try
     {
         conexion    = new ConexionBD();
         repositorio = new RepositorioSoportes(conexion.AbrirConexion());
         repositorio.Guardar(soporte);
         conexion.CerrarConexion();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Ejemplo n.º 4
0
 public bool EstaRelacionado(Soporte soporte)
 {
     try
     {
         _conexion    = new ConexionBd();
         _repositorio = new RepositorioSoportes(_conexion.AbrirConexion());
         var estaRelacionado = _repositorio.EstaRelacionado(soporte);
         _conexion.CerrarConexion();
         return(estaRelacionado);
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Ejemplo n.º 5
0
 public bool Existe(Soporte soporte)
 {
     try
     {
         _conexion    = new ConexionBd();
         _repositorio = new RepositorioSoportes(_conexion.AbrirConexion());
         var existe = _repositorio.Existe(soporte);
         _conexion.CerrarConexion();
         return(existe);
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Ejemplo n.º 6
0
 public List <Soporte> GetLista()
 {
     try
     {
         _conexion    = new ConexionBd();
         _repositorio = new RepositorioSoportes(_conexion.AbrirConexion());
         var lista = _repositorio.GetLista();
         _conexion.CerrarConexion();
         return(lista);
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }