コード例 #1
0
 private void AcceptButton_Click(object sender, RoutedEventArgs e)
 {
     decimal diff = moneyAccepted.Number - _priceOfItems;
     if( diff >= 0 )
     {
         Change theChange = new Change( diff );
         NavigationService.Navigate( new CashPaymentFinished( theChange, m_win ) );
     }
 }
コード例 #2
0
        public CashPaymentFinished(Change changeToGive, RegisterMainWindow win)
        {
            InitializeComponent();

            m_win = win;

            hundreds.Text = changeToGive.hundreds.ToString();
            twenties.Text = changeToGive.twenties.ToString();
            tens.Text = changeToGive.tens.ToString();
            fives.Text = changeToGive.fives.ToString();
            ones.Text = changeToGive.ones.ToString();
            halfdollars.Text = changeToGive.halfdollars.ToString();
            quarters.Text = changeToGive.quarters.ToString();
            dimes.Text = changeToGive.dimes.ToString();
            nickels.Text = changeToGive.nickels.ToString();
            pennies.Text = changeToGive.pennies.ToString();

            ChangeTotal.Text = changeToGive.total;
            ResetRegisterButton.Focus();
        }