/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.rjconsultores.ventaboletos.service.impl; import com.rjconsultores.ventaboletos.dao.MerchantBancarioDAO; import com.rjconsultores.ventaboletos.entidad.MerchantBancario; import com.rjconsultores.ventaboletos.service.MerchantBancarioService; import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; 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; /** * * @author Rafius */ @Service("merchantBancarioService") public class MerchantBancarioServiceImpl implements MerchantBancarioService { @Autowired private MerchantBancarioDAO merchantBancarioDAO; public List obtenerTodos() { return merchantBancarioDAO.obtenerTodos(); } public MerchantBancario obtenerID(Integer id) { return merchantBancarioDAO.obtenerID(id); } @Transactional public MerchantBancario suscribir(MerchantBancario entidad) { entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); entidad.setFecmodif(Calendar.getInstance().getTime()); entidad.setActivo(Boolean.TRUE); return merchantBancarioDAO.suscribir(entidad); } @Transactional public MerchantBancario actualizacion(MerchantBancario entidad) { entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); entidad.setFecmodif(Calendar.getInstance().getTime()); entidad.setActivo(Boolean.TRUE); return merchantBancarioDAO.actualizacion(entidad); } @Transactional public void borrar(MerchantBancario entidad) { entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); entidad.setFecmodif(Calendar.getInstance().getTime()); entidad.setActivo(Boolean.FALSE); merchantBancarioDAO.actualizacion(entidad); } }