コード例 #1
0
        private void undo_Click(object sender, RoutedEventArgs e)
        {
            this.Hide();
            Initial i = new Initial();

            i.Show();
        }
コード例 #2
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            this.Hide();
            Initial initial = new Initial();

            initial.Show();
        }
コード例 #3
0
        private void Calculate(object sender, RoutedEventArgs e)
        {
            string text = this.AmountBox.Text;

            if (text == String.Empty)
            {
                FileWriter.Write(User);
                this.Hide();
                Initial initial = new Initial();
                initial.Show();
            }
            else
            {
                this.Amount = Convert.ToDecimal(text);

                if (ExpenseType == 0)
                {
                    MessageBox.Show("You should pick an expence type.");
                }
                if (Initial.Currency == 0)
                {
                    MessageBox.Show("You should pick a currency.");
                }
                else
                {
                    User.AddExpense(new Expense(this.ExpenseType, this.Amount));
                }


                FileWriter.Write(User);
                this.Hide();
                Initial i = new Initial();
                i.Show();
            }
        }