168 lines
6.4 KiB
Java
168 lines
6.4 KiB
Java
/*
|
|
* 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 Controllers.DevisClt;
|
|
|
|
import Models.Produit.ListeProduit;
|
|
import Controllers.Traitement.MyWindow;
|
|
import Models.DevisClt.Devis;
|
|
import java.io.IOException;
|
|
import java.net.URL;
|
|
import java.util.ResourceBundle;
|
|
import java.util.logging.Level;
|
|
import java.util.logging.Logger;
|
|
import javafx.event.ActionEvent;
|
|
import javafx.fxml.FXML;
|
|
import javafx.fxml.FXMLLoader;
|
|
import javafx.fxml.Initializable;
|
|
import javafx.scene.Node;
|
|
import javafx.scene.Scene;
|
|
import javafx.scene.control.Button;
|
|
import javafx.scene.control.TableColumn;
|
|
import javafx.scene.control.TableView;
|
|
import javafx.scene.control.cell.PropertyValueFactory;
|
|
import javafx.scene.image.Image;
|
|
import javafx.scene.image.ImageView;
|
|
import javafx.scene.layout.AnchorPane;
|
|
import javafx.scene.layout.StackPane;
|
|
import javafx.scene.text.Text;
|
|
import javafx.stage.Stage;
|
|
|
|
/**
|
|
* FXML Controller class
|
|
*
|
|
* @author PC-Maher
|
|
*/
|
|
public class DevisDialogConfirmationController implements Initializable {
|
|
|
|
/**
|
|
* Initializes the controller class.
|
|
*/
|
|
public Node nodeFxml ;
|
|
|
|
@FXML public AnchorPane AnchorPrincipal ;
|
|
@FXML public Button DevisEnregister ;
|
|
@FXML private Text DevisDateCreation;
|
|
@FXML private Text DevisFinValidite;
|
|
@FXML private Text DevisReglement;
|
|
@FXML private Text DevisNetAPayer;
|
|
@FXML private Text DevisTotalHorsTaxNet;
|
|
@FXML private Text DevisTotalTVA;
|
|
|
|
@FXML private Text DevisTypeClt;
|
|
@FXML private Text DevisNom;
|
|
@FXML private Text DevisPrenom;
|
|
@FXML private Text DevisAdresse;
|
|
@FXML private Text DevisTELE1;
|
|
@FXML private Text DevisTELE2;
|
|
|
|
@FXML private Text DevisTextPrenom ;
|
|
@FXML private Text DevisTextMatricule ;
|
|
|
|
@FXML public TableView<ListeProduit> TableViewListeProduitDevis ;
|
|
@FXML public TableColumn<ListeProduit ,String> TabColDevisReference;
|
|
@FXML public TableColumn<ListeProduit ,String> TabColDevisDesignaton;
|
|
@FXML public TableColumn<ListeProduit ,String> TabColDevisQuantite ;
|
|
@FXML public TableColumn<ListeProduit ,String> TabColDevisPrixHT;
|
|
@FXML public TableColumn<ListeProduit ,String> TabColDevisRemise;
|
|
@FXML public TableColumn<ListeProduit ,String> TabColDevisTotalHT;
|
|
@FXML public TableColumn<ListeProduit ,String> TabColDevisTVA;
|
|
@FXML public TableColumn<ListeProduit ,String> TabColDevisTotalTTC;
|
|
|
|
@Override
|
|
public void initialize(URL url, ResourceBundle rb) {
|
|
|
|
TabColDevisReference.setCellValueFactory(new PropertyValueFactory<ListeProduit, String>("reference"));
|
|
TabColDevisDesignaton.setCellValueFactory(new PropertyValueFactory<ListeProduit, String>("designation"));
|
|
|
|
TabColDevisQuantite.setCellValueFactory(new PropertyValueFactory<ListeProduit, String>("quantite"));
|
|
TabColDevisQuantite.setStyle( "-fx-alignment: CENTER; -fx-font-weight:bold; -fx-font-size: 10pt;");
|
|
TabColDevisQuantite.getStyleClass().add("Center");
|
|
|
|
TabColDevisPrixHT.setCellValueFactory(new PropertyValueFactory<ListeProduit, String>("PrixHT"));
|
|
TabColDevisPrixHT.setStyle( "-fx-alignment: CENTER;");
|
|
TabColDevisPrixHT.getStyleClass().add("Center");
|
|
|
|
TabColDevisRemise.setCellValueFactory(new PropertyValueFactory<ListeProduit, String>("Remise"));
|
|
TabColDevisRemise.setStyle( "-fx-alignment: CENTER;");
|
|
TabColDevisRemise.getStyleClass().add("Center");
|
|
|
|
TabColDevisTotalHT.setCellValueFactory(new PropertyValueFactory<ListeProduit, String>("TotalHT"));
|
|
TabColDevisTotalHT.setStyle( "-fx-alignment: CENTER;");
|
|
TabColDevisTotalHT.getStyleClass().add("Center");
|
|
|
|
TabColDevisTVA.setCellValueFactory(new PropertyValueFactory<ListeProduit, String>("TVA"));
|
|
TabColDevisTVA.setStyle( "-fx-alignment: CENTER;");
|
|
TabColDevisTVA.getStyleClass().add("Center");
|
|
|
|
TabColDevisTotalTTC.setCellValueFactory(new PropertyValueFactory<ListeProduit, String>("TotalTTC"));
|
|
TabColDevisTotalTTC.setStyle( "-fx-alignment: CENTER; -fx-font-weight:bold; -fx-font-size: 10pt;");
|
|
TabColDevisTotalTTC.getStyleClass().add("Center");
|
|
|
|
Image coffeeImage = new Image(getClass().getResourceAsStream("/Public/icon/iconsave.png"));
|
|
ImageView buttonGraphic = new ImageView();
|
|
buttonGraphic.setImage(coffeeImage);
|
|
DevisEnregister.setGraphic(buttonGraphic);
|
|
}
|
|
|
|
public void Getdevis(Devis devis){
|
|
DevisDateCreation.setText(devis.getDate());
|
|
DevisFinValidite.setText(devis.getValidite());
|
|
DevisReglement.setText(devis.getTypeRegement());
|
|
|
|
DevisNetAPayer.setText(devis.getNetAPayer());
|
|
DevisTotalHorsTaxNet.setText(devis.getTotalHorsTaxNet());
|
|
DevisTotalTVA.setText(devis.getTotalTVA());
|
|
|
|
|
|
DevisTypeClt.setText(devis.getTypeClientString());
|
|
DevisNom.setText(devis.getNom());
|
|
DevisPrenom.setText(devis.getPrenom());
|
|
if(DevisAjouterController.TypeClient == 1){
|
|
DevisTextPrenom.setVisible(false);
|
|
DevisTextMatricule.setVisible(true);
|
|
DevisPrenom.setText(devis.getMatricule());
|
|
}
|
|
DevisAdresse.setText(devis.getAdresse());
|
|
DevisTELE1.setText(devis.getTele1());
|
|
DevisTELE2.setText(devis.getTele2());
|
|
|
|
TableViewListeProduitDevis.setItems(devis.getListeproduit());
|
|
}
|
|
|
|
|
|
public DevisDialogConfirmationController(){
|
|
try {
|
|
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/Views/Devis/DevisDialogConfirmation.fxml"));
|
|
fxmlLoader.setController(this);
|
|
nodeFxml = (Node) fxmlLoader.load();
|
|
} catch (IOException ex) {
|
|
Logger.getLogger(DevisDialogConfirmationController.class.getName()).log(Level.SEVERE, null, ex);
|
|
}
|
|
}
|
|
|
|
public void Show()
|
|
{
|
|
StackPane Sp = new StackPane();
|
|
|
|
Scene scene = new Scene(Sp);
|
|
|
|
Sp.setPrefSize((double)MyWindow.PrincipalContentWidth, (double)MyWindow.PrincipalContentHeight);
|
|
|
|
Sp.getChildren().add(MyWindow.myParent);
|
|
Sp.getChildren().add(nodeFxml);
|
|
|
|
Stage stage = MyWindow.myStage;
|
|
stage.setScene(scene);
|
|
stage.show();
|
|
}
|
|
|
|
@FXML
|
|
private void ExitButtonAction(ActionEvent event) throws IOException {
|
|
AnchorPrincipal.setVisible(false);
|
|
}
|
|
|
|
}
|