Пример #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (this.dataGridView1.SelectedRows.Count < 1)
            {
                MessageBox.Show("未选中任何行!"); return;
            }
            aUPersonalBasicInfo hm = new aUPersonalBasicInfo();
            string id = this.dataGridView1.SelectedRows[0].Cells[0].Value.ToString();

            hm.id           = id;
            hm.label47.Text = "修改个人基本信息表";
            hm.Text         = "修改个人基本信息表";
            DataTable dt = pBasicInfo.queryPersonalBasicInfo0(id);

            if (dt != null && dt.Rows.Count > 0)
            {
                hm.textBox1.Text = dt.Rows[0]["name"].ToString();
                hm.textBox2.Text = dt.Rows[0]["archive_no"].ToString();
                if (dt.Rows[0]["sex"].ToString() == hm.radioButton1.Text)
                {
                    hm.radioButton1.Checked = true;
                }
                ;
                if (dt.Rows[0]["sex"].ToString() == hm.radioButton2.Text)
                {
                    hm.radioButton2.Checked = true;
                }
                ;
                if (dt.Rows[0]["sex"].ToString() == hm.radioButton3.Text)
                {
                    hm.radioButton3.Checked = true;
                }
                ;
                if (dt.Rows[0]["sex"].ToString() == hm.radioButton25.Text)
                {
                    hm.radioButton25.Checked = true;
                }
                ;
                hm.dateTimePicker1.Value = DateTime.Parse(dt.Rows[0]["birthday"].ToString());
                hm.textBox12.Text        = dt.Rows[0]["id_number"].ToString();
                hm.textBox14.Text        = dt.Rows[0]["company"].ToString();
                hm.textBox16.Text        = dt.Rows[0]["phone"].ToString();
                hm.textBox18.Text        = dt.Rows[0]["link_name"].ToString();
                hm.textBox20.Text        = dt.Rows[0]["link_phone"].ToString();
                if (dt.Rows[0]["resident_type"].ToString() == hm.radioButton4.Text)
                {
                    hm.radioButton4.Checked = true;
                }
                ;
                if (dt.Rows[0]["resident_type"].ToString() == hm.radioButton5.Text)
                {
                    hm.radioButton5.Checked = true;
                }
                ;

                if (dt.Rows[0]["nation"].ToString() == hm.radioButton6.Text)
                {
                    hm.radioButton6.Checked = true;
                }
                ;
                if (dt.Rows[0]["nation"].ToString() == hm.radioButton7.Text)
                {
                    hm.radioButton7.Checked = true;
                }
                ;

                if (dt.Rows[0]["blood_group"].ToString() == hm.radioButton8.Text)
                {
                    hm.radioButton8.Checked = true;
                }
                ;
                if (dt.Rows[0]["blood_group"].ToString() == hm.radioButton9.Text)
                {
                    hm.radioButton9.Checked = true;
                }
                ;
                if (dt.Rows[0]["blood_group"].ToString() == hm.radioButton10.Text)
                {
                    hm.radioButton10.Checked = true;
                }
                ;
                if (dt.Rows[0]["blood_group"].ToString() == hm.radioButton11.Text)
                {
                    hm.radioButton11.Checked = true;
                }
                ;
                if (dt.Rows[0]["blood_group"].ToString() == hm.radioButton12.Text)
                {
                    hm.radioButton12.Checked = true;
                }
                ;

                if (dt.Rows[0]["blood_rh"].ToString() == hm.radioButton13.Text)
                {
                    hm.radioButton13.Checked = true;
                }
                ;
                if (dt.Rows[0]["blood_rh"].ToString() == hm.radioButton14.Text)
                {
                    hm.radioButton14.Checked = true;
                }
                ;
                if (dt.Rows[0]["blood_rh"].ToString() == hm.radioButton15.Text)
                {
                    hm.radioButton15.Checked = true;
                }
                ;

                if (dt.Rows[0]["education"].ToString() == hm.radioButton22.Text)
                {
                    hm.radioButton22.Checked = true;
                }
                ;
                if (dt.Rows[0]["education"].ToString() == hm.radioButton23.Text)
                {
                    hm.radioButton23.Checked = true;
                }
                ;
                if (dt.Rows[0]["education"].ToString() == hm.radioButton24.Text)
                {
                    hm.radioButton24.Checked = true;
                }
                ;
                if (dt.Rows[0]["education"].ToString() == hm.radioButton26.Text)
                {
                    hm.radioButton26.Checked = true;
                }
                ;
                if (dt.Rows[0]["education"].ToString() == hm.radioButton27.Text)
                {
                    hm.radioButton27.Checked = true;
                }
                ;
                if (dt.Rows[0]["education"].ToString() == hm.radioButton28.Text)
                {
                    hm.radioButton28.Checked = true;
                }
                ;
                if (dt.Rows[0]["education"].ToString() == hm.radioButton29.Text)
                {
                    hm.radioButton29.Checked = true;
                }
                ;
                if (dt.Rows[0]["education"].ToString() == hm.radioButton30.Text)
                {
                    hm.radioButton30.Checked = true;
                }
                ;
                if (dt.Rows[0]["education"].ToString() == hm.radioButton31.Text)
                {
                    hm.radioButton31.Checked = true;
                }
                ;
                if (dt.Rows[0]["education"].ToString() == hm.radioButton32.Text)
                {
                    hm.radioButton32.Checked = true;
                }
                ;

                if (dt.Rows[0]["profession"].ToString() == hm.radioButton33.Text)
                {
                    hm.radioButton33.Checked = true;
                }
                ;
                if (dt.Rows[0]["profession"].ToString() == hm.radioButton34.Text)
                {
                    hm.radioButton34.Checked = true;
                }
                ;
                if (dt.Rows[0]["profession"].ToString() == hm.radioButton35.Text)
                {
                    hm.radioButton35.Checked = true;
                }
                ;
                if (dt.Rows[0]["profession"].ToString() == hm.radioButton36.Text)
                {
                    hm.radioButton36.Checked = true;
                }
                ;
                if (dt.Rows[0]["profession"].ToString() == hm.radioButton37.Text)
                {
                    hm.radioButton37.Checked = true;
                }
                ;
                if (dt.Rows[0]["profession"].ToString() == hm.radioButton38.Text)
                {
                    hm.radioButton38.Checked = true;
                }
                ;
                if (dt.Rows[0]["profession"].ToString() == hm.radioButton39.Text)
                {
                    hm.radioButton39.Checked = true;
                }
                ;
                if (dt.Rows[0]["profession"].ToString() == hm.radioButton40.Text)
                {
                    hm.radioButton40.Checked = true;
                }
                ;
                if (dt.Rows[0]["profession"].ToString() == hm.radioButton41.Text)
                {
                    hm.radioButton41.Checked = true;
                }
                ;

                if (dt.Rows[0]["marital_status"].ToString() == hm.radioButton42.Text)
                {
                    hm.radioButton42.Checked = true;
                }
                ;
                if (dt.Rows[0]["marital_status"].ToString() == hm.radioButton43.Text)
                {
                    hm.radioButton43.Checked = true;
                }
                ;
                if (dt.Rows[0]["marital_status"].ToString() == hm.radioButton44.Text)
                {
                    hm.radioButton44.Checked = true;
                }
                ;
                if (dt.Rows[0]["marital_status"].ToString() == hm.radioButton45.Text)
                {
                    hm.radioButton45.Checked = true;
                }
                ;
                if (dt.Rows[0]["marital_status"].ToString() == hm.radioButton46.Text)
                {
                    hm.radioButton46.Checked = true;
                }
                ;

                if (dt.Rows[0]["pay_type"].ToString() == hm.radioButton47.Text)
                {
                    hm.radioButton47.Checked = true;
                }
                ;
                if (dt.Rows[0]["pay_type"].ToString() == hm.radioButton48.Text)
                {
                    hm.radioButton48.Checked = true;
                }
                ;
                if (dt.Rows[0]["pay_type"].ToString() == hm.radioButton49.Text)
                {
                    hm.radioButton49.Checked = true;
                }
                ;
                if (dt.Rows[0]["pay_type"].ToString() == hm.radioButton50.Text)
                {
                    hm.radioButton50.Checked = true;
                }
                ;
                if (dt.Rows[0]["pay_type"].ToString() == hm.radioButton51.Text)
                {
                    hm.radioButton51.Checked = true;
                }
                ;
                if (dt.Rows[0]["pay_type"].ToString() == hm.radioButton52.Text)
                {
                    hm.radioButton52.Checked = true;
                }
                ;
                if (dt.Rows[0]["pay_type"].ToString() == hm.radioButton53.Text)
                {
                    hm.radioButton53.Checked = true;
                }
                ;
                if (dt.Rows[0]["pay_type"].ToString() == hm.radioButton54.Text)
                {
                    hm.radioButton54.Checked = true;
                }
                ;

                if (dt.Rows[0]["drug_allergy"].ToString() == hm.radioButton55.Text)
                {
                    hm.radioButton55.Checked = true;
                }
                ;
                if (dt.Rows[0]["drug_allergy"].ToString() == hm.radioButton56.Text)
                {
                    hm.radioButton56.Checked = true;
                }
                ;
                if (dt.Rows[0]["drug_allergy"].ToString() == hm.radioButton57.Text)
                {
                    hm.radioButton57.Checked = true;
                }
                ;
                if (dt.Rows[0]["drug_allergy"].ToString() == hm.radioButton58.Text)
                {
                    hm.radioButton58.Checked = true;
                }
                ;
                if (dt.Rows[0]["drug_allergy"].ToString() == hm.radioButton59.Text)
                {
                    hm.radioButton59.Checked = true;
                }
                ;

                if (dt.Rows[0]["exposure"].ToString() == hm.radioButton60.Text)
                {
                    hm.radioButton60.Checked = true;
                }
                ;
                if (dt.Rows[0]["exposure"].ToString() == hm.radioButton61.Text)
                {
                    hm.radioButton61.Checked = true;
                }
                ;
                if (dt.Rows[0]["exposure"].ToString() == hm.radioButton62.Text)
                {
                    hm.radioButton62.Checked = true;
                }
                ;
                if (dt.Rows[0]["exposure"].ToString() == hm.radioButton63.Text)
                {
                    hm.radioButton63.Checked = true;
                }
                ;



                hm.richTextBox4.Text = dt.Rows[0]["heredity_name"].ToString();
                foreach (Control ctr in hm.panel20.Controls)
                {
                    //判断该控件是不是CheckBox
                    if (ctr is CheckBox)
                    {
                        //将ctr转换成CheckBox并赋值给ck
                        CheckBox ck = ctr as CheckBox;
                        if (dt.Rows[0]["deformity_name"].ToString().IndexOf(ck.Text) > -1)
                        {
                            ck.Checked = true;
                        }
                    }
                }

                if (dt.Rows[0]["kitchen"].ToString() == hm.radioButton18.Text)
                {
                    hm.radioButton18.Checked = true;
                }
                ;
                if (dt.Rows[0]["kitchen"].ToString() == hm.radioButton19.Text)
                {
                    hm.radioButton19.Checked = true;
                }
                ;
                if (dt.Rows[0]["kitchen"].ToString() == hm.radioButton20.Text)
                {
                    hm.radioButton20.Checked = true;
                }
                ;
                if (dt.Rows[0]["kitchen"].ToString() == hm.radioButton21.Text)
                {
                    hm.radioButton21.Checked = true;
                }
                ;

                if (dt.Rows[0]["fuel"].ToString() == hm.radioButton70.Text)
                {
                    hm.radioButton70.Checked = true;
                }
                ;
                if (dt.Rows[0]["fuel"].ToString() == hm.radioButton71.Text)
                {
                    hm.radioButton71.Checked = true;
                }
                ;
                if (dt.Rows[0]["fuel"].ToString() == hm.radioButton72.Text)
                {
                    hm.radioButton72.Checked = true;
                }
                ;
                if (dt.Rows[0]["fuel"].ToString() == hm.radioButton73.Text)
                {
                    hm.radioButton73.Checked = true;
                }
                ;
                if (dt.Rows[0]["fuel"].ToString() == hm.radioButton74.Text)
                {
                    hm.radioButton74.Checked = true;
                }
                ;
                if (dt.Rows[0]["fuel"].ToString() == hm.radioButton75.Text)
                {
                    hm.radioButton75.Checked = true;
                }
                ;

                if (dt.Rows[0]["drink"].ToString() == hm.radioButton76.Text)
                {
                    hm.radioButton76.Checked = true;
                }
                ;
                if (dt.Rows[0]["drink"].ToString() == hm.radioButton77.Text)
                {
                    hm.radioButton77.Checked = true;
                }
                ;
                if (dt.Rows[0]["drink"].ToString() == hm.radioButton78.Text)
                {
                    hm.radioButton78.Checked = true;
                }
                ;
                if (dt.Rows[0]["drink"].ToString() == hm.radioButton79.Text)
                {
                    hm.radioButton79.Checked = true;
                }
                ;
                if (dt.Rows[0]["drink"].ToString() == hm.radioButton80.Text)
                {
                    hm.radioButton80.Checked = true;
                }
                ;
                if (dt.Rows[0]["drink"].ToString() == hm.radioButton81.Text)
                {
                    hm.radioButton81.Checked = true;
                }
                ;

                if (dt.Rows[0]["toilet"].ToString() == hm.radioButton82.Text)
                {
                    hm.radioButton82.Checked = true;
                }
                ;
                if (dt.Rows[0]["toilet"].ToString() == hm.radioButton83.Text)
                {
                    hm.radioButton83.Checked = true;
                }
                ;
                if (dt.Rows[0]["toilet"].ToString() == hm.radioButton84.Text)
                {
                    hm.radioButton84.Checked = true;
                }
                ;
                if (dt.Rows[0]["toilet"].ToString() == hm.radioButton85.Text)
                {
                    hm.radioButton85.Checked = true;
                }
                ;
                if (dt.Rows[0]["toilet"].ToString() == hm.radioButton86.Text)
                {
                    hm.radioButton86.Checked = true;
                }
                ;

                if (dt.Rows[0]["poultry"].ToString() == hm.radioButton87.Text)
                {
                    hm.radioButton87.Checked = true;
                }
                ;
                if (dt.Rows[0]["poultry"].ToString() == hm.radioButton88.Text)
                {
                    hm.radioButton88.Checked = true;
                }
                ;
                if (dt.Rows[0]["poultry"].ToString() == hm.radioButton89.Text)
                {
                    hm.radioButton89.Checked = true;
                }
                ;
                if (dt.Rows[0]["poultry"].ToString() == hm.radioButton90.Text)
                {
                    hm.radioButton90.Checked = true;
                }
                ;
            }
            else
            {
            }



            if (hm.ShowDialog() == DialogResult.OK)
            {
                //刷新页面
                querypBasicInfo();
                MessageBox.Show("修改成功!");
            }
        }
