Skip to content

Commit 2d70dae

Browse files
committed
updated salesReport documentation
1 parent 58d4129 commit 2d70dae

File tree

2 files changed

+25
-46
lines changed

2 files changed

+25
-46
lines changed

src/main/ManagerController.java

Lines changed: 23 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import javafx.scene.control.Alert.AlertType;
1212
import javafx.scene.control.TableColumn.CellDataFeatures;
1313
import javafx.util.Callback;
14-
import javafx.scene.control.Alert.AlertType;
14+
1515

1616
public class ManagerController {
1717
private jdbcpostgreSQL db = new jdbcpostgreSQL();
@@ -23,41 +23,25 @@ public class ManagerController {
2323
ObservableList<ObservableList<String>> xReportData = FXCollections.observableArrayList();
2424
ObservableList<ObservableList<String>> zReportData = FXCollections.observableArrayList();
2525

26-
@FXML
27-
private DatePicker startDatePicker;
28-
@FXML
29-
private DatePicker endDatePicker;
30-
@FXML
31-
private DatePicker dateExcessReport;
26+
@FXML private DatePicker startDatePicker;
27+
@FXML private DatePicker endDatePicker;
28+
@FXML private DatePicker dateExcessReport;
3229

33-
@FXML
34-
private TableView inventoryTableView;
35-
@FXML
36-
private TableView restockReportTableView;
37-
@FXML
38-
private TableView menuTableView;
39-
@FXML
40-
private TableView salesReportTableView;
41-
@FXML
42-
private TableView excessReportTableView;
30+
@FXML private TableView inventoryTableView;
31+
@FXML private TableView restockReportTableView;
32+
@FXML private TableView menuTableView;
33+
@FXML private TableView salesReportTableView;
34+
@FXML private TableView excessReportTableView;
4335

44-
@FXML
45-
private TableView xReportTableView;
46-
@FXML
47-
private TableView zReportTableView;
36+
@FXML private TableView xReportTableView;
37+
@FXML private TableView zReportTableView;
4838

49-
@FXML
50-
private TextField newMenuNameField;
51-
@FXML
52-
private TextField newMenuIDField;
53-
@FXML
54-
private TextField newMenuPriceField;
55-
@FXML
56-
private TextField newMenuClassField;
57-
@FXML
58-
private TextField inventoryRestockField;
59-
@FXML
60-
private TextField inventoryReduceField;
39+
@FXML private TextField newMenuNameField;
40+
@FXML private TextField newMenuIDField;
41+
@FXML private TextField newMenuPriceField;
42+
@FXML private TextField newMenuClassField;
43+
@FXML private TextField inventoryRestockField;
44+
@FXML private TextField inventoryReduceField;
6145

6246
public void initialize() {
6347
setTableResult(db.getInventory(), inventoryData, inventoryTableView);
@@ -285,7 +269,7 @@ private void openServerView(ActionEvent event) {
285269
System.out.println("Manager has tried to open the Server View");
286270
try {
287271
Process theProcess = Runtime.getRuntime().exec(
288-
"java --module-path /Users/lwilber/Downloads/javafx-sdk-19.0.2.1/lib --add-modules javafx.controls,javafx.graphics,javafx.media,javafx.fxml Server");
272+
"java --module-path /Users/lwilber/Downloads/javafx-sdk-19.0.2.1/lib --add-modules javafx.controls,javafx.graphics,javafx.media,javafx.fxml Server");
289273
System.out.println("Server View Opened Sucessfully");
290274
} catch (Exception e) {
291275
System.err.println("Failed to open Server View");
@@ -301,11 +285,11 @@ private void setTableResult(ResultSet r, ObservableList<ObservableList<String>>
301285
String colName = r.getMetaData().getColumnName(j + 1);
302286
TableColumn newCol = new TableColumn(colName);
303287
newCol.setCellValueFactory(
304-
new Callback<CellDataFeatures<ObservableList, String>, ObservableValue<String>>() {
305-
public ObservableValue<String> call(CellDataFeatures<ObservableList, String> param) {
306-
return new SimpleStringProperty(param.getValue().get(j).toString());
307-
}
308-
});
288+
new Callback<CellDataFeatures<ObservableList, String>, ObservableValue<String>>() {
289+
public ObservableValue<String> call(CellDataFeatures<ObservableList, String> param) {
290+
return new SimpleStringProperty(param.getValue().get(j).toString());
291+
}
292+
});
309293
table.getColumns().addAll(newCol);
310294
}
311295
if (table.getColumns().get(0) == "") {

src/main/jdbcpostgreSQL.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -489,18 +489,13 @@ public void deleteMenuItem(int id) {
489489
}
490490

491491
/*
492-
* Given a time window, display the sales by item from the order history.
492+
* Given a time window, display the sales and quantities orderered by item from the order history.
493493
*
494494
* @param startTime The start time of the time window
495-
*
496495
* @param endTime The end time of the time window
497496
*
498497
* @return A ResultSet containing the sales report
499-
*
500-
* @brief SQL Table Setup:
501-
* Table orderlineitems: lineItemID int, itemID int, price float, orderID int
502-
* Table order: orderID int, timestamp datetime, employeeID int
503-
*
498+
* @throws Exception if the sql statement fails to execute
504499
*/
505500
public ResultSet getSalesReport(Date startTime, Date endTime) {
506501
ResultSet r = null;

0 commit comments

Comments
 (0)