package com.rjconsultores.ventaboletos.service.impl; import java.util.Calendar; import java.util.Date; 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.EnderecoApanheDAO; import com.rjconsultores.ventaboletos.entidad.EnderecoApanhe; import com.rjconsultores.ventaboletos.service.EnderecoApanheService; import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; @Service("enderecoApanheService") public class EnderecoApanheServiceImpl implements EnderecoApanheService { @Autowired private EnderecoApanheDAO enderecoApanheDAO; public List obtenerTodos() { return enderecoApanheDAO.obtenerTodos(); } public EnderecoApanhe obtenerID(Long id) { return enderecoApanheDAO.obtenerID(id); } @Transactional public EnderecoApanhe suscribir(EnderecoApanhe entidad) { entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); entidad.setFecmodif(Calendar.getInstance().getTime()); entidad.setActivo(Boolean.TRUE); return enderecoApanheDAO.suscribir(entidad); } @Transactional public EnderecoApanhe actualizacion(EnderecoApanhe entidad) { entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); entidad.setFecmodif(Calendar.getInstance().getTime()); entidad.setActivo(Boolean.TRUE); return enderecoApanheDAO.actualizacion(entidad); } @Transactional public void borrar(EnderecoApanhe entidad) { entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); entidad.setFecmodif(Calendar.getInstance().getTime()); entidad.setActivo(Boolean.FALSE); enderecoApanheDAO.actualizacion(entidad); } public List buscar(Date datapacote, String numoperacion) { return enderecoApanheDAO.buscar(datapacote, numoperacion); } }