private void SearchForm_KeyDown(object sender, KeyEventArgs e) { if (e.Control && e.KeyCode == Keys.R) { searchColumns = searchColumns.Clear(); foreach (object col in columnBox.CheckedItems) { searchColumns = searchColumns.AddItemToArray(col.ToString()); } Form f = SearchGrid.FindForm(); if (f.GetType() == typeof(QueryForm)) { QueryForm SearchParent = (QueryForm)f; offset = SearchParent.doReplace(searchBox.Text.ToString(), replaceBox.Text.ToString(), offset, exactChk.Checked, caseSensetiveChk.Checked, searchColumns); } if (f.GetType() == typeof(QueryerForm)) { QueryerForm SearchParent = (QueryerForm)f; offset = SearchParent.doReplace(searchBox.Text.ToString(), replaceBox.Text.ToString(), offset, exactChk.Checked, caseSensetiveChk.Checked, searchColumns); } } if (e.KeyCode == Keys.Escape) { this.DialogResult = DialogResult.OK; this.Close(); } }
public void openQueryer(string conectionString, string conName) { try { Datasource QueryerDS = new Datasource(conectionString, conName); if (QueryerDS.isConnected() == true) { QueryerForm QueryerQ = new QueryerForm(QueryerDS, "mid"); if (QueryerQS != null) { QueryerQ.index = QueryerQS.Length; } if (QueryerADS != null) { QueryerDS.index = QueryerADS.Length; } QueryerQ.nameindex = "Queryer" + QueryerQ.index; QueryerQ.MdiParent = this; QueryerQ.Show(); QueryerQ.Focus(); QueryerQS = QueryerQS.AddItemToArray(QueryerQ); QueryerADS = QueryerADS.AddItemToArray(QueryerDS); } } catch (Exception err) { errorLog(System.Reflection.MethodBase.GetCurrentMethod().Name, err); } }
private void queryerToolStripMenuItem_Click(object sender, EventArgs e) { using (var rform = new ConnectForm()) { var result = rform.ShowDialog(); if (result == DialogResult.OK) { string conStr = rform.conStr; string conName = rform.connectionName; Datasource QueryerDS = new Datasource(conStr, conName); if (QueryerDS.isConnected() == true) { QueryerForm QueryerQ = new QueryerForm(QueryerDS, "mid"); if (QueryerQS != null) { QueryerQ.index = QueryerQS.Length; } if (QueryerADS != null) { QueryerDS.index = QueryerADS.Length; } QueryerQ.nameindex = "Queryer" + QueryerQ.index; QueryerQ.MdiParent = this; QueryerQ.Show(); QueryerQ.Focus(); QueryerQS = QueryerQS.AddItemToArray(QueryerQ); QueryerADS = QueryerADS.AddItemToArray(QueryerDS); } } } }
public void openDestination(string conStr, string conName) { try { if (RightDS.isConnected() == false) { RightDS = new Datasource(conStr, conName); if (RightDS.isConnected() == true) { RightQ = new QueryerForm(RightDS, "right"); RightQ.nameindex = "Destination"; RightQ.MdiParent = this; RightQ.Show(); RightQ.Focus(); } } else { if (RightQ.Visible == false) { RightQ = new QueryerForm(RightDS, "right"); } RightQ.MdiParent = this; RightQ.Show(); RightQ.Focus(); } } catch (Exception err) { errorLog(System.Reflection.MethodBase.GetCurrentMethod().Name, err); } }
public void openSource(string conStr, string conName) { try { if (LeftDS.isConnected() == false) { LeftDS = new Datasource(conStr, conName); if (LeftDS.isConnected() == true) { LeftQ = new QueryerForm(LeftDS, "left"); LeftQ.nameindex = "Source"; LeftQ.MdiParent = this; LeftQ.Show(); LeftQ.Focus(); } } else { if (LeftQ.Visible == false) { LeftQ = new QueryerForm(LeftDS, "left"); } LeftQ.MdiParent = this; LeftQ.Show(); LeftQ.Focus(); } } catch (Exception err) { errorLog(System.Reflection.MethodBase.GetCurrentMethod().Name, err); } }
private void SearchForm_KeyDown(object sender, KeyEventArgs e) { if (e.Control && e.KeyCode == Keys.R) { searchColumns = searchColumns.Clear(); foreach (object col in columnBox.CheckedItems) { searchColumns = searchColumns.AddItemToArray(col.ToString()); } Form f = FilterGrid.FindForm(); if (f.GetType() == typeof(QueryForm)) { QueryForm FilterParent = (QueryForm)f; offset = FilterParent.doAutocase(caseBox.Text, offset, searchColumns); } if (f.GetType() == typeof(QueryerForm)) { QueryerForm FilterParent = (QueryerForm)f; offset = FilterParent.doAutocase(caseBox.Text, offset, searchColumns); } } if (e.KeyCode == Keys.Escape) { this.DialogResult = DialogResult.OK; this.Close(); } }
public ProgressForm(QueryerForm p, string Name) { Q2Parent = p; utcStart = DateTime.UtcNow; InitializeComponent(); this.Text = Name; }
private void SearchBtn_Click(object sender, EventArgs e) { Form f = SearchGrid.FindForm(); if (f.GetType() == typeof(QueryForm)) { QueryForm SearchParent = (QueryForm)f; offset = SearchParent.doConcat(columnList.Text.ToString(), offset, beforeTxt.Text.ToString(), afterTxt.Text.ToString()); } if (f.GetType() == typeof(QueryerForm)) { QueryerForm SearchParent = (QueryerForm)f; offset = SearchParent.doConcat(columnList.Text.ToString(), offset, beforeTxt.Text.ToString(), afterTxt.Text.ToString()); } }
private void SearchBtn_Click(object sender, EventArgs e) { searchColumns = searchColumns.Clear(); foreach (object col in columnBox.CheckedItems) { searchColumns = searchColumns.AddItemToArray(col.ToString()); } Form f = SearchGrid.FindForm(); if (f.GetType() == typeof(QueryForm)) { QueryForm SearchParent = (QueryForm)f; offset = SearchParent.doReplace(searchBox.Text.ToString(), replaceBox.Text.ToString(), offset, exactChk.Checked, caseSensetiveChk.Checked, searchColumns); } if (f.GetType() == typeof(QueryerForm)) { QueryerForm SearchParent = (QueryerForm)f; offset = SearchParent.doReplace(searchBox.Text.ToString(), replaceBox.Text.ToString(), offset, exactChk.Checked, caseSensetiveChk.Checked, searchColumns); } }
private void SearchBtn_Click(object sender, EventArgs e) { searchColumns = searchColumns.Clear(); foreach (object col in columnBox.CheckedItems) { searchColumns = searchColumns.AddItemToArray(col.ToString()); } Form f = HashGrid.FindForm(); if (f.GetType() == typeof(QueryForm)) { QueryForm HashParent = (QueryForm)f; offset = HashParent.doHash(caseBox.Text, offset, searchColumns); } if (f.GetType() == typeof(QueryerForm)) { QueryerForm HashParent = (QueryerForm)f; offset = HashParent.doHash(caseBox.Text, offset, searchColumns); } }
private void SearchForm_KeyDown(object sender, KeyEventArgs e) { if (e.Control && e.KeyCode == Keys.R) { Form f = SearchGrid.FindForm(); if (f.GetType() == typeof(QueryForm)) { QueryForm SearchParent = (QueryForm)f; offset = SearchParent.doConcat(columnList.Text.ToString(), offset, beforeTxt.Text.ToString(), afterTxt.Text.ToString()); } if (f.GetType() == typeof(QueryerForm)) { QueryerForm SearchParent = (QueryerForm)f; offset = SearchParent.doConcat(columnList.Text.ToString(), offset, beforeTxt.Text.ToString(), afterTxt.Text.ToString()); } } if (e.KeyCode == Keys.Escape) { this.DialogResult = DialogResult.OK; this.Close(); } }
private void textBox1_TextChanged(object sender, EventArgs e) { offset = 0; if (searchBox.Text.Length > 2) { searchColumns = searchColumns.Clear(); foreach (object col in columnBox.CheckedItems) { searchColumns = searchColumns.AddItemToArray(col.ToString()); } Form f = SearchGrid.FindForm(); if (f.GetType() == typeof(QueryForm)) { QueryForm SearchParent = (QueryForm)f; offset = SearchParent.doSearch(searchBox.Text.ToString(), offset, exactChk.Checked, caseSensetiveChk.Checked, searchColumns); } if (f.GetType() == typeof(QueryerForm)) { QueryerForm SearchParent = (QueryerForm)f; offset = SearchParent.doSearch(searchBox.Text.ToString(), offset, exactChk.Checked, caseSensetiveChk.Checked, searchColumns); } } }
private void connectLeftMenu_Click(object sender, EventArgs e) { try { if (LeftDS.isConnected() == false) { using (var rform = new ConnectForm()) { var result = rform.ShowDialog(); if (result == DialogResult.OK) { string conStr = rform.conStr; string conName = rform.connectionName; LeftDS = new Datasource(conStr, conName); if (LeftDS.isConnected() == true) { LeftQ = new QueryerForm(LeftDS, "left"); LeftQ.nameindex = "Source"; LeftQ.MdiParent = this; LeftQ.Show(); LeftQ.Focus(); } } } } else { if (LeftQ.Visible == false) { LeftQ = new QueryerForm(LeftDS, "left"); } LeftQ.MdiParent = this; LeftQ.Show(); LeftQ.Focus(); } } catch (Exception err) { errorLog(System.Reflection.MethodBase.GetCurrentMethod().Name, err); } }
private void convertToolStripMenuItem_Click(object sender, EventArgs e) { try { string schema = ""; string path = ""; string[] files = new string[0]; using (var rform = new ConvertForm()) { var result = rform.ShowDialog(); if (result == DialogResult.OK) { files = files.AddItemToArray(rform.outputFile); } } if (files != null) { if (files.Count() > 0) { if (IsDirectory(files[0]) == true) { path = files[0]; } else { path = Path.GetDirectoryName(files[0]); } if (File.Exists(path + "\\Schema.ini")) { schema = File.ReadAllText(path + "\\Schema.ini"); } foreach (string file in Directory.GetFiles(path)) { if (file.Contains(".csv")) { if (schema.Contains(Path.GetFileName(file).ToString()) == false) { System.IO.StreamReader tmpf = new System.IO.StreamReader(file); string line = tmpf.ReadLine(); string delimiter = ""; if (line != "") { if (line.Contains(" ")) { delimiter = "Delimited( )"; } if (line.Contains("|")) { delimiter = "Delimited(|)"; } if (line.Contains("\t")) { delimiter = "TabDelimited"; } if (line.Contains(";")) { delimiter = "Delimited(;)"; } } tmpf.Close(); if (delimiter != "") { schema = schema + "[" + Path.GetFileName(file).ToString() + "]\r\n"; schema = schema + "Format=" + delimiter + "\r\n\r\n"; } } } } if (schema != "") { File.WriteAllText(path + "\\Schema.ini", schema); } if (path != "") { string conStr = "Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=" + path + ";Extensions=asc,csv,tab,txt;"; Datasource QueryerDS = new Datasource(conStr, Path.GetFileName(path)); if (QueryerDS.isConnected() == true) { QueryerForm QueryerQ = new QueryerForm(QueryerDS, "mid"); if (QueryerQS != null) { QueryerQ.index = QueryerQS.Length; } if (QueryerADS != null) { QueryerDS.index = QueryerADS.Length; } QueryerQ.nameindex = "Queryer" + QueryerQ.index; QueryerQ.MdiParent = this; QueryerQ.Show(); QueryerQ.Focus(); QueryerQS = QueryerQS.AddItemToArray(QueryerQ); QueryerADS = QueryerADS.AddItemToArray(QueryerDS); } } } } } catch (Exception err) { errorLog(System.Reflection.MethodBase.GetCurrentMethod().Name, err); } }