68 lines
2.2 KiB
Java
68 lines
2.2 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.PricingClaseDAO;
|
|
import com.rjconsultores.ventaboletos.entidad.ClaseServicio;
|
|
import com.rjconsultores.ventaboletos.entidad.Pricing;
|
|
import com.rjconsultores.ventaboletos.entidad.PricingClase;
|
|
import com.rjconsultores.ventaboletos.service.PricingClaseService;
|
|
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 Rafius
|
|
*/
|
|
@Service("pricingClaseService")
|
|
public class PricingClaseServiceImpl implements PricingClaseService {
|
|
|
|
@Autowired
|
|
private PricingClaseDAO pricingClaseDAO;
|
|
|
|
public List<PricingClase> obtenerTodos() {
|
|
return pricingClaseDAO.obtenerTodos();
|
|
}
|
|
|
|
public PricingClase obtenerID(Integer id) {
|
|
return pricingClaseDAO.obtenerID(id);
|
|
}
|
|
|
|
@Transactional
|
|
public PricingClase suscribir(PricingClase entidad) {
|
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
|
entidad.setActivo(Pricing.ATIVO);
|
|
|
|
return pricingClaseDAO.suscribir(entidad);
|
|
}
|
|
|
|
@Transactional
|
|
public PricingClase actualizacion(PricingClase entidad) {
|
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
|
entidad.setActivo(Pricing.ATIVO);
|
|
|
|
return pricingClaseDAO.actualizacion(entidad);
|
|
}
|
|
|
|
@Transactional
|
|
public void borrar(PricingClase entidad) {
|
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
|
entidad.setActivo(Pricing.EXCLUIDO);
|
|
|
|
pricingClaseDAO.actualizacion(entidad);
|
|
}
|
|
|
|
public Boolean obtenerPricingClase(Pricing pricing, ClaseServicio claseServicio) {
|
|
return pricingClaseDAO.obtenerPricingClase(pricing, claseServicio);
|
|
}
|
|
}
|