Пример #1
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textDescription.Text == "")
     {
         MsgBox.Show(this, "Description is required.");
         return;
     }
     if (_accountCur.Description != textDescription.Text &&
         !MsgBox.Show(this, MsgBoxButtons.YesNo, "This will update the Splits column for all Transactions attached to this account that have a date "
                      + "after the Accounting Lock Date. Are you sure you want to continue?"))
     {
         return;
     }
     _accountCur.Description  = textDescription.Text;
     _accountCur.AcctType     = (AccountType)listAcctType.SelectedIndex;
     _accountCur.BankNumber   = textBankNumber.Text;
     _accountCur.Inactive     = checkInactive.Checked;
     _accountCur.AccountColor = butColor.BackColor;
     if (IsNew)
     {
         Accounts.Insert(_accountCur);
     }
     else
     {
         Accounts.Update(_accountCur, _accountOld);
     }
     DialogResult = DialogResult.OK;
 }
Пример #2
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textDescription.Text == "")
     {
         MsgBox.Show(this, "Description is required.");
         return;
     }
     AccountCur.Description  = textDescription.Text;
     AccountCur.AcctType     = (AccountType)listAcctType.SelectedIndex;
     AccountCur.BankNumber   = textBankNumber.Text;
     AccountCur.Inactive     = checkInactive.Checked;
     AccountCur.AccountColor = butColor.BackColor;
     if (IsNew)
     {
         Accounts.Insert(AccountCur);
     }
     else
     {
         Accounts.Update(AccountCur);
     }
     DialogResult = DialogResult.OK;
 }