Exemplo n.º 1
0
 private int getIndexThatApplyRule()
 {
     for (int i = 0; i < BillScale.Count - 1; i++)
     {
         if (getInScaleAmount(BillScale.GetRange(0, i + 1)) > Amount)
         {
             return(i);
         }
     }
     return(-1);
 }
Exemplo n.º 2
0
 private double getInScalePriceTo(int index)
 => BillScale.GetRange(0, index).Sum(x => x.Amount * x.Price);
Exemplo n.º 3
0
 private double getInScaleAmountTo(int index)
 => BillScale.GetRange(0, index).Sum(x => x.Amount);
Exemplo n.º 4
0
 private double getInScalePrice()
 => BillScale.Where(x => (x is LastScale) == false).Sum(y => y.Amount * y.Price);
Exemplo n.º 5
0
 private double getInScaleAmount()
 => BillScale.Sum(x => x.Amount) - BillScale.Last().Amount;
Exemplo n.º 6
0
 public LastScale GetLastScale() => BillScale.LastOrDefault(x => x is LastScale) as LastScale;