Beispiel #1
0
 public ServicioSoporte()
 {
     try
     {
         conexion    = new ConexionBD();
         repositorio = new RepositorioSoportes(conexion.AbrirConexion());
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
 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);
     }
 }
Beispiel #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);
     }
 }
 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);
     }
 }
 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);
     }
 }
 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);
     }
 }