コード例 #1
0
        private void btnExecuteScaffodDataAccess_Click(object sender, EventArgs e)
        {
            Report      Report      = new Report();
            Scaffolding scaffolding = new Scaffolding();
            DataSet     ds;

            string tableName  = txtScaffoldDataAccessTable.Text;
            string ns         = txtScaffoldDataAccessNS.Text;
            bool   isEntireDB = chkScaffoldDataAccessEntireDB.Checked;

            if (isEntireDB)
            {
                Report.OpenConnections();
                ds = Report.retrieve_db_table_summary();
                Report.CloseConnections();

                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    scaffolding.buildDataAccess((string)row["table_name"], ns);
                }
            }
            else
            {
                scaffolding.buildDataAccess(tableName, ns);
            }

            MessageBox.Show("Complete!");
        }
コード例 #2
0
        private void btnExecuteScaffoldSQLSP_Click(object sender, EventArgs e)
        {
            Report      Report      = new Report();
            Scaffolding scaffolding = new Scaffolding();
            DataSet     ds;
            string      table_name = txtScaffoldSQLSPTable.Text;

            txtScaffoldSQLSPOutput.Text = "";
            string output = "";

            if (table_name == "")
            {
                //entire db
                Report.OpenConnections();
                ds = Report.retrieve_db_table_summary();
                Report.CloseConnections();

                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    output = output + scaffolding.WriteSQLSP((string)row["table_name"]);
                }
            }
            else
            {
                //just this table
                output = scaffolding.WriteSQLSP(table_name);
            }

            txtScaffoldSQLSPOutput.Text = output;
        }