1 public partial class ucBloodLabs 2 { 3 public delegate void ShowBloodEvent(); 4 public ShowBloodEvent ShowBloodData; 5 }
public partial class ucDiabeticLab { public delegate void ShowCurrentDataEvent(); public ShowCurrentDataEvent ShowCurrentData; }
1 public partial class frmLaboratory { 2 3 ucDiabeticLab.ShowCurrentData += new ucDiabeticLab.ShowCurrentDataEvent(showBloodLabData); 4 private void showBloodLabData() 5 { 6 if (ucBloodTabs == null) 7 { 8 9 ucBloodTabs = new ucBloodLabs(str_PatientId, str_PatientSN); 10 this.pan_Left.Controls.Add(ucBloodTabs); 11 ucBloodTabs.Dock = DockStyle.Fill; 12 ucBloodTabs.ShowBloodData += new Control.ucBloodLabs.ShowBloodDataEvent(showBloodData); 13 } 14 this.ucDiabeticLab.Visible = false; 15 if (ucBloodTabs != null) 16 { 17 this.ucBloodTabs.Visible = true; 18 this.ucBloodTabs.BringToFront(); 19 } 20 this.ucBloodTabs.PatientId = str_PatientId; 21 this.ucBloodTabs.VisitId = str_PatientSN; 22 this.ucBloodTabs.InitPage(); 23 if (frm != null) 24 { 25 frm.Close(); 26 frm = null; 27 } 28 29 } 30 private void showBloodData() 31 { 32 Application.DoEvents(); 33 this.ucDiabeticLab.Visible = true; 34 if (ucBloodTabs != null) 35 { 36 this.ucBloodTabs.Visible = false; 37 } 38 } 39 }