private void InputMoney() { if (acclist.Id == acc.Id) { if (int.Parse(Input.Text) != 0) { if (int.Parse(Input.Text) > 0) { AccountIolist newaccountio = new AccountIolist() { Balance = acclist.Input + acclist.Balance }; } else { MessageBox.Show("0보다 큰 금액을 주세요"); } } else { MessageBox.Show("0이 아닌 금액을 주세요"); } } else { MessageBox.Show("일치하는 아이디가 엄서요"); } }
public MainWindow() { InitializeComponent(); acc = (Account)FindResource("account"); acclist = (AccountIolist)FindResource("accountiolist"); // Validation.AddErrorHandler(shortNumber, shortNumber_ValidationError); }
private void Button1_Click(object sender, RoutedEventArgs e) { Accountlist accountlist = (Accountlist)FindResource("accountlist"); AccountIolist newaccountio = new AccountIolist() { Id = acclist.Id, Balance = acclist.Balance, Input = acclist.Input }; InputMoney(); accountlist.Add(newaccountio); }