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