Esempio n. 1
0
        private void btnGenerate_Click(object sender, EventArgs e)
        {
            if (ThongSo.DB_Mode != DBMS.Oracle && txtDBName.Text == "")
            {
                DevExpress.XtraEditors.XtraMessageBox.Show("Please enter Database name");
                return;
            }

            GenerateDDL   generate   = new GenerateDDL(mdp, ThongSo.DB_Mode, txtDBName.Text);
            List <string> listScript = generate.Process();

            if (ThongSo.DB_GenerateScriptFile)
            {
                if (txtDirectory.Text != "" && txtDBName.Text != "" && txtFileName.Text != "")
                {
                    string urlFileScript = txtDirectory.Text + "\\" + txtFileName.Text + ".sql";
                    SaveScript(urlFileScript, listScript[0] + listScript[1] + listScript[2]);
                    urlFile            = urlFileScript;
                    btnPreview.Enabled = true;
                }
            }
            if (ThongSo.DB_GenerateDirect)
            {
                GenerateDirect(txtDirectory.Text, txtDBName.Text, listScript[1] + listScript[2]);
            }
            btnGenerate.Enabled = false;
        }
Esempio n. 2
0
        private void btnGenerate_Click(object sender, EventArgs e)
        {
            if (ThongSo.DB_Mode != DBMS.Oracle && txtDBName.Text == "")
            {
                DevExpress.XtraEditors.XtraMessageBox.Show("Please enter Database name");
                return;
            }

            GenerateDDL generate = new GenerateDDL(mdp, ThongSo.DB_Mode, txtDBName.Text);
            List<string> listScript = generate.Process();

            if (ThongSo.DB_GenerateScriptFile)
            {
                if (txtDirectory.Text != "" && txtDBName.Text != "" && txtFileName.Text != "")
                {
                    string urlFileScript = txtDirectory.Text + "\\" + txtFileName.Text + ".sql";
                    SaveScript(urlFileScript, listScript[0] + listScript[1] + listScript[2]);
                    urlFile = urlFileScript;
                    btnPreview.Enabled = true;
                }
            }
            if (ThongSo.DB_GenerateDirect)
            {
                GenerateDirect(txtDirectory.Text, txtDBName.Text, listScript[1] + listScript[2]);
            }
            btnGenerate.Enabled = false;
        }