Esempio n. 1
0
        private void Main_Load(object sender, EventArgs e)
        {
            InitialTemplateInfo();
            InitialSettingInfo();
            if (TestConnection())
            {
                procMetaReader = new SqlServerProcMetaReader(txtCon.Text);
                tableMetaReader = new SqlServerTableMetaReader(txtCon.Text);
                InitialGvProcedures();

                tables = tableMetaReader.GetTables("dbo");
                InitialGvTables(tables);
                InitialGvViews(tables);
            }
        }
Esempio n. 2
0
 private void BtnCon_Click(object sender, EventArgs e)
 {
     if (TestConnection())
     {
         MessageBox.Show("Successful connection!","Connection information");
         procMetaReader = new SqlServerProcMetaReader(txtCon.Text);
         tableMetaReader = new SqlServerTableMetaReader(txtCon.Text);
         tables = tableMetaReader.GetTables("dbo");
         InitialGvProcedures();
         InitialGvTables(tables);
         InitialGvViews(tables);
     }
     else
         MessageBox.Show("Connection failed!");
 }
Esempio n. 3
0
        private void InitialStoreProcedures(object state)
        {
            List<string> selectFiles = RetriveGridViewSelect(gvTemplate, "FullPath","ColCheck");
            int i = 0;
            for (i = 0; i < selectFiles.Count; i++)
            {
                if (Path.GetFileName(selectFiles[i]) != "Biz.tt" && Path.GetFileName(selectFiles[i]) != "Dal.tt" &&
                    Path.GetFileName(selectFiles[i]) != "CSProj.Enum.tt" && Path.GetFileName(selectFiles[i]) != "CSProj.Solution.tt" &&
                    Path.GetFileName(selectFiles[i]) != "Entity.tt" && Path.GetFileName(selectFiles[i]) != "EntityMapping.tt" &&
                    Path.GetFileName(selectFiles[i]) != "Enum.tt")
                    break;
            }
            if (i == selectFiles.Count)
            {
                InitailTables();
                Process();
                return;
            }

            SqlServerProcMetaReader procMetaReader = new SqlServerProcMetaReader(T4Parameters.Default.SqlConnectionString);
            T4Parameters.Default.StoreProcedureParametersMeta = procMetaReader.SpParaMeta;
            T4Parameters.Default.StoreProcedureResultMeta = procMetaReader.SpResultMeta;
            if (procMetaReader.SpFailed.Count > 0)
            {
                StringBuilder spErrorBuilder = new StringBuilder();
                spErrorBuilder.AppendLine(string.Format("{0} store procedure failed", procMetaReader.SpFailed.Count));
                spErrorBuilder.AppendLine("**********************************************************************");
                foreach (var item in procMetaReader.SpFailed)
                {
                    spErrorBuilder.AppendLine(string.Format("Procedure name : {0}", item.Key));
                }
                spErrorBuilder.AppendLine("**********************************************************************");
                OnSetLogHandler(this, new WorkEventArgs(WorkStage.DoWork, "") { ErrorInfo=spErrorBuilder.ToString() });
            }

            InitailTables();
            Process();
        }
Esempio n. 4
0
 public FormSPParameter(string connectionStr)
 {
     this.ConnectionStr = connectionStr;
     reader = new SqlServerProcMetaReader(connectionStr);
     InitializeComponent();
 }