///<summary>Gets the first referral "from" for the given patient. Will return null if no "from" found for patient.</summary> public static Referral GetReferralForPat(int patNum) { RefAttach[] RefAttachList = RefAttaches.Refresh(patNum); for (int i = 0; i < RefAttachList.Length; i++) { if (RefAttachList[i].IsFrom) { return(GetReferral(RefAttachList[i].ReferralNum)); } } return(null); }
private void FillGrid() { RefAttachList = RefAttaches.Refresh(PatNum); gridMain.BeginUpdate(); gridMain.Columns.Clear(); ODGridColumn col = new ODGridColumn(Lan.g("TableRefList", "From/To"), 50); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableRefList", "Name"), 120); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableRefList", "Date"), 70); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableRefList", "Status"), 80); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableRefList", "Note"), 200); gridMain.Columns.Add(col); gridMain.Rows.Clear(); ODGridRow row; //Referral referral; for (int i = 0; i < RefAttachList.Length; i++) { row = new ODGridRow(); if (RefAttachList[i].IsFrom) { row.Cells.Add(Lan.g(this, "From")); } else { row.Cells.Add(Lan.g(this, "To")); } row.Cells.Add(Referrals.GetNameFL(RefAttachList[i].ReferralNum)); //referral=Referrals.GetReferral(RefAttachList[i].ReferralNum); if (RefAttachList[i].RefDate.Year < 1880) { row.Cells.Add(""); } else { row.Cells.Add(RefAttachList[i].RefDate.ToShortDateString()); } row.Cells.Add(Lan.g("enumReferralToStatus", RefAttachList[i].RefToStatus.ToString())); row.Cells.Add(RefAttachList[i].Note); gridMain.Rows.Add(row); } gridMain.EndUpdate(); }