public void LoadData(int _patientId, int _hospitalId) { PatientViewData pvd = new PatientViewData(); pvd.finishMoneyCalculateHandler += new EventHandler(pvd_finishMoneyCalculateHandler); pvd.GetZyPatient(_patientId, _hospitalId); showdata(pvd); }
private void showdata(PatientViewData pvd) { //labInfo.Text = ""; if (pvd == null || pvd.zyPatientData == null) { return; } List <string> data = new List <string>(); foreach (KeyValuePair <string, string> val in paramDic) { PropertyInfo proinfo = pvd.GetType().GetProperty(val.Value); if (proinfo != null) { if (pvd.finishMoneyCalculate == false) { data.Add(val.Key + ":" + "<b>计算中...</b>"); } else { data.Add(val.Key + ":" + "<b>" + proinfo.GetValue(pvd, null).ToString() + "</b>"); } continue; } proinfo = pvd.zyPatientData.GetType().GetProperty(val.Value); if (proinfo != null) { data.Add(val.Key + ":" + "<b>" + proinfo.GetValue(pvd.zyPatientData, null).ToString() + "</b>"); continue; } } this.labInfo.Invoke((MethodInvoker) delegate() { labInfo.Text = string.Join(" ", data.ToArray()); }); }