85 lines
2.3 KiB
Java
85 lines
2.3 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.EmpresaImpostoDAO;
|
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
|
import com.rjconsultores.ventaboletos.entidad.EmpresaImposto;
|
|
import com.rjconsultores.ventaboletos.service.EmpresaImpostoService;
|
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
|
|
|
/**
|
|
*
|
|
* @author Administrador
|
|
*/
|
|
@Service("empresaImpostoService")
|
|
public class EmpresaImpostoServiceImpl implements EmpresaImpostoService {
|
|
|
|
@Autowired
|
|
private EmpresaImpostoDAO empresaImpostoDAO;
|
|
|
|
@Transactional
|
|
public EmpresaImposto suscribir(EmpresaImposto entidad) {
|
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
|
entidad.setActivo(Boolean.TRUE);
|
|
|
|
return empresaImpostoDAO.suscribir(entidad);
|
|
}
|
|
|
|
/*
|
|
* (non-Javadoc)
|
|
*
|
|
* @see com.rjconsultores.ventaboletos.service.GenericService#obtenerTodos()
|
|
*/
|
|
@Override
|
|
public List<EmpresaImposto> obtenerTodos() {
|
|
// TODO Auto-generated method stub
|
|
return null;
|
|
}
|
|
|
|
/*
|
|
* (non-Javadoc)
|
|
*
|
|
* @see com.rjconsultores.ventaboletos.service.GenericService#obtenerID(java.lang.Object)
|
|
*/
|
|
@Override
|
|
public EmpresaImposto obtenerID(Integer id) {
|
|
return empresaImpostoDAO.obtenerID(id);
|
|
}
|
|
|
|
@Transactional
|
|
public EmpresaImposto actualizacion(EmpresaImposto entidad) {
|
|
|
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
|
return empresaImpostoDAO.actualizacion(entidad);
|
|
}
|
|
|
|
@Transactional
|
|
public void borrar(EmpresaImposto entidad) {
|
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
|
entidad.setActivo(Boolean.FALSE);
|
|
|
|
empresaImpostoDAO.actualizacion(entidad);
|
|
|
|
}
|
|
|
|
@Override
|
|
public List<EmpresaImposto> buscarByEmpresa(Empresa empresa) {
|
|
return empresaImpostoDAO.buscarByEmpresa(empresa);
|
|
|
|
}
|
|
|
|
}
|