private void btnOK_Click(object sender, EventArgs e) { if (this.textBox1.Text != "") { int num1 = Convert.ToInt32(this.txbBP.Text); int num2 = Convert.ToInt32(this.txbLen.Text); if (((num1 <= 0) || (num1 > 0x270f)) || (((num2 < 0) || (num2 > 0x270f)) || (num2 > num1))) { MessageBox.Show("Error in Start Position and Length for search.Maximum Start and Length is 9999. Try again.", "Error"); } else { try { ArrayList list1 = new ArrayList(); ArrayList list2 = new ArrayList(); list2 = this.parseInput(this.textBox1.Text); Thread thread1 = new Thread(new ThreadStart(this.ORFthread)); thread1.Start(); thread1.Join(); if (this.dt != null) { this.dt.PrimaryKey = new DataColumn[] { this.dt.Columns["Systematic Name"] }; splitTable table1 = new splitTable(); table1.TableSplit(this.dt, "Common"); DataTable table2 = table1.dtUnique; DataTable table3 = table1.dtMultiple; table1 = new splitTable(); table1.TableSplit(this.dt, "Genbank"); DataTable table4 = table1.dtUnique; DataTable table5 = table1.dtMultiple; this.sq = this.tf.Sequence.Clone(); string text1 = ""; int num3 = 0; this.pgrBar.Maximum = list2.Count; this.pgrBar.Value = 0; foreach (string text2 in list2) { DataRow row1; this.pgrBar.Value++; if (this.rbnName.Checked) { row1 = table2.Rows.Find(text2); if (row1 != null) { text1 = row1["Map"].ToString(); this.addToTable(text1, text2); continue; } text1 = ""; for (int num4 = 0; num4 < table3.Rows.Count; num4++) { if (text2 == table3.Rows[num4]["Common"].ToString()) { text1 = table3.Rows[num4]["Map"].ToString(); string text3 = text2 + " _ " + num3.ToString(); num3++; this.addToTable(text1, text3); } } if (text1 == "") { list1.Add(text2); } } else if (this.rbnGB.Checked) { row1 = table4.Rows.Find(text2); if (row1 != null) { text1 = row1["Map"].ToString(); this.addToTable(text1, text2); continue; } text1 = ""; for (int num5 = 0; num5 < table5.Rows.Count; num5++) { if (text2 == table5.Rows[num5]["Genbank"].ToString()) { this.addToTable(text1, text2); } } if (text1 == "") { list1.Add(text2); } } } this.pgrBar.Value = this.pgrBar.Maximum; if (list1.Count > 0) { string text4 = ""; foreach (string text5 in list1) { text4 = text4 + text5 + "\t"; } StreamWriter writer1 = new StreamWriter("FactScan.log", true); writer1.WriteLine(DateTime.Now.ToString()); writer1.WriteLine("Can not find the following {0} genes in 9999 database:\r\n\r\n" + text4, list1.Count); writer1.WriteLine(); writer1.Close(); MessageBox.Show("Can not find the following " + list1.Count.ToString() + " genes:\r\n\r\n" + text4, "Not found items"); } this.btnCancel.Text = "Finish"; this.btnCancel.Focus(); MessageBox.Show("Search Completed successfully!\r\n" + this.sq.Rows.Count.ToString() + " sequences added!", "Done"); } } catch (Exception exception1) { MessageBox.Show("Read 9999 Sequence Database Error: " + exception1.Message); } } } }
private void btnOK_Click(object sender, EventArgs e) { if (this.textBox1.Text != "") { int num1 = Convert.ToInt32(this.txbBP.Text); int num2 = Convert.ToInt32(this.txbLen.Text); if (((num1 <= 0) || (num1 > 0x270f)) || (((num2 < 0) || (num2 > 0x270f)) || (num2 > num1))) { MessageBox.Show("Error in Start Position and Length for search.Maximum Start and Length is 9999. Try again.", "Error"); } else { try { ArrayList list1 = new ArrayList(); ArrayList list2 = new ArrayList(); list2 = this.parseInput(this.textBox1.Text); Thread thread1 = new Thread(new ThreadStart(this.ORFthread)); thread1.Start(); thread1.Join(); if (this.dt != null) { this.dt.PrimaryKey = new DataColumn[] { this.dt.Columns["Systematic Name"] }; splitTable table1 = new splitTable(); table1.TableSplit(this.dt, "Common"); DataTable table2 = table1.dtUnique; DataTable table3 = table1.dtMultiple; table1 = new splitTable(); table1.TableSplit(this.dt, "Genbank"); DataTable table4 = table1.dtUnique; DataTable table5 = table1.dtMultiple; this.sq = this.tf.Sequence.Clone(); string text1 = ""; int num3 = 0; this.pgrBar.Maximum = list2.Count; this.pgrBar.Value = 0; foreach (string text2 in list2) { DataRow row1; this.pgrBar.Value++; if (this.rbnName.Checked) { row1 = table2.Rows.Find(text2); if (row1 != null) { text1 = row1["Map"].ToString(); this.addToTable(text1, text2); continue; } text1 = ""; for (int num4 = 0; num4 < table3.Rows.Count; num4++) { if (text2 == table3.Rows[num4]["Common"].ToString()) { text1 = table3.Rows[num4]["Map"].ToString(); string text3 = text2 + " _ " + num3.ToString(); num3++; this.addToTable(text1, text3); } } if (text1 == "") { list1.Add(text2); } } else if (this.rbnGB.Checked) { row1 = table4.Rows.Find(text2); if (row1 != null) { text1 = row1["Map"].ToString(); this.addToTable(text1, text2); continue; } text1 = ""; for (int num5 = 0; num5 < table5.Rows.Count; num5++) { if (text2 == table5.Rows[num5]["Genbank"].ToString()) { this.addToTable(text1, text2); } } if (text1 == "") { list1.Add(text2); } } } this.pgrBar.Value = this.pgrBar.Maximum; if (list1.Count > 0) { string text4 = ""; foreach (string text5 in list1) { text4 = text4 + text5 + "\t"; } StreamWriter writer1 = new StreamWriter("FactScan.log", true); writer1.WriteLine(DateTime.Now.ToString()); writer1.WriteLine("Can not find the following {0} genes in 9999 database:\r\n\r\n" + text4, list1.Count); writer1.WriteLine(); writer1.Close(); MessageBox.Show("Can not find the following " + list1.Count.ToString() + " genes:\r\n\r\n" + text4, "Not found items"); } this.btnCancel.Text = "Finish"; this.btnCancel.Focus(); MessageBox.Show("Search Completed successfully!\r\n" + this.sq.Rows.Count.ToString() + " sequences added!", "Done"); } } catch (Exception exception1) { MessageBox.Show("Read 9999 Sequence Database Error: " + exception1.Message); } } } }