Exemplo n.º 1
0
        private void frmInvestimentos_FormClosing(object sender, FormClosingEventArgs e)
        {
            Settings.Default.InvestimentosUltimaConta = (int)toolStripComboBoxConta.ComboBox.SelectedValue;
            Settings.Default.Save();

            if (!_ctx.ChangeTracker.HasChanges())
            {
                return;
            }

            switch (MessageBox.Show($"{_ctx.TextoSalvar()}?", @"Investimentos",
                                    MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question))
            {
            case DialogResult.Yes:
                _ctx.SaveChanges();
                break;

            case DialogResult.Cancel:
                e.Cancel = true;
                break;

            default:
                break;     // do nothing
            }
        }
Exemplo n.º 2
0
 private void dgvBalance_RowValidated(object sender, DataGridViewCellEventArgs e)
 {
     buttonSave.Text    = _ctx.TextoSalvar();
     buttonSave.Visible = buttonDesfazer.Visible = _ctx.ModifiedAny;
 }