/* * 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.ProdPuntoVentaDAO; import com.rjconsultores.ventaboletos.entidad.ProdPuntoVenta; import com.rjconsultores.ventaboletos.service.ProdPuntoVentaService; 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("prodPuntoVentaService") public class ProdPuntoVentaServiceImpl implements ProdPuntoVentaService { @Autowired private ProdPuntoVentaDAO prodPuntoVentaDAO; public List obtenerTodos() { return prodPuntoVentaDAO.obtenerTodos(); } public ProdPuntoVenta obtenerID(Integer id) { return prodPuntoVentaDAO.obtenerID(id); } @Transactional public ProdPuntoVenta suscribir(ProdPuntoVenta entidad) { entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); entidad.setFecmodif(Calendar.getInstance().getTime()); entidad.setActivo(Boolean.TRUE); return prodPuntoVentaDAO.suscribir(entidad); } @Transactional public ProdPuntoVenta actualizacion(ProdPuntoVenta entidad) { entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); entidad.setFecmodif(Calendar.getInstance().getTime()); entidad.setActivo(Boolean.TRUE); return prodPuntoVentaDAO.actualizacion(entidad); } @Transactional public void borrar(ProdPuntoVenta entidad) { entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); entidad.setFecmodif(Calendar.getInstance().getTime()); entidad.setActivo(Boolean.FALSE); prodPuntoVentaDAO.actualizacion(entidad); } }