Search in sources :

Example 81 with GoToOperation

use of operation.GoToOperation in project Money-Manager by krHasan.

the class CashCalculateController method mnuSystemSettings.

@FXML
private void mnuSystemSettings(ActionEvent event) {
    (new TabAccess()).setTabName("tabSystem");
    Stage CashCalculateStage = (Stage) btnSignOut.getScene().getWindow();
    (new GoToOperation()).goToSettings(CashCalculateStage);
}
Also used : Stage(javafx.stage.Stage) GoToOperation(operation.GoToOperation) TabAccess(tab.TabAccess) FXML(javafx.fxml.FXML)

Example 82 with GoToOperation

use of operation.GoToOperation in project Money-Manager by krHasan.

the class CashCalculateController method mnuCreateSource.

@FXML
private void mnuCreateSource(ActionEvent event) {
    (new TabAccess()).setTabName("tabSource");
    Stage CashCalculateStage = (Stage) btnSignOut.getScene().getWindow();
    (new GoToOperation()).goToSettings(CashCalculateStage);
}
Also used : Stage(javafx.stage.Stage) GoToOperation(operation.GoToOperation) TabAccess(tab.TabAccess) FXML(javafx.fxml.FXML)

Example 83 with GoToOperation

use of operation.GoToOperation in project Money-Manager by krHasan.

the class CashCalculateController method btnSignOut.

// /////////////////// Button Function ///////////////////////////
@FXML
private void btnSignOut(ActionEvent event) {
    Stage CashCalculateStage = (Stage) btnSignOut.getScene().getWindow();
    (new GoToOperation()).goToSignIn(CashCalculateStage);
}
Also used : Stage(javafx.stage.Stage) GoToOperation(operation.GoToOperation) FXML(javafx.fxml.FXML)

Example 84 with GoToOperation

use of operation.GoToOperation in project Money-Manager by krHasan.

the class MakeATransactionController method mnuSystemSettings.

@FXML
private void mnuSystemSettings(ActionEvent event) {
    (new TabAccess()).setTabName("tabSystem");
    Stage MakeATransactionStage = (Stage) btnSignOut.getScene().getWindow();
    (new GoToOperation()).goToSettings(MakeATransactionStage);
}
Also used : Stage(javafx.stage.Stage) GoToOperation(operation.GoToOperation) TabAccess(tab.TabAccess) FXML(javafx.fxml.FXML)

Example 85 with GoToOperation

use of operation.GoToOperation in project Money-Manager by krHasan.

the class MakeATransactionController method gmSavebtn.

