예제 #1
0
        private void dG_Non_SelectionChanged(object sender, EventArgs e)
        {
            sols = "";

            /*  foreach (DataGridViewRow row in dG_Non.SelectedRows)
             *
             * {
             *
             *    for (int i = 2; i < dG_Non.Columns.Count; i++)
             *        if (row.Cells[i].Value != null)
             *            sols += row.Cells[i].Value.ToString() + ",";
             *    sols = "id in (" + sols.Substring(0, sols.Length - 1) + ")";
             *
             *    frm_showdatabase fs = new frm_showdatabase();
             *    fs.dataGridView1.DataSource = Db.get_cases_customized_condition(statistics.tablename, sols);
             *    fs.Show();
             *
             * }*/

            foreach (DataGridViewRow row in dG_Non.SelectedRows)

            {
                if (row.Cells[2].Value != null)
                {
                    sols = "id  =" + row.Cells[2].Value.ToString();
                }

                frm_showdatabase fs = new frm_showdatabase();
                fs.dataGridView1.DataSource = Db.get_cases_customized_condition(statistics.tablename, sols);
                fs.Show();
            }
        }
예제 #2
0
        private void dG_With_SelectionChanged(object sender, EventArgs e)
        {
            string sols = "";

            foreach (DataGridViewRow row in dG_With.SelectedRows)
            {
                if (row.Cells[2].Value != null)
                {
                    sols = "id  =" + row.Cells["SolNum"].Value.ToString();
                }

                frm_showdatabase fs = new frm_showdatabase();
                fs.dataGridView1.DataSource = Db.get_cases_customized_condition(statistics.tablename, sols);
                fs.Show();
            }
        }
        private void dg_result_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            string sols = "";

            foreach (DataGridViewRow row in dg_result.SelectedRows)
            {
                if (row.Cells[0].Value != null)
                {
                    int first = row.Cells["cases_numbers"].Value.ToString().IndexOf('[');
                    int comma = row.Cells["cases_numbers"].Value.ToString().IndexOf(',');
                    int num1  = Convert.ToInt32(row.Cells["cases_numbers"].Value.ToString().Substring(first + 1, first + comma).Trim());

                    int second = row.Cells["cases_numbers"].Value.ToString().IndexOf(']');
                    int num2   = Convert.ToInt32(row.Cells["cases_numbers"].Value.ToString().Substring(comma + 1, comma + second).Trim());


                    sols = "id  in (" + num1 + "," + num2 + ")";

                    frm_showdatabase fs = new frm_showdatabase();
                    fs.dataGridView1.DataSource = Db.get_cases_customized_condition(statistics.tablename, sols);
                    fs.Show();
                }
            }
        }