Example #1
0
        private void buttonCreate_Click(object sender, RoutedEventArgs e)
        {
            if (textBoxName.Text == "" || textBoxAmount.Text == "" || textBoxInterest.Text == "")
            {
                MessageBox.Show("Name, Amount or Interest is empty!");
            }
            else
            {
                string name     = textBoxName.Text;
                double amount   = double.Parse(textBoxAmount.Text);
                double interest = double.Parse(textBoxInterest.Text);
                book = new ClassSavingbook(name);

                book.PayIn(amount);
                book.Interest = interest;

                if (savingsBooks.Contains(book))
                {
                    MessageBox.Show("Name already exists!");
                }
                else
                {
                    savingsBooks.Add(book);
                    listBoxBooks.Items.Refresh();
                    CurrentCapital();
                }
            }
        }
Example #2
0
        private void buttonPayIn_Click(object sender, RoutedEventArgs e)
        {
            if (textBoxAmount.Text == "")
            {
                MessageBox.Show("Amount is empty!");
            }
            else
            {
                double amount = double.Parse(textBoxAmount.Text);

                book.PayIn(amount);
                textBoxCurrentCapital.Text = book.Capital.ToString();
            }
            textBoxAmount.Clear();
        }
Example #3
0
        private void buttonPayIn_Click(object sender, RoutedEventArgs e)
        {
            if (textBoxAmount.Text == "")
            {
                MessageBox.Show("Amount is empty!");
            }
            else
            {
                if ((ClassSavingbook)listBoxBooks.SelectedItem == null)
                {
                    MessageBox.Show("Select a Name!");
                }
                else
                {
                    double amount = double.Parse(textBoxAmount.Text);

                    book.PayIn(amount);
                    listBoxBooks.Items.Refresh();
                    CurrentCapital();
                }
            }
            textBoxAmount.Clear();
        }