/* * 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.TramoKmServicioDAO; import com.rjconsultores.ventaboletos.entidad.TramoKmServicio; import com.rjconsultores.ventaboletos.service.TramoKmServicioService; import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; /** * * @author Desenvolvimento */ @Service("tramoKmServicioService") public class TramoKmServicioServiceImpl implements TramoKmServicioService { @Autowired private TramoKmServicioDAO tramoKmServicioDAO; public List obtenerTodos() { return tramoKmServicioDAO.obtenerTodos(); } public TramoKmServicio obtenerID(Integer id) { return tramoKmServicioDAO.obtenerID(id); } @Transactional public TramoKmServicio suscribir(TramoKmServicio entidad) { entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); entidad.setFecmodif(Calendar.getInstance().getTime()); entidad.setActivo(Boolean.TRUE); return tramoKmServicioDAO.suscribir(entidad); } @Transactional public TramoKmServicio actualizacion(TramoKmServicio entidad) { entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); entidad.setFecmodif(Calendar.getInstance().getTime()); entidad.setActivo(Boolean.TRUE); return tramoKmServicioDAO.actualizacion(entidad); } @Transactional public void borrar(TramoKmServicio entidad) { entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); entidad.setFecmodif(Calendar.getInstance().getTime()); entidad.setActivo(Boolean.FALSE); tramoKmServicioDAO.actualizacion(entidad); } public List buscar(TramoKmServicio tramoKmServicio) { return tramoKmServicioDAO.buscar(tramoKmServicio); } }