private void btn_search1_Click(object sender, EventArgs e) { ChartSearchForm csf = new ChartSearchForm(); csf.ShowDialog(); if (csf.DialogResult == DialogResult.OK) { connStr = String.Format(connStr, "auxology.mdb"); OleDbConnection gConn = new OleDbConnection(connStr); string query = "select * from P_INFO where chart_num=@chart_num"; OleDbCommand cmd = new OleDbCommand(query, gConn); cmd.Parameters.AddWithValue("@chart_num", Globalfunction.chart_num); OleDbDataAdapter myDataAdapter = new OleDbDataAdapter(cmd); gConn.Open(); OleDbDataReader dr = cmd.ExecuteReader(); string gr_rb = "gr_rd"; while (dr.Read()) { chartnum_tb.Text = dr[0].ToString(); dt_cb.Text = dr[1].ToString(); reg_date.Text = dr[2].ToString(); parent_tb.Text = dr[3].ToString(); parent_cb.Text = dr[4].ToString(); patient_tb.Text = dr[5].ToString(); patient_cb.Text = dr[6].ToString(); birth_date.Text = dr[7].ToString(); man_tb1.Text = dr[8].ToString(); man_tb2.Text = dr[9].ToString(); adrs_tb1.Text = dr[10].ToString(); adrs_tb2.Text = dr[11].ToString(); adrs_tb3.Text = dr[12].ToString(); gr_rb = radioBtn_Check(dr[13].ToString()); gr_tb1.Text = dr[14].ToString(); pn_tb1.Text = dr[15].ToString(); pn_tb2.Text = dr[16].ToString(); pn_tb3.Text = dr[17].ToString(); hp_tb1.Text = dr[18].ToString(); hp_tb2.Text = dr[19].ToString(); hp_tb3.Text = dr[20].ToString(); hpn_tb1.Text = dr[21].ToString(); hpn_tb2.Text = dr[22].ToString(); hpn_tb3.Text = dr[23].ToString(); h_tb.Text = dr[24].ToString(); w_tb.Text = dr[25].ToString(); bmi_tb.Text = dr[26].ToString(); ph_tb.Text = dr[27].ToString(); pw_tb.Text = dr[28].ToString(); pbmi_tb.Text = dr[29].ToString(); fname_tb.Text = dr[30].ToString(); fh_tb.Text = dr[31].ToString(); mname_tb.Text = dr[32].ToString(); mh_tb.Text = dr[33].ToString(); } regday = Globalfunction.spilitDate(reg_date.Text); birthday = Globalfunction.spilitDate(birth_date.Text); dr.Close(); gConn.Close(); } else { this.DialogResult = csf.DialogResult; } }
private void btn_search_Click(object sender, EventArgs e) { ChartSearchForm csf = new ChartSearchForm(); csf.ShowDialog(); if (csf.DialogResult == DialogResult.OK) { connStr = String.Format(connStr, "auxology.mdb"); OleDbConnection gConn = new OleDbConnection(connStr); string query = "select * from munjin1 where chart_num=@chart_num"; OleDbCommand cmd = new OleDbCommand(query, gConn); cmd.Parameters.AddWithValue("@chart_num", Globalfunction.chart_num); OleDbDataAdapter myDataAdapter = new OleDbDataAdapter(cmd); gConn.Open(); OleDbDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { chartnum_tb.Text = dr[0].ToString(); name_tb.Text = dr[1].ToString(); regday = dr[2].ToString(); cb1_1.Checked = (bool)dr[3]; cb1_2.Checked = (bool)dr[4]; tb1_1.Text = dr[5].ToString(); cb2_1.Checked = (bool)dr[6]; cb2_2.Checked = (bool)dr[7]; cb2_3.Checked = (bool)dr[8]; cb2_4.Checked = (bool)dr[9]; cb2_5.Checked = (bool)dr[10]; tb2_1.Text = dr[11].ToString(); cb3_1.Checked = (bool)dr[12]; cb3_2.Checked = (bool)dr[13]; cb3_3.Checked = (bool)dr[14]; cb3_4.Checked = (bool)dr[15]; cb4_1.Checked = (bool)dr[16]; cb4_2.Checked = (bool)dr[17]; cb4_3.Checked = (bool)dr[18]; tb4_1.Text = dr[19].ToString(); cb5_1.Checked = (bool)dr[20]; cb5_2.Checked = (bool)dr[21]; cb5_3.Checked = (bool)dr[22]; tb5_1.Text = dr[23].ToString(); cb5_4.Checked = (bool)dr[24]; tb5_2.Text = dr[25].ToString(); tb5_3.Text = dr[26].ToString(); tb5_4.Text = dr[27].ToString(); cb6_1.Checked = (bool)dr[28]; cb6_2.Checked = (bool)dr[29]; tb6_1.Text = dr[30].ToString(); cb6_3.Checked = (bool)dr[31]; cb6_4.Checked = (bool)dr[32]; cb7_1.Checked = (bool)dr[33]; cb7_2.Checked = (bool)dr[34]; cb7_3.Checked = (bool)dr[35]; cb7_4.Checked = (bool)dr[36]; cb7_5.Checked = (bool)dr[37]; cb8_1.Checked = (bool)dr[38]; cb8_2.Checked = (bool)dr[39]; cb8_3.Checked = (bool)dr[40]; cb9_1.Checked = (bool)dr[41]; cb9_2.Checked = (bool)dr[42]; cb9_3.Checked = (bool)dr[43]; cb9_4.Checked = (bool)dr[44]; cb9_5.Checked = (bool)dr[45]; cb10_1.Checked = (bool)dr[46]; cb10_2.Checked = (bool)dr[47]; cb10_3.Checked = (bool)dr[48]; cb11_1.Checked = (bool)dr[49]; cb11_2.Checked = (bool)dr[50]; cb11_3.Checked = (bool)dr[51]; cb11_4.Checked = (bool)dr[52]; cb12_1.Checked = (bool)dr[53]; cb12_2.Checked = (bool)dr[54]; cb12_3.Checked = (bool)dr[55]; cb12_4.Checked = (bool)dr[56]; cb12_5.Checked = (bool)dr[57]; cb13_1.Checked = (bool)dr[58]; tb13_1.Text = dr[59].ToString(); tb13_2.Text = dr[60].ToString(); cb13_2.Checked = (bool)dr[61]; cb14_1.Checked = (bool)dr[62]; cb14_2.Checked = (bool)dr[63]; cb14_3.Checked = (bool)dr[64]; cb14_4.Checked = (bool)dr[65]; cb14_5.Checked = (bool)dr[66]; cb14_6.Checked = (bool)dr[67]; cb15_1.Checked = (bool)dr[68]; cb15_2.Checked = (bool)dr[69]; cb15_3.Checked = (bool)dr[70]; cb15_4.Checked = (bool)dr[71]; cb15_5.Checked = (bool)dr[72]; tb16_1.Text = dr[73].ToString(); tb16_2.Text = dr[74].ToString(); tb17_1.Text = dr[75].ToString(); tb18_1.Text = dr[76].ToString(); } regday = Globalfunction.spilitDate(reg_date.Text); //birthday = Globalfunction.spilitDate(birth_date.Text); dr.Close(); gConn.Close(); } else { this.DialogResult = csf.DialogResult; } }