private void button3_Click(object sender, EventArgs e) { if (this.dataGridView1.SelectedRows.Count < 1) { MessageBox.Show("未选中任何行!"); return; } aUolderHelthService hm = new aUolderHelthService(); 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 sex = dataGridView1.SelectedRows[0].Cells[7].Value.ToString(); string barcode = dataGridView1.SelectedRows[0].Cells["bar_code"].Value.ToString(); string examid = dataGridView1.SelectedRows[0].Cells["exam_id"].Value.ToString(); hm.label47.Text = "修改老年人生活自理能力评估表"; hm.Text = "修改老年人生活自理能力评估表"; hm.flag = 1; hm.sex = sex; hm.archiveno = archiveno; hm._barCode = barcode; hm._examid = examid; DataTable dt = null; if (examid == "") { dt = olderHelthS.query(archiveno); //查找对应的ID healthCheckupDao hcd = new healthCheckupDao(); examid = hcd.GetExaminationRecord(archiveno, idnumber, barcode); } else { dt = olderHelthS.queryForExamID(examid); } if (dt == null || dt.Rows.Count < 1) { MessageBox.Show("此人未参加自理能力评估,请先添加!"); return; } if (dt != null && dt.Rows.Count > 0) { hm.textBox1.Text = dt.Rows[0]["name"].ToString(); hm.textBox2.Text = dt.Rows[0]["aichive_no"].ToString(); hm.textBox12.Text = dt.Rows[0]["id_number"].ToString(); string[] ck2 = dt.Rows[0]["answer_result"].ToString().Split(','); hm.numericUpDown1.Value = Decimal.Parse(ck2[0]); hm.numericUpDown2.Value = Decimal.Parse(ck2[1]); hm.numericUpDown3.Value = Decimal.Parse(ck2[2]); hm.numericUpDown4.Value = Decimal.Parse(ck2[3]); hm.numericUpDown5.Value = Decimal.Parse(ck2[4]); hm.numericUpDown6.Value = Decimal.Parse(dt.Rows[0]["total_score"].ToString()); } if (hm.ShowDialog() == DialogResult.OK) { //xcuncode = basicInfoSettings.xcuncode; //刷新页面 queryOlderHelthService(); MessageBox.Show("修改成功!"); } }
private void button2_Click(object sender, EventArgs e) { if (dataGridView1.SelectedRows.Count < 1) { 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 sex = dataGridView1.SelectedRows[0].Cells[7].Value.ToString(); string barcode = dataGridView1.SelectedRows[0].Cells["bar_code"].Value.ToString(); string examid = dataGridView1.SelectedRows[0].Cells["exam_id"].Value.ToString(); DataTable dt = null; if (examid == "") { //dt = olderHelthS.query(archiveno); dt = olderHelthS.query1(archiveno, barcode); //查找对应的ID healthCheckupDao hcd = new healthCheckupDao(); examid = hcd.GetExaminationRecord(archiveno, idnumber, barcode); } else { dt = olderHelthS.queryForExamID(examid); } if (dt.Rows.Count > 0) { string _testdate = dt.Rows[0]["test_date"].ToString(); string _strDisplay = string.Format("此身份信息号已参加过评估了,问询日期为{0} !", _testdate); MessageBox.Show(_strDisplay); return; } aUolderHelthService hm = new aUolderHelthService(); hm.label47.Text = "添加老年人生活自理能力评估表"; hm.Text = "添加老年人生活自理能力评估表"; hm.textBox1.Text = name; hm.textBox2.Text = archiveno; hm.textBox12.Text = idnumber; hm.sex = sex; hm.flag = 0; hm._barCode = barcode; hm._examid = examid; if (hm.ShowDialog() == DialogResult.OK) { //刷新页面 //xcuncode = basicInfoSettings.xcuncode; queryOlderHelthService(); MessageBox.Show("添加成功!"); } }
private void button2_Click(object sender, EventArgs e) { aUolderHelthService hm = new aUolderHelthService(); hm.label47.Text = "添加老年人生活自理能力评估表"; hm.Text = "添加老年人生活自理能力评估表"; if (hm.ShowDialog() == DialogResult.OK) { //刷新页面 queryOlderHelthService(); MessageBox.Show("添加成功!"); } }