Beispiel #1
0
        } = 10m;                                      // 10m pour preciser qu'il s'agit d'une decimal

        public decimal GetTotal()
        {
            if (!Lignes.Any())
            {
                return(0);
            }
            var totalLignes = Lignes.Sum(x => x.Produit.Prix * x.Quantite); // calcul...
            var fraisPort   = totalLignes > 100 ? 0 : 10;                   // ternaire

            return(totalLignes + FraisPort);
        }
Beispiel #2
0
 private Double FnTotal()
 {
     return(Lignes.Sum(e => e.Cout));
 }
Beispiel #3
0
 private Double FnTotal()
 {
     return(Lignes.Sum(e => e.Choix * e.Qte));
 }