package com.ecep.contract.controller.contract;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.ecep.contract.controller.AbstManagerWindowController;
import com.ecep.contract.service.ContractInvoiceService;
import com.ecep.contract.util.FxmlPath;
import com.ecep.contract.vm.ContractInvoiceViewModel;
import com.ecep.contract.vo.ContractInvoiceVo;

import javafx.scene.control.TableColumn;
import javafx.stage.Stage;

@Lazy
@Scope("prototype")
@Component
@FxmlPath("/ui/contract/contract-invoice-manager.fxml")
public class ContractInvoiceManagerWindowController extends AbstManagerWindowController<ContractInvoiceVo, ContractInvoiceViewModel, ContractInvoiceManagerSkin> {

    public TableColumn<ContractInvoiceViewModel, Number> idColumn;
    public TableColumn<ContractInvoiceViewModel, String> codeColumn;
    public TableColumn<ContractInvoiceViewModel, String> nameColumn;
    public TableColumn<ContractInvoiceViewModel, Integer> contractColumn;
    public TableColumn<ContractInvoiceViewModel, Integer> contractItemColumn;

    @Autowired
    private ContractInvoiceService contractInvoiceService;

    @Override
    public ContractInvoiceService getViewModelService() {
        return contractInvoiceService;
    }

    @Override
    protected ContractInvoiceManagerSkin createDefaultSkin() {
        ContractInvoiceManagerSkin skin = new ContractInvoiceManagerSkin(this);
        return skin;
    }

    @Override
    public void show(Stage stage) {
        super.show(stage);
        getTitle().set("合同发票管理");
    }
}