示例#1
0
        private void buttonCalculateInterest_Click(object sender, RoutedEventArgs e)
        {
            if (textBoxDuration.Text == "")
            {
                MessageBox.Show("Duration is empty!");
            }
            else
            {
                int duration = int.Parse(textBoxDuration.Text);

                book.CalcInterest(duration);
                textBoxCurrentCapital.Text = book.Capital.ToString();
            }
        }
示例#2
0
 private void buttonCalculateInterest_Click(object sender, RoutedEventArgs e)
 {
     if (textBoxDuration.Text == "")
     {
         MessageBox.Show("Duration is empty!");
     }
     else
     {
         if ((ClassSavingbook)listBoxBooks.SelectedItem == null)
         {
             MessageBox.Show("Select a Name!");
         }
         else
         {
             double duration = int.Parse(textBoxDuration.Text);
             book.CalcInterest(duration);
             CurrentCapital();
         }
         listBoxBooks.Items.Refresh();
     }
 }