/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.rjconsultores.ventaboletos.service.impl; import java.util.Calendar; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.rjconsultores.ventaboletos.dao.PtovtaAgenciaDAO; import com.rjconsultores.ventaboletos.entidad.PtovtaAgencia; import com.rjconsultores.ventaboletos.service.PtovtaAgenciaService; import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; /** * * @author Desenvolvimento */ @Service("ptovtaAgenciaBancariaService") public class PtovtaAgenciaServiceImpl implements PtovtaAgenciaService { @Autowired private PtovtaAgenciaDAO ptovtaBancoDAO; public List obtenerTodos() { return ptovtaBancoDAO.obtenerTodos(); } public PtovtaAgencia obtenerID(Integer id) { return ptovtaBancoDAO.obtenerID(id); } @Transactional public PtovtaAgencia suscribir(PtovtaAgencia entidad) { entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); entidad.setFecmodif(Calendar.getInstance().getTime()); entidad.setActivo(Boolean.TRUE); return ptovtaBancoDAO.suscribir(entidad); } @Transactional public PtovtaAgencia actualizacion(PtovtaAgencia entidad) { entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); entidad.setFecmodif(Calendar.getInstance().getTime()); entidad.setActivo(Boolean.TRUE); return ptovtaBancoDAO.actualizacion(entidad); } @Transactional public void borrar(PtovtaAgencia entidad) { entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); entidad.setFecmodif(Calendar.getInstance().getTime()); entidad.setActivo(Boolean.FALSE); ptovtaBancoDAO.actualizacion(entidad); } public List buscar(String numagencia) { return ptovtaBancoDAO.buscar(numagencia); } }