67 lines
2.2 KiB
Java
67 lines
2.2 KiB
Java
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.PricingOcupaAntecipaDAO;
|
|
import com.rjconsultores.ventaboletos.entidad.Pricing;
|
|
import com.rjconsultores.ventaboletos.entidad.PricingOcupaAntecipa;
|
|
import com.rjconsultores.ventaboletos.service.PricingOcupaAntecipaService;
|
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
|
|
|
@Service("pricingOcupacionService")
|
|
public class PricingOcupaAntecipaServiceImpl implements PricingOcupaAntecipaService {
|
|
|
|
@Autowired
|
|
private PricingOcupaAntecipaDAO pricingOcupacionDAO;
|
|
|
|
public List<PricingOcupaAntecipa> obtenerTodos() {
|
|
return pricingOcupacionDAO.obtenerTodos();
|
|
}
|
|
|
|
public PricingOcupaAntecipa obtenerID(Integer id) {
|
|
return pricingOcupacionDAO.obtenerID(id);
|
|
}
|
|
|
|
@Transactional
|
|
public PricingOcupaAntecipa suscribir(PricingOcupaAntecipa entidad) {
|
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
|
entidad.setActivo(Pricing.ATIVO);
|
|
|
|
return pricingOcupacionDAO.suscribir(entidad);
|
|
}
|
|
|
|
@Transactional
|
|
public PricingOcupaAntecipa actualizacion(PricingOcupaAntecipa entidad) {
|
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
|
entidad.setActivo(Pricing.ATIVO);
|
|
|
|
return pricingOcupacionDAO.actualizacion(entidad);
|
|
}
|
|
|
|
@Transactional
|
|
public void borrar(PricingOcupaAntecipa entidad) {
|
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
|
entidad.setActivo(Pricing.EXCLUIDO);
|
|
|
|
pricingOcupacionDAO.actualizacion(entidad);
|
|
}
|
|
|
|
@Override
|
|
public Boolean podeSalvar(Pricing pricing, PricingOcupaAntecipa pricingOcupaAntecipa) {
|
|
return pricingOcupacionDAO.podeSalvar(pricing, pricingOcupaAntecipa);
|
|
}
|
|
|
|
@Override
|
|
public List<PricingOcupaAntecipa> obtenerPorPricing(Pricing pricing) {
|
|
return pricingOcupacionDAO.podeSalvar(pricing);
|
|
}
|
|
}
|