Exemplo n.º 1
0
        private void OnCreateNewDbMenuItemClick(object sender, EventArgs e)
        {
            NewDatabaseForm newDatabaseForm = new NewDatabaseForm(dbContext);

            newDatabaseForm.ShowDialog(this);

            switch (newDatabaseForm.DialogResult)
            {
            case DialogResult.OK:
                // Test if this database can be created!
                if (newDatabaseForm.Database != null)
                {
                    DatabaseTree.Nodes.Add(new TreeNode(newDatabaseForm.Database.Name));
                }
                else
                {
                    MessageBox.Show(Resources.ResourceManager.GetString("DbCreateFail"), Resources.ResourceManager.GetString("DbCreateError"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                break;

            case DialogResult.Cancel:
                //MessageBox.Show("Cancel");
                break;
            }
        }
Exemplo n.º 2
0
        private void OnCreateNewDbMenuItemClick(object sender, EventArgs e)
        {
            NewDatabaseForm newDatabaseForm = new NewDatabaseForm(dbContext);
            newDatabaseForm.ShowDialog(this);

            switch (newDatabaseForm.DialogResult)
            {
                case DialogResult.OK:
                    // Test if this database can be created!
                    if (newDatabaseForm.Database != null)
                    {
                        DatabaseTree.Nodes.Add(new TreeNode(newDatabaseForm.Database.Name));
                    }
                    else
                    {
                        MessageBox.Show(Resources.ResourceManager.GetString("DbCreateFail"), Resources.ResourceManager.GetString("DbCreateError"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    break;
                case DialogResult.Cancel:
                    //MessageBox.Show("Cancel");
                    break;
            }
        }