package Controllers.TraiteClt;

import Models.Caisse.CaisseEntreListe;
import Models.TraiteClt.TraiteCltGestionListe;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.text.Text;

/**
 * FXML Controller class
 * @author Maher Ben Tili
 */
public class TraiteCltPrintRetardController implements Initializable {
    
    @FXML private Text TextNbrTraiteCltRetard ;
    @FXML private Text TextPageTraiteCltRetard ;
    
    @FXML public TableView<TraiteCltGestionListe> TableViewTraiteCltRetard;
    
    @FXML public TableColumn<TraiteCltGestionListe ,String> TabColNumTraite;
    @FXML public TableColumn<TraiteCltGestionListe ,String> TabColDateTraite; 
    @FXML public TableColumn<TraiteCltGestionListe ,String> TabColMontant;
    
    @FXML public TableColumn<TraiteCltGestionListe ,String> TabColFacture;
    @FXML public TableColumn<TraiteCltGestionListe ,String> TabColCodeClt;
    @FXML public TableColumn<TraiteCltGestionListe ,String> TabColLocal;
    @FXML public TableColumn<TraiteCltGestionListe ,String> TabColNomPrenom;
    
    /**
     * Initializes the controller class.
     */
    @Override
    public void initialize(URL url, ResourceBundle rb) {
        TabColNumTraite.setStyle( "-fx-alignment: CENTER;");TabColNumTraite.getStyleClass().add("Center");
        TabColNumTraite.setCellValueFactory(new PropertyValueFactory<TraiteCltGestionListe, String>("NumTraite"));
        
        TabColDateTraite.setStyle( "-fx-alignment: CENTER;");TabColDateTraite.getStyleClass().add("Center");
        TabColDateTraite.setCellValueFactory(new PropertyValueFactory<TraiteCltGestionListe, String>("DateTraite"));
        
        TabColMontant.setStyle( "-fx-alignment: CENTER;");TabColMontant.getStyleClass().add("Center");
        TabColMontant.setCellValueFactory(new PropertyValueFactory<TraiteCltGestionListe, String>("Montant"));
       
        TabColFacture.setStyle( "-fx-alignment: CENTER;");TabColFacture.getStyleClass().add("Center");
        TabColFacture.setCellValueFactory(new PropertyValueFactory<TraiteCltGestionListe, String>("Facture"));
        
        TabColCodeClt.setStyle( "-fx-alignment: CENTER;");TabColCodeClt.getStyleClass().add("Center");
        TabColCodeClt.setCellValueFactory(new PropertyValueFactory<TraiteCltGestionListe, String>("CodeClt"));
        
        TabColLocal.setStyle( "-fx-alignment: CENTER;");TabColLocal.getStyleClass().add("Center");
        TabColLocal.setCellValueFactory(new PropertyValueFactory<TraiteCltGestionListe, String>("TypeClient"));
        
        TabColNomPrenom.setStyle( "-fx-alignment: CENTER;");TabColNomPrenom.getStyleClass().add("Center");
        TabColNomPrenom.setCellValueFactory(new PropertyValueFactory<TraiteCltGestionListe, String>("NomPrenom"));
    } 
    
    
    public void setTraiteCltPrintRetard(
            String NbrTraiteCltRetard, 
            String PageTraiteCltRetard, 
            ObservableList<TraiteCltGestionListe> obsListTraiteCltGestion)
    {
        TextNbrTraiteCltRetard.setText(NbrTraiteCltRetard);
        TextPageTraiteCltRetard.setText(PageTraiteCltRetard);
        TableViewTraiteCltRetard.setItems(obsListTraiteCltGestion);
    }
    
}
