AdmMono/src/com/rjconsultores/ventaboletos/service/impl/TarifaEmbarcadaHistServiceI...

60 lines
2.0 KiB
Java

/*
* 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.TarifaEmbarcadaHistDAO;
import com.rjconsultores.ventaboletos.entidad.TarifaEmbarcadaHist;
import com.rjconsultores.ventaboletos.service.TarifaEmbarcadaHistService;
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
@Service("tarifaEmbarcadaHistService")
public class TarifaEmbarcadaHistServiceImpl implements TarifaEmbarcadaHistService {
@Autowired
private TarifaEmbarcadaHistDAO tarifaEmbarcadaHistDAO;
public List<TarifaEmbarcadaHist> obtenerTodos() {
return tarifaEmbarcadaHistDAO.obtenerTodos();
}
public TarifaEmbarcadaHist obtenerID(Integer id) {
return tarifaEmbarcadaHistDAO.obtenerID(id);
}
@Transactional
public TarifaEmbarcadaHist suscribir(TarifaEmbarcadaHist entidad) {
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
entidad.setFecmodif(Calendar.getInstance().getTime());
entidad.setActivo(Boolean.TRUE);
return tarifaEmbarcadaHistDAO.suscribir(entidad);
}
@Transactional
public TarifaEmbarcadaHist actualizacion(TarifaEmbarcadaHist entidad) {
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
entidad.setFecmodif(Calendar.getInstance().getTime());
entidad.setActivo(Boolean.TRUE);
return tarifaEmbarcadaHistDAO.actualizacion(entidad);
}
@Transactional
public void borrar(TarifaEmbarcadaHist entidad) {
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
entidad.setFecmodif(Calendar.getInstance().getTime());
entidad.setActivo(Boolean.FALSE);
tarifaEmbarcadaHistDAO.borrar(entidad);
}
}