AdmMono/src/com/rjconsultores/ventaboletos/service/impl/PlazaServiceImpl.java

66 lines
1.9 KiB
Java

/*
* 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.PlazaDAO;
import com.rjconsultores.ventaboletos.entidad.Plaza;
import com.rjconsultores.ventaboletos.service.PlazaService;
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 rodrigo
*/
@Service("plazaService")
public class PlazaServiceImpl implements PlazaService {
@Autowired
private PlazaDAO plazaDAO;
public List<Plaza> obtenerTodos() {
return plazaDAO.obtenerTodos();
}
public Plaza obtenerID(Integer id) {
return plazaDAO.obtenerID(id);
}
@Transactional
public Plaza suscribir(Plaza entidad) {
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
entidad.setFecmodif(Calendar.getInstance().getTime());
entidad.setActivo(Boolean.TRUE);
return plazaDAO.suscribir(entidad);
}
@Transactional
public Plaza actualizacion(Plaza entidad) {
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
entidad.setFecmodif(Calendar.getInstance().getTime());
entidad.setActivo(Boolean.TRUE);
return plazaDAO.actualizacion(entidad);
}
@Transactional
public void borrar(Plaza entidad) {
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
entidad.setFecmodif(Calendar.getInstance().getTime());
entidad.setActivo(Boolean.FALSE);
plazaDAO.actualizacion(entidad);
}
public List<Plaza> buscar(String nombplaza) {
return plazaDAO.buscar(nombplaza);
}
}