/*
 * 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.CarBrandController;
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("carBrandService")
@ViewScoped
public class CarBrandService extends TaxiGenericBean implements Serializable {


    public List<Brand> fillDatatableCarBrand() {

        return carBrandCtrl.fillCarBrandDatatable();
    }

    public void saveCarBrandService(Brand brand) {

        carBrandCtrl.saveCarBrand(brand, getLoggedUser().getId());
    }

    public void deleteCarBrandService(Brand brand) {

        carBrandCtrl.deleteCarBrand(brand);
    }

    private static final long serialVersionUID = 2875741893930188757L;

    private CarBrandController carBrandCtrl;

    @PostConstruct
    public void init() {
        carBrandCtrl = new CarBrandController();
    }

}
