//添加 修改 高血压随访记录历史表 调此方法 private void button1_Click(object sender, EventArgs e) { //方案一 //aUHypertensionPatientServices hm = new aUHypertensionPatientServices(); //hm.TopLevel = false; //hm.Dock = DockStyle.Fill; //hm.FormBorderStyle = FormBorderStyle.None; //this.panel2.Visible = false;//高血压随访历史记录表主页面 //this.panel3.Visible = true; //添加页面 //this.panel3.Size = this.panel2.Size; //hm.Size = this.panel3.Size; //this.panel3.Controls.Add(hm); //hm.Show(); //方案二 aUHypertensionPatientServices hm = new aUHypertensionPatientServices(); hm.label47.Text = "添加高血压随访记录历史表"; hm.Text = "添加高血压随访记录历史表"; if (hm.ShowDialog() == DialogResult.OK) { //刷新页面 queryhypertensionPatientServices(); MessageBox.Show("添加成功!"); } }
//添加 修改 高血压随访记录历史表 调此方法 private void button1_Click(object sender, EventArgs e) { //方案一 //aUHypertensionPatientServices hm = new aUHypertensionPatientServices(); //hm.TopLevel = false; //hm.Dock = DockStyle.Fill; //hm.FormBorderStyle = FormBorderStyle.None; //this.panel2.Visible = false;//高血压随访历史记录表主页面 //this.panel3.Visible = true; //添加页面 //this.panel3.Size = this.panel2.Size; //hm.Size = this.panel3.Size; //this.panel3.Controls.Add(hm); //hm.Show(); //方案二 if (this.dataGridView1.SelectedRows.Count < 1) { MessageBox.Show("未选中任何行!"); return; } string name = dataGridView1.SelectedRows[0].Cells[0].Value.ToString(); string archiveno = dataGridView1.SelectedRows[0].Cells[1].Value.ToString(); string idnumber = dataGridView1.SelectedRows[0].Cells[2].Value.ToString(); string id = dataGridView1.SelectedRows[0].Cells[6].Value.ToString(); DataTable dt = hypertensionPatient.queryHypertensionPatient0(id); if (dt.Rows.Count > 0) { MessageBox.Show("此身份信息已参加过了!"); return; } aUHypertensionPatientServices hm = new aUHypertensionPatientServices(); if (Common.m_nWindwMetricsY > 900) { hm.Height = 993; hm.Width = 1367; hm.panel1.Height = 938; hm.panel1.Width = 1339; } hm.label47.Text = "添加高血压随访记录历史表"; hm.Text = "添加高血压随访记录历史表"; hm.textBox1.Text = name; hm.textBox2.Text = archiveno; hm.textBox49.Text = idnumber; if (hm.ShowDialog() == DialogResult.OK) { //刷新页面 queryhypertensionPatientServices(); MessageBox.Show("添加成功!"); } }
private void button2_Click(object sender, EventArgs e) { if (this.dataGridView1.SelectedRows.Count < 1) { MessageBox.Show("未选中任何行!"); return; } aUHypertensionPatientServices hm = new aUHypertensionPatientServices(); string id = this.dataGridView1.SelectedRows[0].Cells[0].Value.ToString(); hm.id = id; hm.label47.Text = "修改高血压随访记录历史表"; hm.Text = "修改高血压随访记录历史表"; DataTable dt = hypertensionPatient.queryHypertensionPatient0(id); if (dt != null && dt.Rows.Count > 0) { hm.textBox1.Text = dt.Rows[0]["patientName"].ToString(); hm.textBox2.Text = dt.Rows[0]["aichive_no"].ToString(); hm.dateTimePicker1.Value = DateTime.Parse(dt.Rows[0]["visit_date"].ToString()); if (dt.Rows[0]["visit_type"].ToString() == hm.radioButton1.Text) { hm.radioButton1.Checked = true; } ; if (dt.Rows[0]["visit_type"].ToString() == hm.radioButton2.Text) { hm.radioButton2.Checked = true; } ; if (dt.Rows[0]["visit_type"].ToString() == hm.radioButton3.Text) { hm.radioButton3.Checked = true; } ; foreach (Control ctr in hm.panel2.Controls) { //判断该控件是不是CheckBox if (ctr is CheckBox) { //将ctr转换成CheckBox并赋值给ck CheckBox ck = ctr as CheckBox; if (dt.Rows[0]["symptom"].ToString().IndexOf(ck.Text) > -1) { ck.Checked = true; } } } hm.richTextBox1.Text = dt.Rows[0]["other_symptom"].ToString(); hm.numericUpDown9.Value = Decimal.Parse(dt.Rows[0]["sbp"].ToString()); hm.numericUpDown10.Value = Decimal.Parse(dt.Rows[0]["dbp"].ToString()); hm.numericUpDown11.Value = Decimal.Parse(dt.Rows[0]["weight"].ToString()); hm.numericUpDown12.Value = Decimal.Parse(dt.Rows[0]["target_weight"].ToString()); hm.numericUpDown14.Value = Decimal.Parse(dt.Rows[0]["bmi"].ToString()); hm.numericUpDown15.Value = Decimal.Parse(dt.Rows[0]["target_bmi"].ToString()); hm.numericUpDown16.Value = Decimal.Parse(dt.Rows[0]["heart_rate"].ToString()); hm.richTextBox3.Text = dt.Rows[0]["other_sign"].ToString(); hm.numericUpDown1.Value = Decimal.Parse(dt.Rows[0]["smoken"].ToString()); hm.numericUpDown2.Value = Decimal.Parse(dt.Rows[0]["target_somken"].ToString()); hm.numericUpDown3.Value = Decimal.Parse(dt.Rows[0]["wine"].ToString()); hm.numericUpDown4.Value = Decimal.Parse(dt.Rows[0]["target_wine"].ToString()); hm.numericUpDown5.Value = Decimal.Parse(dt.Rows[0]["sport_week"].ToString()); hm.numericUpDown6.Value = Decimal.Parse(dt.Rows[0]["sport_once"].ToString()); hm.numericUpDown7.Value = Decimal.Parse(dt.Rows[0]["target_sport_week"].ToString()); hm.numericUpDown8.Value = Decimal.Parse(dt.Rows[0]["target_sport_once"].ToString()); if (dt.Rows[0]["salt_intake"].ToString() == hm.radioButton4.Text) { hm.radioButton4.Checked = true; } ; if (dt.Rows[0]["salt_intake"].ToString() == hm.radioButton5.Text) { hm.radioButton5.Checked = true; } ; if (dt.Rows[0]["salt_intake"].ToString() == hm.radioButton6.Text) { hm.radioButton6.Checked = true; } ; if (dt.Rows[0]["target_salt_intake"].ToString() == hm.radioButton7.Text) { hm.radioButton7.Checked = true; } ; if (dt.Rows[0]["target_salt_intake"].ToString() == hm.radioButton8.Text) { hm.radioButton8.Checked = true; } ; if (dt.Rows[0]["target_salt_intake"].ToString() == hm.radioButton9.Text) { hm.radioButton9.Checked = true; } ; if (dt.Rows[0]["mind_adjust"].ToString() == hm.radioButton10.Text) { hm.radioButton10.Checked = true; } ; if (dt.Rows[0]["mind_adjust"].ToString() == hm.radioButton11.Text) { hm.radioButton11.Checked = true; } ; if (dt.Rows[0]["mind_adjust"].ToString() == hm.radioButton12.Text) { hm.radioButton12.Checked = true; } ; if (dt.Rows[0]["doctor_obey"].ToString() == hm.radioButton13.Text) { hm.radioButton13.Checked = true; } ; if (dt.Rows[0]["doctor_obey"].ToString() == hm.radioButton14.Text) { hm.radioButton14.Checked = true; } ; if (dt.Rows[0]["doctor_obey"].ToString() == hm.radioButton15.Text) { hm.radioButton15.Checked = true; } ; hm.textBox3.Text = dt.Rows[0]["assist_examine"].ToString(); if (dt.Rows[0]["drug_obey"].ToString() == hm.radioButton22.Text) { hm.radioButton22.Checked = true; } ; if (dt.Rows[0]["drug_obey"].ToString() == hm.radioButton23.Text) { hm.radioButton23.Checked = true; } ; if (dt.Rows[0]["drug_obey"].ToString() == hm.radioButton24.Text) { hm.radioButton24.Checked = true; } ; if (dt.Rows[0]["untoward_effect"].ToString() == hm.radioButton16.Text) { hm.radioButton16.Checked = true; } ; if (dt.Rows[0]["untoward_effect"].ToString() == hm.radioButton17.Text) { hm.radioButton17.Checked = true; } ; hm.textBox8.Text = dt.Rows[0]["untoward_effect_drug"].ToString(); if (dt.Rows[0]["visit_class"].ToString() == hm.radioButton18.Text) { hm.radioButton18.Checked = true; } ; if (dt.Rows[0]["visit_class"].ToString() == hm.radioButton19.Text) { hm.radioButton19.Checked = true; } ; if (dt.Rows[0]["visit_class"].ToString() == hm.radioButton20.Text) { hm.radioButton20.Checked = true; } ; if (dt.Rows[0]["visit_class"].ToString() == hm.radioButton21.Text) { hm.radioButton21.Checked = true; } ; hm.richTextBox2.Text = dt.Rows[0]["advice"].ToString(); hm.textBox5.Text = dt.Rows[0]["transfer_reason"].ToString(); hm.textBox6.Text = dt.Rows[0]["transfer_organ"].ToString(); hm.dateTimePicker2.Value = DateTime.Parse(dt.Rows[0]["next_visit_date"].ToString()); hm.textBox7.Text = dt.Rows[0]["visit_doctor"].ToString(); } else { } if (hm.ShowDialog() == DialogResult.OK) { //刷新页面 queryhypertensionPatientServices(); MessageBox.Show("修改成功!"); } }