From 7486ceee553dd1538f75edf86bfa90f40e894805 Mon Sep 17 00:00:00 2001 From: luoxingjian <1010378449@qq.com> Date: Fri, 15 Nov 2024 11:10:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E6=B3=A8=E9=87=8A=E4=B8=8E=E7=BB=86?= =?UTF-8?q?=E8=8A=82=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PEIS/View/Exam/CareerHisInqForm.cs | 45 +++++++++++++++++------------ PEIS/View/Exam/EmploymentHisForm.cs | 3 ++ 2 files changed, 29 insertions(+), 19 deletions(-) diff --git a/PEIS/View/Exam/CareerHisInqForm.cs b/PEIS/View/Exam/CareerHisInqForm.cs index b8bc545..535b4d5 100644 --- a/PEIS/View/Exam/CareerHisInqForm.cs +++ b/PEIS/View/Exam/CareerHisInqForm.cs @@ -10,16 +10,20 @@ using System.Data; using System.Drawing; using System.Linq; using System.Text; +using System.Threading; using System.Windows.Forms; namespace PEIS.View.Exam { + /// + /// 职业史问诊 + /// public partial class CareerHisInqForm : ViewBase, ICareerHisInqView { private Int64 EID; private Int64? ID; /// - /// + /// 职业史问诊 /// /// 体检患者表id public CareerHisInqForm(Int64 eID) @@ -36,9 +40,12 @@ namespace PEIS.View.Exam private void CareerHisInqForm_Shown(object sender, EventArgs e) { - LoadPatients(EID); - LoadEmploymentHis(EID); - LoadExamCareerHisInq(EID); + ThreadPool.QueueUserWorkItem(state => + { + LoadPatients(EID); + LoadEmploymentHis(EID); + LoadExamCareerHisInq(EID); + }); } private void ToolMenuItem_Add_Click(object sender, EventArgs e) @@ -85,18 +92,18 @@ namespace PEIS.View.Exam { if (patient!=null) { - textBox1.Text = patient.ID.ToString(); - textBox2.Text= patient.ID.ToString(); - textBox3.Text = patient.Name; - textBox4.Text = patient.Sex == "1" ? "男" : "女"; - textBox5.Text = patient.Age.ToString(); - //textBox9.Text = patient. - //textBox7.Text = patient.HazardFactors; - //textBox8.Text= patient - //textBox9.Text= patient.JobTypes - //textBox10.Text = - //textBox11.Text = patient.WorkYears - //textBox12.Text = + Invoke(new Action(() => textBox1.Text = patient.ID.ToString())); + Invoke(new Action(() => textBox2.Text= patient.ID.ToString())); + Invoke(new Action(() => textBox3.Text = patient.Name)); + Invoke(new Action(() => textBox4.Text = patient.Sex == "1" ? "男" : "女")); + Invoke(new Action(() => textBox5.Text = patient.Age.ToString())); + //Invoke(new Action(() =>textBox9.Text = patient)). + //Invoke(new Action(() =>textBox7.Text = patient.HazardFactors)); + //Invoke(new Action(() =>textBox8.Text= patient)) + //Invoke(new Action(() =>textBox9.Text= patient.JobTypes)) + //Invoke(new Action(() =>textBox10.Text = )) + //Invoke(new Action(() =>textBox11.Text = patient.WorkYears)) + //Invoke(new Action(() =>textBox12.Text = )) } } @@ -180,7 +187,7 @@ namespace PEIS.View.Exam if (textbox != null) { var propert = properties.Where(p => p.Name == textbox.Name).FirstOrDefault(); - if (propert!=null) textbox.Text = propert.GetValue(examCareerHis, null)?.ToString(); + if (propert!=null) Invoke(new Action(()=>textbox.Text = propert.GetValue(examCareerHis, null)?.ToString())); } if (panel != null) @@ -196,8 +203,8 @@ namespace PEIS.View.Exam { var value = propert.GetValue(examCareerHis, null)?.ToString(); var radioName = pName + "_" + value; - if (radioButName == radioName) radioButton.Checked = true; - else radioButton.Checked = false; + if (radioButName == radioName) Invoke(new Action(() => radioButton.Checked = true)); + else Invoke(new Action(() => radioButton.Checked = false)); } } } diff --git a/PEIS/View/Exam/EmploymentHisForm.cs b/PEIS/View/Exam/EmploymentHisForm.cs index 8dcdda4..c431e93 100644 --- a/PEIS/View/Exam/EmploymentHisForm.cs +++ b/PEIS/View/Exam/EmploymentHisForm.cs @@ -11,6 +11,9 @@ using System.Windows.Forms; namespace PEIS.View.Exam { + /// + /// 职业史 + /// public partial class EmploymentHisForm : Form { private Int64 PID;