Example #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);
 }
Example #2
0
 private double getInScalePriceTo(int index)
 => BillScale.GetRange(0, index).Sum(x => x.Amount * x.Price);
Example #3
0
 private double getInScaleAmountTo(int index)
 => BillScale.GetRange(0, index).Sum(x => x.Amount);
Example #4
0
 private double getInScalePrice()
 => BillScale.Where(x => (x is LastScale) == false).Sum(y => y.Amount * y.Price);
Example #5
0
 private double getInScaleAmount()
 => BillScale.Sum(x => x.Amount) - BillScale.Last().Amount;
Example #6
0
 public LastScale GetLastScale() => BillScale.LastOrDefault(x => x is LastScale) as LastScale;