Beispiel #1
0
        private void AddGame_FormClosing(object sender, FormClosingEventArgs e)
        {
            if ((!string.IsNullOrEmpty(nameTextBox.Text)) && (!Compl))
            {
                var SV = new SaveNotSaveDialog();
                switch (SV.ShowDialog())
                {
                case DialogResult.OK:
                    if (AddingGame.ID_Game > 0)
                    {
                        EditButton.PerformClick();
                    }
                    else
                    {
                        AddBut.PerformClick();
                    }
                    break;

                case DialogResult.No:
                    _context.RejectChanges(AddingGame);
                    break;

                case DialogResult.Cancel:
                    e.Cancel = true;
                    break;
                }
            }
            else
            {
                _context.RejectChanges(AddingGame);
            }
        }
Beispiel #2
0
 private void LstBairro_DoubleClick(object sender, EventArgs e)
 {
     if (BairroListBox.SelectedItem == null)
     {
         return;
     }
     EditButton.PerformClick();
 }