Ejemplo n.º 1
0
        private void tleOpen_Click(object sender, EventArgs e)
        {
            if (lblPath.Text == ".")
            {
                MetroMessageBox.Show(this, "Please select a valid folder and file name!", "Create Database", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            DBEngine dbe = new DBEngine();

            myDB = dbe.OpenDatabase(lblPath.Text);
            switch (bound)
            {
            case 1:
                frmTable ft = new frmTable(myDB);
                ft.MdiParent = this.ParentForm;
                ft.Show();
                break;

            case 2:
                frmRelations fr = new frmRelations(myDB);
                fr.MdiParent = this.ParentForm;
                fr.Show();
                break;

            case 3:
                frmView fv = new frmView(myDB);
                fv.MdiParent = this.ParentForm;
                fv.Show();
                break;
            }
            this.Close();
        }
Ejemplo n.º 2
0
        private void tleCreate_Click(object sender, EventArgs e)
        {
            if (lblPath.Text == ".")
            {
                MetroMessageBox.Show(this, "Please select a valid folder and file name!", "Create Database", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (File.Exists(lblPath.Text))
            {
                File.Delete(lblPath.Text);
            }
            DBEngine dbe  = new DBEngine();
            Database myDB = dbe.CreateDatabase(lblPath.Text, DAO.LanguageConstants.dbLangGeneral);

            MetroMessageBox.Show(this, Path.GetFileNameWithoutExtension(myDB.Name) + " was created with success!", "Create Database", MessageBoxButtons.OK, MessageBoxIcon.Information);
            frmTable ft = new frmTable(myDB);

            ft.MdiParent = this.ParentForm;
            ft.Show();
            this.Close();
        }