Adding PurchaseOrder(view only)

This commit is contained in:
Nikitha
2026-02-23 16:09:53 -07:00
parent 4fcaa7f2eb
commit 287995b22c
6 changed files with 168 additions and 0 deletions

View File

@@ -41,6 +41,9 @@ public class MainLayoutController {
@FXML
private Button btnSalesHistory;
@FXML
private Button btnPurchaseOrders;
@FXML
private Button btnServices;
@@ -98,6 +101,12 @@ public class MainLayoutController {
updateButtons(btnSalesHistory);
}
@FXML
void btnPurchaseOrdersClicked() {
loadView("purchase-order-view.fxml");
updateButtons(btnPurchaseOrders);
}
@FXML
void btnServicesClicked(ActionEvent event) {
loadView("service-view.fxml");
@@ -108,8 +117,11 @@ public class MainLayoutController {
void btnSuppliersClicked(ActionEvent event) {
loadView("supplier-view.fxml");
updateButtons(btnSuppliers);
}
@FXML
void btnLogoutClicked(ActionEvent event) {
// Logout clears session state before returning to the login view.

View File

@@ -0,0 +1,27 @@
package org.example.petshopdesktop.controllers;
import javafx.fxml.FXML;
import javafx.scene.control.*;
public class PurchaseOrderController {
@FXML private Button btnRefresh;
@FXML private TextField txtSearch;
@FXML private TableView<?> tvPurchaseOrders;
@FXML private TableColumn<?, ?> colOrderId;
@FXML private TableColumn<?, ?> colSupplier;
@FXML private TableColumn<?, ?> colOrderDate;
@FXML private TableColumn<?, ?> colStatus;
@FXML
public void initialize() {
// View-only page for now
}
@FXML
void btnRefresh() {
// Later: reload data
}
}

View File

@@ -0,0 +1,4 @@
package org.example.petshopdesktop.database;
public class PurchaseOrderDB {
}

View File

@@ -0,0 +1,39 @@
package org.example.petshopdesktop.models;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleStringProperty;
public class PurchaseOrder {
private SimpleIntegerProperty orderId;
private SimpleStringProperty supplierName;
private SimpleStringProperty orderDate;
private SimpleStringProperty status;
public PurchaseOrder(int orderId,
String supplierName,
String orderDate,
String status) {
this.orderId = new SimpleIntegerProperty(orderId);
this.supplierName = new SimpleStringProperty(supplierName);
this.orderDate = new SimpleStringProperty(orderDate);
this.status = new SimpleStringProperty(status);
}
public int getOrderId() {
return orderId.get();
}
public String getSupplierName() {
return supplierName.get();
}
public String getOrderDate() {
return orderDate.get();
}
public String getStatus() {
return status.get();
}
}