Ejemplo n.º 1
0
        private void Generate()
        {
            if (string.IsNullOrEmpty(this.txtNameSpace.Text.Trim()))
            {
                MessageBox.Show("命名空间不能为空.");
                return;
            }
            string connectionString = DBHelper.ConnectionString;

            if (string.IsNullOrWhiteSpace(connectionString))
            {
                connectionString = txtConnectionStr.Text.Trim();
            }

            List <string> selectedTables = new List <string>();

            if (TxtIncludeTables.Text != "")
            {
                var array = TxtIncludeTables.Text.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
                selectedTables.AddRange(array);
            }

            EngineerCodeFirstHandler codeEngineer = new EngineerCodeFirstHandler();

            codeEngineer.CodeGenerator(connectionString, txtNameSpace.Text.Trim(), ShowMsg, selectedTables);
        }
Ejemplo n.º 2
0
        private void btnGenerate_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(this.txtNameSpace.Text.Trim()))
            {
                MessageBox.Show("命名空间不能为空.");
                return;
            }
            string connectionString = DBHelper.ConnectionString;

            if (string.IsNullOrWhiteSpace(connectionString))
            {
                connectionString = txtConnectionStr.Text.Trim();
            }
            EngineerCodeFirstHandler codeEngineer = new EngineerCodeFirstHandler();

            codeEngineer.CodeGenerator(connectionString, txtNameSpace.Text.Trim(), ShowMsg);
        }
Ejemplo n.º 3
0
        private void Generate(bool completedRun)
        {
            if (string.IsNullOrEmpty(this.txtNameSpace.Text.Trim()))
            {
                MessageBox.Show("命名空间不能为空.");
                return;
            }
            string connectionString = DBHelper.ConnectionString;

            if (string.IsNullOrWhiteSpace(connectionString))
            {
                connectionString = txtConnectionStr.Text.Trim();
            }
            EngineerCodeFirstHandler codeEngineer = new EngineerCodeFirstHandler();

            codeEngineer.CodeGenerator(connectionString, txtNameSpace.Text.Trim(), ShowMsg, completedRun);
        }