示例#1
0
 private void RoundSelectors()
 {
     if (AutoRoundValue != 0 && RemainingTotal > 0)
     {
         var amount = 0m;
         foreach (var selector in Selectors)
         {
             var price    = selector.Price;
             var newPrice = decimal.Round(price / AutoRoundValue, MidpointRounding.AwayFromZero) * AutoRoundValue;
             selector.Price = newPrice;
             amount        += (newPrice * selector.RemainingQuantity);
         }
         var mLast = Selectors.Where(x => x.RemainingQuantity > 0).OrderBy(x => x.RemainingPrice).First();
         mLast.Price += ((SelectedTicket.GetSum() / ExchangeRate) - amount) / mLast.RemainingQuantity;
     }
 }