@FXML
private void gmSavebtn(ActionEvent event) {
    if (amountIsZero(gmtxtAmount.getText())) {
        gmlblWarningMsg.setText("Empty or Zero is not approved.");
    } else {
        try {
            Map<String, String> stringData = new HashMap<>();
            stringData.put("gmTime", timeToSave());
            stringData.put("gmDate", (new DateFormatManager()).toString(gmdateDate.getValue()));
            stringData.put("gmMonth", monthToSave(gmdateDate.getValue()));
            stringData.put("gmAmount", gmtxtAmount.getText());
            if ((gmcmboMethod.getValue()).equals("bKash")) {
                stringData.put("gmBankCharge", bkashBnkCharge(gmtxtAmount.getText(), "Cash In"));
            } else if ((gmcmboMethod.getValue()).equals("Rocket")) {
                stringData.put("gmBankCharge", rocketBnkCharge(gmtxtAmount.getText(), "Cash In", gmGetSelectedrbtnName()));
            } else {
                stringData.put("gmBankCharge", "0.00");
            }
            if ((gmcmboMethod.getValue()).equals("bKash")) {
                stringData.put("gmAmountNature", "Cash In from Agent");
            } else if ((gmcmboMethod.getValue()).equals("Rocket")) {
                stringData.put("gmAmountNature", gmGetSelectedrbtnName());
            } else {
                stringData.put("gmAmountNature", "None");
            }
            if ((gmcmboMethod.getValue()).equals("bKash")) {
                stringData.put("bkBalanceAfter", updatedbKashBalance(gmtxtAmount.getText(), "Cash In"));
                (new Bkash()).saveGmBkashData(stringData);
            } else if ((gmcmboMethod.getValue()).equals("Rocket")) {
                stringData.put("rocBalanceAfter", updatedRocketBalance(gmtxtAmount.getText(), "Cash In", gmGetSelectedrbtnName()));
                (new Rocket()).saveGmRocketData(stringData);
            }
            stringData.put("gmSource", gmcmboSource.getValue());
            if (gmIsDescripionEmpty()) {
                stringData.put("gmDescription", "None");
            } else {
                stringData.put("gmDescription", gmtxtDescription.getText());
            }
            stringData.put("gmMethod", gmcmboMethod.getValue());
            stringData.put("gmWalletBalanceBefore", getWalletBalance());
            if ((gmcmboMethod.getValue()).equals("Hand to Hand")) {
                stringData.put("gmWalletBalanceAfter", gmWalletBalanceAfter(gmtxtAmount.getText()));
                setCurrentWalletBalance(gmWalletBalanceAfter(gmtxtAmount.getText()));
            } else {
                stringData.put("gmWalletBalanceAfter", getWalletBalance());
            }
            (new GetMoney()).saveGetMoneyData(stringData);
            (new ComboboxList()).setAllMonth(monthToSave(gmdateDate.getValue()), yearToSave(gmdateDate.getValue()));
            (new ComboboxList()).setAllGmMonth(monthToSave(gmdateDate.getValue()), yearToSave(gmdateDate.getValue()));
            gmInitialize();
            gmtxtAmount.clear();
            gmtxtDescription.clear();
            Alert confirmationMsg = new Alert(AlertType.INFORMATION);
            confirmationMsg.setTitle("Successfull Transaction");
            confirmationMsg.setHeaderText(null);
            confirmationMsg.setContentText("Successful.");
            Stage MakeATransactionStage = (Stage) gmbtnSave.getScene().getWindow();
            confirmationMsg.setX(MakeATransactionStage.getX() + 200);
            confirmationMsg.setY(MakeATransactionStage.getY() + 29);
            Timeline idlestage = new Timeline(new KeyFrame(Duration.seconds(2), new EventHandler<ActionEvent>() {

                @Override
                public void handle(ActionEvent event) {
                    confirmationMsg.hide();
                }
            }));
            idlestage.setCycleCount(1);
            idlestage.play();
            confirmationMsg.showAndWait();
            (new GoToOperation()).goToDashboard(MakeATransactionStage);
        } catch (Exception e) {
            Alert alert = new Alert(AlertType.WARNING);
            alert.setTitle("Transaction Failed");
            alert.setHeaderText(null);
            alert.setContentText("There something is wrong.");
            Stage MakeATransactionStage = (Stage) gmbtnSave.getScene().getWindow();
            alert.setX(MakeATransactionStage.getX() + 200);
            alert.setY(MakeATransactionStage.getY() + 170);
            Timeline idlestage = new Timeline(new KeyFrame(Duration.seconds(2), new EventHandler<ActionEvent>() {

                @Override
                public void handle(ActionEvent event) {
                    alert.hide();
                }
            }));
            idlestage.setCycleCount(1);
            idlestage.play();
            alert.showAndWait();
        }
    }
}
Also used : HashMap(java.util.HashMap) GetMoney(tab.GetMoney) ActionEvent(javafx.event.ActionEvent) DateFormatManager(system.DateFormatManager) EventHandler(javafx.event.EventHandler) GoToOperation(operation.GoToOperation) Rocket(tab.Rocket) Timeline(javafx.animation.Timeline) ComboboxList(operation.ComboboxList) Bkash(tab.Bkash) Stage(javafx.stage.Stage) KeyFrame(javafx.animation.KeyFrame) Alert(javafx.scene.control.Alert) FXML(javafx.fxml.FXML)

Aggregations

FXML (javafx.fxml.FXML)152 Stage (javafx.stage.Stage)152 GoToOperation (operation.GoToOperation)152 TabAccess (tab.TabAccess)95 Alert (javafx.scene.control.Alert)11 KeyFrame (javafx.animation.KeyFrame)6 Timeline (javafx.animation.Timeline)6 ActionEvent (javafx.event.ActionEvent)6 EventHandler (javafx.event.EventHandler)5 ButtonType (javafx.scene.control.ButtonType)5 HashMap (java.util.HashMap)1 Label (javafx.scene.control.Label)1 TextField (javafx.scene.control.TextField)1 ComboboxList (operation.ComboboxList)1 DateFormatManager (system.DateFormatManager)1 DeleteUserCredentials (system.DeleteUserCredentials)1 Bkash (tab.Bkash)1 GetMoney (tab.GetMoney)1 Rocket (tab.Rocket)1