Example #1
0
        private void btnStuctGenerate_Click(object sender, EventArgs e)
        {
            try
            {
                StringBuilder sb = new StringBuilder();
                if (cbStructure.Checked)
                {
                    sb.AppendLine("/******* Table Structures *******/ \n");
                    sb.Append(GenerateStructureScript());
                    sb.AppendLine("/******* End Table Structures *******/ \n");
                    sb.Append("\n \n \n \n");
                }

                if (cbData.Checked)
                {
                    sb.AppendLine("/******* Data Script *******/ \n");
                    sb.Append(GenerateDataScript());
                    sb.AppendLine("/******* End Data Script *******/ \n");
                }


                frmScriptViewer frm = new frmScriptViewer(sb.ToString(), "Script-" + DateTime.Now.Ticks);
                frm.Show();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #2
0
        private void GenerateScript(int index)
        {
            string spname = dgvSP.Rows[index].Cells[3].Value.ToString();
            StoredProcedureBusiness spdata = new StoredProcedureBusiness();
            string          spbody         = spdata.GetScript(null, spname);
            frmScriptViewer frm            = new frmScriptViewer(new ScriptHelper().GenerateIndividualScript(spname, spbody, false), spname);

            frm.Show();
        }
Example #3
0
        private void GenerateVersionScript()
        {
            ScriptHelper  spHelper = new ScriptHelper();
            List <string> splist   = new List <string>();

            foreach (DataGridViewRow rw in dgvSP.Rows)
            {
                if (Convert.ToBoolean(rw.Cells[2].Value))
                {
                    splist.Add(rw.Cells[3].Value.ToString());
                }
            }
            string          version_script = spHelper.GenerateVersionScript(splist);
            string          filename       = FileHelper.GenerateDateFile(dtpScriptDate.Value);
            frmScriptViewer frm            = new frmScriptViewer(version_script, filename);

            frm.Show();
        }
Example #4
0
        private void btnStuctGenerate_Click(object sender, EventArgs e)
        {
            try
            {
                StringBuilder sb = new StringBuilder();
                if (cbStructure.Checked)
                {
                    sb.AppendLine("/******* Table Structures *******/ \n");
                    sb.Append(GenerateStructureScript());
                    sb.AppendLine("/******* End Table Structures *******/ \n");
                    sb.Append("\n \n \n \n");
                }

                if (cbData.Checked)
                {
                    sb.AppendLine("/******* Data Script *******/ \n");
                    sb.Append(GenerateDataScript());
                    sb.AppendLine("/******* End Data Script *******/ \n");
                }


                frmScriptViewer frm = new frmScriptViewer(sb.ToString(), "Script-" + DateTime.Now.Ticks);
                frm.Show();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #5
0
 private void GenerateScript(int index)
 {
     string spname = dgvSP.Rows[index].Cells[3].Value.ToString();
     StoredProcedureBusiness spdata = new StoredProcedureBusiness();
     string spbody = spdata.GetScript(null, spname);
     frmScriptViewer frm = new frmScriptViewer(new ScriptHelper().GenerateIndividualScript(spname, spbody,false), spname);
     frm.Show();
 }
Example #6
0
 private void GenerateVersionScript()
 {
     ScriptHelper spHelper = new ScriptHelper();
     List<string> splist = new List<string>();
     foreach (DataGridViewRow rw in dgvSP.Rows)
     {
         if (Convert.ToBoolean(rw.Cells[2].Value))
             splist.Add(rw.Cells[3].Value.ToString());
     }
     string version_script = spHelper.GenerateVersionScript(splist);
     string filename = FileHelper.GenerateDateFile(dtpScriptDate.Value);
     frmScriptViewer frm = new frmScriptViewer(version_script, filename);
     frm.Show();
 }