示例#1
0
文件: Form1.cs 项目: achilex/MgDev
        //Opens add test form
        private void menuAddTest_Click(object sender, System.EventArgs e)
        {
            if (null != this.database)
            {
                string sqlStmt = "SELECT name FROM sqlite_master WHERE type='table' AND name='TestCase';";

                SqliteVm vm = new SqliteVm(this.database, true);

                if (Sqlite.Row == vm.Execute(sqlStmt))
                {
                    //Hack...if the form is not visible then the user must have closed it->create a new one
                    //If it is visible bring it to focus
                    if (!this.addTestForm.Visible)
                    {
                        this.addTestForm = new SqliteGUI.NewAddTestForm();
                        this.addTestForm.LoadForm(database);
                        this.addTestForm.MdiParent = this;
                        this.addTestForm.Show();
                    }
                    else
                    {
                        this.addTestForm.Activate();
                    }
                }
                else
                {
                    System.Windows.Forms.MessageBox.Show("TestCase table does not exist!",
                                                         "Error",
                                                         System.Windows.Forms.MessageBoxButtons.OK,
                                                         System.Windows.Forms.MessageBoxIcon.Hand);
                }
                vm.SqlFinalize();
            }
        }
示例#2
0
文件: Form1.cs 项目: kanbang/Colt
        public Form1()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
            this.addTestForm = new SqliteGUI.NewAddTestForm();
        }
示例#3
0
文件: Form1.cs 项目: achilex/MgDev
        public Form1()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
            this.addTestForm = new SqliteGUI.NewAddTestForm();
        }
示例#4
0
文件: Form1.cs 项目: kanbang/Colt
        //Opens add test form
        private void menuAddTest_Click(object sender, System.EventArgs e)
        {
            if (null != this.database)
            {
                string sqlStmt = "SELECT name FROM sqlite_master WHERE type='table' AND name='TestCase';";

                SqliteVm vm = new SqliteVm(this.database, true);

                if (Sqlite.Row == vm.Execute(sqlStmt))
                {
                    //Hack...if the form is not visible then the user must have closed it->create a new one
                    //If it is visible bring it to focus
                    if (!this.addTestForm.Visible)
                    {
                        this.addTestForm = new SqliteGUI.NewAddTestForm();
                        this.addTestForm.LoadForm(database);
                        this.addTestForm.MdiParent = this;
                        this.addTestForm.Show();
                    }
                    else
                    {
                        this.addTestForm.Activate();
                    }
                }
                else
                {
                    System.Windows.Forms.MessageBox.Show("TestCase table does not exist!",
                        "Error",
                        System.Windows.Forms.MessageBoxButtons.OK,
                        System.Windows.Forms.MessageBoxIcon.Hand);
                }
                vm.SqlFinalize();
            }
        }