Пример #2
0
        private void OpenWindow()
        {
            if (this.dataGridView1.SelectedRows.Count < 1)
            {
                MessageBox.Show("未选中任何行!"); return;
            }
            aUPersonalBasicInfoo hm = new aUPersonalBasicInfoo();
            string id = this.dataGridView1.SelectedRows[0].Cells[0].Value.ToString();

            hm.id           = id;
            hm.label47.Text = "修改个人基本信息表";
            hm.Text         = "修改个人基本信息表";
            DataTable dt = pBasicInfo.queryPersonalBasicInfo0(id);

            if (dt != null && dt.Rows.Count > 0)
            {
                hm.textBox1.Text = dt.Rows[0]["name"].ToString();
                hm.oldname       = dt.Rows[0]["name"].ToString();

                hm.textBox2.Text = dt.Rows[0]["archive_no"].ToString();
                if (dt.Rows[0]["sex"].ToString() == hm.radioButton1.Tag.ToString())
                {
                    hm.radioButton1.Checked = true;
                }
                ;
                if (dt.Rows[0]["sex"].ToString() == hm.radioButton2.Tag.ToString())
                {
                    hm.radioButton2.Checked = true;
                }
                ;
                if (dt.Rows[0]["sex"].ToString() == hm.radioButton3.Tag.ToString())
                {
                    hm.radioButton3.Checked = true;
                }
                ;
                if (dt.Rows[0]["sex"].ToString() == hm.radioButton25.Tag.ToString())
                {
                    hm.radioButton25.Checked = true;
                }
                ;
                hm.textBox12.Text = dt.Rows[0]["id_number"].ToString();
                if (dt.Rows[0]["birthday"].ToString() != "" && dt.Rows[0]["birthday"].ToString().IndexOf("-") > 0)
                {
                    hm.dateTimePicker1.Value = DateTime.Parse(dt.Rows[0]["birthday"].ToString());
                }
                else
                {
                    hm.dateTimePicker1.Value = DateTime.Parse(hm.textBox12.Text.Substring(6, 4) + "-" + hm.textBox12.Text.Substring(10, 2) + "-" + hm.textBox12.Text.Substring(12, 2));
                }
                hm.textBox12.Text = dt.Rows[0]["id_number"].ToString();
                hm.oldidnumber    = dt.Rows[0]["id_number"].ToString();

                hm.textBox14.Text = dt.Rows[0]["company"].ToString();
                if (dt.Rows[0]["residence_address"].ToString() == "")
                {
                    hm.textBox46.Text = dt.Rows[0]["county_name"].ToString() + dt.Rows[0]["towns_name"].ToString() + dt.Rows[0]["village_name"].ToString();
                }
                else
                {
                    hm.textBox46.Text = dt.Rows[0]["residence_address"].ToString();
                }

                hm.textBox44.Text = dt.Rows[0]["address"].ToString();

                hm.textBox16.Text = dt.Rows[0]["phone"].ToString();
                hm.textBox18.Text = dt.Rows[0]["link_name"].ToString();
                hm.textBox20.Text = dt.Rows[0]["link_phone"].ToString();
                if (dt.Rows[0]["resident_type"].ToString() == hm.radioButton4.Tag.ToString())
                {
                    hm.radioButton4.Checked = true;
                }
                ;
                if (dt.Rows[0]["resident_type"].ToString() == hm.radioButton5.Tag.ToString())
                {
                    hm.radioButton5.Checked = true;
                }
                ;
                string nation = dt.Rows[0]["nation"].ToString();
                if (nation != null && !"".Equals(nation))
                {
                    if (nation == hm.radioButton6.Tag.ToString())
                    {
                        hm.radioButton6.Checked = true;
                    }
                    else
                    {
                        hm.radioButton7.Checked = true; hm.comboBox1.Visible = true; hm.mzid = nation;
                    };
                }
                if (dt.Rows[0]["blood_group"].ToString() == hm.radioButton8.Tag.ToString())
                {
                    hm.radioButton8.Checked = true;
                }
                ;
                if (dt.Rows[0]["blood_group"].ToString() == hm.radioButton9.Tag.ToString())
                {
                    hm.radioButton9.Checked = true;
                }
                ;
                if (dt.Rows[0]["blood_group"].ToString() == hm.radioButton10.Tag.ToString())
                {
                    hm.radioButton10.Checked = true;
                }
                ;
                if (dt.Rows[0]["blood_group"].ToString() == hm.radioButton11.Tag.ToString())
                {
                    hm.radioButton11.Checked = true;
                }
                ;
                if (dt.Rows[0]["blood_group"].ToString() == hm.radioButton12.Tag.ToString())
                {
                    hm.radioButton12.Checked = true;
                }
                ;

                if (dt.Rows[0]["blood_rh"].ToString() == hm.radioButton13.Tag.ToString())
                {
                    hm.radioButton13.Checked = true;
                }
                ;
                if (dt.Rows[0]["blood_rh"].ToString() == hm.radioButton14.Tag.ToString())
                {
                    hm.radioButton14.Checked = true;
                }
                ;
                if (dt.Rows[0]["blood_rh"].ToString() == hm.radioButton15.Tag.ToString())
                {
                    hm.radioButton15.Checked = true;
                }
                ;

                if (dt.Rows[0]["education"].ToString() == hm.radioButton22.Tag.ToString())
                {
                    hm.radioButton22.Checked = true;
                }
                ;
                if (dt.Rows[0]["education"].ToString() == hm.radioButton23.Tag.ToString())
                {
                    hm.radioButton23.Checked = true;
                }
                ;
                if (dt.Rows[0]["education"].ToString() == hm.radioButton24.Tag.ToString())
                {
                    hm.radioButton24.Checked = true;
                }
                ;
                if (dt.Rows[0]["education"].ToString() == hm.radioButton26.Tag.ToString())
                {
                    hm.radioButton26.Checked = true;
                }
                ;
                if (dt.Rows[0]["education"].ToString() == hm.radioButton27.Tag.ToString())
                {
                    hm.radioButton27.Checked = true;
                }
                ;
                if (dt.Rows[0]["education"].ToString() == hm.radioButton28.Tag.ToString())
                {
                    hm.radioButton28.Checked = true;
                }
                ;
                if (dt.Rows[0]["education"].ToString() == hm.radioButton29.Tag.ToString())
                {
                    hm.radioButton29.Checked = true;
                }
                ;
                if (dt.Rows[0]["education"].ToString() == hm.radioButton30.Tag.ToString())
                {
                    hm.radioButton30.Checked = true;
                }
                ;
                if (dt.Rows[0]["education"].ToString() == hm.radioButton31.Tag.ToString())
                {
                    hm.radioButton31.Checked = true;
                }
                ;
                if (dt.Rows[0]["education"].ToString() == hm.radioButton32.Tag.ToString())
                {
                    hm.radioButton32.Checked = true;
                }
                ;

                if (dt.Rows[0]["profession"].ToString() == hm.radioButton33.Tag.ToString())
                {
                    hm.radioButton33.Checked = true;
                }
                ;
                if (dt.Rows[0]["profession"].ToString() == hm.radioButton34.Tag.ToString())
                {
                    hm.radioButton34.Checked = true;
                }
                ;
                if (dt.Rows[0]["profession"].ToString() == hm.radioButton35.Tag.ToString())
                {
                    hm.radioButton35.Checked = true;
                }
                ;
                if (dt.Rows[0]["profession"].ToString() == hm.radioButton36.Tag.ToString())
                {
                    hm.radioButton36.Checked = true;
                }
                ;
                if (dt.Rows[0]["profession"].ToString() == hm.radioButton37.Tag.ToString())
                {
                    hm.radioButton37.Checked = true;
                }
                ;
                if (dt.Rows[0]["profession"].ToString() == hm.radioButton38.Tag.ToString())
                {
                    hm.radioButton38.Checked = true;
                }
                ;
                if (dt.Rows[0]["profession"].ToString() == hm.radioButton39.Tag.ToString())
                {
                    hm.radioButton39.Checked = true;
                }
                ;
                if (dt.Rows[0]["profession"].ToString() == hm.radioButton40.Tag.ToString())
                {
                    hm.radioButton40.Checked = true;
                }
                ;
                if (dt.Rows[0]["profession"].ToString() == hm.radioButton41.Tag.ToString())
                {
                    hm.radioButton41.Checked = true;
                }
                ;

                if (dt.Rows[0]["marital_status"].ToString() == hm.radioButton42.Tag.ToString())
                {
                    hm.radioButton42.Checked = true;
                }
                ;
                if (dt.Rows[0]["marital_status"].ToString() == hm.radioButton43.Tag.ToString())
                {
                    hm.radioButton43.Checked = true;
                }
                ;
                if (dt.Rows[0]["marital_status"].ToString() == hm.radioButton44.Tag.ToString())
                {
                    hm.radioButton44.Checked = true;
                }
                ;
                if (dt.Rows[0]["marital_status"].ToString() == hm.radioButton45.Tag.ToString())
                {
                    hm.radioButton45.Checked = true;
                }
                ;
                if (dt.Rows[0]["marital_status"].ToString() == hm.radioButton46.Tag.ToString())
                {
                    hm.radioButton46.Checked = true;
                }
                ;

                if (dt.Rows[0]["is_heredity"].ToString() == hm.radioButton48.Tag.ToString())
                {
                    hm.radioButton48.Checked = true;
                }
                else if (dt.Rows[0]["is_heredity"].ToString() == hm.radioButton47.Tag.ToString())
                {
                    hm.radioButton47.Checked = true;
                    hm.textBox36.Text        = dt.Rows[0]["heredity_name"].ToString();
                }
                ;

                foreach (Control ctr in hm.panel12.Controls)
                {
                    //判断该控件是不是CheckBox
                    if (ctr is CheckBox)
                    {
                        //将ctr转换成CheckBox并赋值给ck
                        CheckBox ck = ctr as CheckBox;
                        //if (dt.Rows[0]["pay_type"].ToString().IndexOf(ck.Text) > -1)
                        string[] ck2 = dt.Rows[0]["pay_type"].ToString().Split(',');
                        for (int i = 0; i < ck2.Length; i++)
                        {
                            if (ck2[i].ToString() == ck.Tag.ToString())
                            {
                                ck.Checked = true;
                            }
                            if (ck2[i].ToString() == "8")
                            {
                                hm.textBox38.Enabled = true;
                                hm.textBox38.Text    = dt.Rows[0]["pay_other"].ToString();
                            }
                        }
                    }
                }

                foreach (Control ctr in hm.panel13.Controls)
                {
                    //判断该控件是不是CheckBox
                    if (ctr is CheckBox)
                    {
                        //将ctr转换成CheckBox并赋值给ck
                        CheckBox ck  = ctr as CheckBox;
                        string[] ck2 = dt.Rows[0]["drug_allergy"].ToString().Split(',');
                        for (int i = 0; i < ck2.Length; i++)
                        {
                            if (ck2[i].ToString() == ck.Tag.ToString())
                            {
                                ck.Checked = true;
                            }
                            if (ck2[i].ToString() == "5")
                            {
                                hm.textBox39.Enabled = true;
                                hm.textBox39.Text    = dt.Rows[0]["allergy_other"].ToString();
                            }
                        }
                    }
                }
                foreach (Control ctr in hm.panel14.Controls)
                {
                    //判断该控件是不是CheckBox
                    if (ctr is CheckBox)
                    {
                        //将ctr转换成CheckBox并赋值给ck
                        CheckBox ck  = ctr as CheckBox;
                        string[] ck2 = dt.Rows[0]["exposure"].ToString().Split(',');
                        for (int i = 0; i < ck2.Length; i++)
                        {
                            if (ck2[i].ToString() == ck.Tag.ToString())
                            {
                                ck.Checked = true;
                            }
                        }
                    }
                }

                foreach (Control ctr in hm.panel20.Controls)
                {
                    //判断该控件是不是CheckBox
                    if (ctr is CheckBox)
                    {
                        //将ctr转换成CheckBox并赋值给ck
                        CheckBox ck  = ctr as CheckBox;
                        string[] ck2 = dt.Rows[0]["is_deformity"].ToString().Split(',');
                        for (int i = 0; i < ck2.Length; i++)
                        {
                            if (ck2[i].ToString() == ck.Tag.ToString())
                            {
                                if (ck2[i].ToString() == "8")
                                {
                                    hm.textBox37.Text = dt.Rows[0]["deformity_name"].ToString();
                                }
                                ck.Checked = true;
                            }
                        }
                    }
                }

                if (dt.Rows[0]["kitchen"].ToString() == hm.radioButton18.Tag.ToString())
                {
                    hm.radioButton18.Checked = true;
                }
                ;
                if (dt.Rows[0]["kitchen"].ToString() == hm.radioButton19.Tag.ToString())
                {
                    hm.radioButton19.Checked = true;
                }
                ;
                if (dt.Rows[0]["kitchen"].ToString() == hm.radioButton20.Tag.ToString())
                {
                    hm.radioButton20.Checked = true;
                }
                ;
                if (dt.Rows[0]["kitchen"].ToString() == hm.radioButton21.Tag.ToString())
                {
                    hm.radioButton21.Checked = true;
                }
                ;

                if (dt.Rows[0]["fuel"].ToString() == hm.radioButton70.Tag.ToString())
                {
                    hm.radioButton70.Checked = true;
                }
                ;
                if (dt.Rows[0]["fuel"].ToString() == hm.radioButton71.Tag.ToString())
                {
                    hm.radioButton71.Checked = true;
                }
                ;
                if (dt.Rows[0]["fuel"].ToString() == hm.radioButton72.Tag.ToString())
                {
                    hm.radioButton72.Checked = true;
                }
                ;
                if (dt.Rows[0]["fuel"].ToString() == hm.radioButton73.Tag.ToString())
                {
                    hm.radioButton73.Checked = true;
                }
                ;
                if (dt.Rows[0]["fuel"].ToString() == hm.radioButton74.Tag.ToString())
                {
                    hm.radioButton74.Checked = true;
                }
                ;
                if (dt.Rows[0]["fuel"].ToString() == hm.radioButton75.Tag.ToString())
                {
                    hm.radioButton75.Checked = true;
                }
                ;

                if (dt.Rows[0]["drink"].ToString() == hm.radioButton76.Tag.ToString())
                {
                    hm.radioButton76.Checked = true;
                }
                ;
                if (dt.Rows[0]["drink"].ToString() == hm.radioButton77.Tag.ToString())
                {
                    hm.radioButton77.Checked = true;
                }
                ;
                if (dt.Rows[0]["drink"].ToString() == hm.radioButton78.Tag.ToString())
                {
                    hm.radioButton78.Checked = true;
                }
                ;
                if (dt.Rows[0]["drink"].ToString() == hm.radioButton79.Tag.ToString())
                {
                    hm.radioButton79.Checked = true;
                }
                ;
                if (dt.Rows[0]["drink"].ToString() == hm.radioButton80.Tag.ToString())
                {
                    hm.radioButton80.Checked = true;
                }
                ;
                if (dt.Rows[0]["drink"].ToString() == hm.radioButton81.Tag.ToString())
                {
                    hm.radioButton81.Checked = true;
                }
                ;

                if (dt.Rows[0]["toilet"].ToString() == hm.radioButton82.Tag.ToString())
                {
                    hm.radioButton82.Checked = true;
                }
                ;
                if (dt.Rows[0]["toilet"].ToString() == hm.radioButton83.Tag.ToString())
                {
                    hm.radioButton83.Checked = true;
                }
                ;
                if (dt.Rows[0]["toilet"].ToString() == hm.radioButton84.Tag.ToString())
                {
                    hm.radioButton84.Checked = true;
                }
                ;
                if (dt.Rows[0]["toilet"].ToString() == hm.radioButton85.Tag.ToString())
                {
                    hm.radioButton85.Checked = true;
                }
                ;
                if (dt.Rows[0]["toilet"].ToString() == hm.radioButton86.Tag.ToString())
                {
                    hm.radioButton86.Checked = true;
                }
                ;

                if (dt.Rows[0]["poultry"].ToString() == hm.radioButton87.Tag.ToString())
                {
                    hm.radioButton87.Checked = true;
                }
                ;
                if (dt.Rows[0]["poultry"].ToString() == hm.radioButton88.Tag.ToString())
                {
                    hm.radioButton88.Checked = true;
                }
                ;
                if (dt.Rows[0]["poultry"].ToString() == hm.radioButton89.Tag.ToString())
                {
                    hm.radioButton89.Checked = true;
                }
                ;
                if (dt.Rows[0]["poultry"].ToString() == hm.radioButton90.Tag.ToString())
                {
                    hm.radioButton90.Checked = true;
                }
                ;

                //是否贫困户
                string _poor = dt.Rows[0]["is_poor"].ToString();
                if (_poor == "")
                {
                    _poor = "0";
                }
                if (int.Parse(_poor) == 0)
                {
                    hm.radpinkun0.Checked = true;
                }
                else
                {
                    hm.radpinkun1.Checked = true;
                }
                string _signing = dt.Rows[0]["is_signing"].ToString();
                if (_signing == "")
                {
                    _signing = "0";
                }
                if (int.Parse(_signing) == 0)
                {
                    hm.radioButton17.Checked = true;
                }
                else
                {
                    hm.radioButton16.Checked = true;
                }

                string _isgravida = dt.Rows[0]["is_gravida"].ToString();
                if (_isgravida == "")
                {
                    _isgravida = "0";
                }
                if (int.Parse(_isgravida) == 0)
                {
                    hm.radioButton50.Checked = true;
                }
                else
                {
                    hm.radioButton49.Checked = true;
                }
            }
            else
            {
                MessageBox.Show("未查询到数据" + id);
            }

            if (hm.ShowDialog() == DialogResult.OK)
            {
                //刷新页面
                button5_Click(null, null);
                MessageBox.Show("修改成功!");
            }
        }