日期:2014-05-17 浏览次数:20887 次
private void ReloadPatients()
{
this.label1.Visible = true;
ServiceRequest request = new ServiceRequest(Program.MODULE_NAME, "Patient", "getWardPatientList");
request.AddParameter("wardID", Program.UserContext.WardID);
ServiceResponse response;
try
{
response = Program.InvokeWebService(request);
}
catch (Exception e)
{
MessageBox.Show(e.Message, "加载病人", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1);
return;
}
PatientList list = response.GetResult<PatientList>();
if (list.Patients == null) list.Patients = new Patient[0];
lvwPatient.BeginUpdate();
lvwPatient.Items.Clear();
foreach (Patient p in list.Patients)
{
ListViewItem item = new ListViewItem(new string[] { p.PatientName, p.Age, p.BedNo, p.AdmissionNo, p.Diagnosis });
item.Tag = p;
if (p.Sex != null && p.Sex.StartsWith("男"))
{
item.ImageIndex = 0;
}
else if (p.Sex != null && p.Sex.StartsWith("女"))
{
item.ImageIndex = 1;
&nb