private void buildDisplaySQL(string strwhere, decimal decValue) { string strSQL = ""; strSQL = "Database Name: " + TB.DBName + '\n' + "Table Name: " + TB.TBName + '\n' + "Calculation Name: " + TBFormulas.CalcName + " Formula Name: " + TBFormulas.TableFormulaCall + " = " + decValue + '\n' + '\n' + '\n' + TBFormulas.A + TBFormulas.B + TBFormulas.C + TBFormulas.D + TBFormulas.E + TBFormulas.F + TBFormulas.G + TBFormulas.H + " " + strwhere; strSQL = strSQL.Replace("#", "").Replace(":and:", "and").Replace(" from ", "\n from ").Replace(" and ", "\n and ").Replace(" where ", "\n where "); General.textTestSQL = strSQL; scrQuerySQL testsql = new scrQuerySQL(); testsql.TestSQL(Base.DBConnection, General, Base.DBConnectionString); testsql.ShowDialog(); }
private void dataFilter_Click(object sender, EventArgs e) { if (General.textTestSQL.ToString().Trim().Length > 0) { scrQuerySQL testsql = new scrQuerySQL(); testsql.TestSQL(Base.DBConnection, General, Base.DBConnectionString); testsql.Show(); } else { MessageBox.Show("No SQL to pass", "Information", MessageBoxButtons.OK); } }
private void buildDisplaySQL(string strwhere, decimal decValue) { string strSQL = ""; strSQL = "Database Name: " + TB.DBName + '\n' + "Table Name: " + TB.TBName + '\n' + "Calculation Name: " + TBFormulas.CalcName + " Formula Name: " + TBFormulas.TableFormulaCall + " = " + decValue + '\n' + '\n' + '\n' + TBFormulas.A + TBFormulas.B + TBFormulas.C + TBFormulas.D + TBFormulas.E + TBFormulas.F + TBFormulas.G + TBFormulas.H + " " + strwhere; strSQL = strSQL.Replace("#", "").Replace(":and:", "and").Replace(" from ", "\n from ").Replace(" and ", "\n and ").Replace(" where ", "\n where "); if (strSQL.Trim().Contains(" as t1XXXXX")) { string A = strSQL.Trim().Substring(0, strSQL.Trim().IndexOf("@ ) as t1XXXXX") + 1); string B = strSQL.Trim().Substring(strSQL.Trim().IndexOf("@ ) as t1XXXXX") + 1); strSQL = A + " and period = '" + BusinessLanguage.Period.Trim() + "'" + B; } General.textTestSQL = strSQL; scrQuerySQL testsql = new scrQuerySQL(); testsql.TestSQL(Base.DBConnection, General, Base.DBConnectionString); testsql.ShowDialog(); }