/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.arrebol.taxiservicios.services.catalog;

import com.arrebol.taxiservicios.beans.TaxiGenericBean;
import com.arrebol.taxiservicios.controller.catalog.ProductBrandController;
import com.arrebol.taxiservicios.model.catalog.Brand;
import java.io.Serializable;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.faces.view.ViewScoped;
import javax.inject.Named;

/**
 *
 * @author oscarvargas
 */
@Named("productBrandService")
@ViewScoped
public class ProductBrandService extends TaxiGenericBean implements Serializable {


    public List<Brand> fillDatatableProductBrand() {

        return productBrandCtrl.fillProductBrandDatatable();
    }

    public boolean saveProductBrandService(Brand brand) {

        return productBrandCtrl.saveProductBrand(brand, getLoggedUser().getId());
    }

    public void deleteProductBrandService(Brand brand) {

        productBrandCtrl.deleteProductBrand(brand);
    }

    private static final long serialVersionUID = -1741643076503545508L;

    private ProductBrandController productBrandCtrl;

    @PostConstruct
    public void init() {
        productBrandCtrl = new ProductBrandController();
    }

}
