mirror of
https://github.com/klmp200/PQT_Gestionnaire_vente_stock.git
synced 2024-11-17 05:43:21 +00:00
Module Client, clss GUIStringTool : modification du renderer de produit
This commit is contained in:
parent
0ec1f69bb5
commit
d6c9e58519
@ -36,9 +36,17 @@ public class GUIStringTool {
|
|||||||
|
|
||||||
public static IObjectStringRenderer<Product> getDetailledProductStringRenderer(){
|
public static IObjectStringRenderer<Product> getDetailledProductStringRenderer(){
|
||||||
return product->{
|
return product->{
|
||||||
if(product!=null)
|
if(product!=null){
|
||||||
return String.format("%s - %.2f€ (%s)", product.getName(), product.getPrice(), (product.getAmountRemaining()>=30?"30+": Integer.toString(product.getAmountRemaining())));
|
String amountStr;
|
||||||
else
|
if(product.getAmountRemaining()<=0){
|
||||||
|
amountStr = "OUT OF STOCK";
|
||||||
|
}else if(product.getAmountRemaining()>=30){
|
||||||
|
amountStr = "30+";
|
||||||
|
}else{
|
||||||
|
amountStr = Integer.toString(product.getAmountRemaining());
|
||||||
|
}
|
||||||
|
return String.format("%s - %.2f€ (%s)", product.getName(), product.getPrice(), amountStr);
|
||||||
|
}else
|
||||||
return "null";
|
return "null";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user