Module Client, écran SaleScreen : le nom du compte actuellement connecté est désormais correctement mis à jour à la connexion

This commit is contained in:
Notmoo-PC\Notmoo 2017-11-02 18:06:48 +01:00
parent a179081501
commit 563154eb30
3 changed files with 10 additions and 0 deletions

View File

@ -43,6 +43,7 @@ class SaleScreenController {
@Override
public void onAccountConnectedStateUpdatedEvent() {
updateActionLock();
view.setCurrentAccount(model.getCurrentAccount());
}
@Override

View File

@ -31,6 +31,7 @@ class SaleScreenModel {
private SaleBuilder currentSaleBuilder;
private long tempSaleId;
private Object currentAccount;
SaleScreenModel(AccountService accountService, StockService stockService, SaleService saleService) {
if(accountService==null || stockService==null || saleService==null)
@ -228,4 +229,8 @@ class SaleScreenModel {
else
return AccountLevel.getLowest();
}
public Account getCurrentAccount() {
return accountService.getCurrentAccount();
}
}

View File

@ -221,4 +221,8 @@ class SaleScreenView implements IFXComponent {
void setValidationButtonEnabled(boolean validationButtonEnabled) {
validator.setValidationButtonEnable(validationButtonEnabled);
}
public void setCurrentAccount(Account currentAccount) {
Platform.runLater(()->saleMakerAccountDisplayer.setText(GUIStringTool.getAccountStringConverter().toString(currentAccount)));
}
}