public static IEnumerable <CheckrideBadge> BadgesForUserCheckrides(string szUser) { List <CheckrideBadge> lst = new List <CheckrideBadge>(); if (String.IsNullOrEmpty(szUser)) { return(lst); } UserRatings ur = new UserRatings(szUser); foreach (Checkride cr in ur.Checkrides) { lst.Add(new CheckrideBadge(cr)); } return(lst); }
private void InitPilotInfo() { dateMedical.Date = m_pf.LastMedical; cmbMonthsMedical.SelectedValue = m_pf.MonthsToMedical.ToString(CultureInfo.CurrentCulture); rblMedicalDurationType.SelectedIndex = m_pf.UsesICAOMedical ? 1 : 0; txtCertificate.Text = m_pf.Certificate; txtLicense.Text = m_pf.License; mfbTypeInDateCFIExpiration.Date = m_pf.CertificateExpiration; mfbDateEnglishCheck.Date = m_pf.EnglishProficiencyExpiration; UpdateNextMedical(m_pf); BasicMedManager.RefreshBasicMedEvents(); gvIPC.DataSource = ProfileEvent.GetIPCEvents(User.Identity.Name); gvIPC.DataBind(); MyFlightbook.Achievements.UserRatings ur = new MyFlightbook.Achievements.UserRatings(m_pf.UserName); gvRatings.DataSource = ur.Licenses; gvRatings.DataBind(); ProfileEvent[] rgpfeBFR = ProfileEvent.GetBFREvents(User.Identity.Name, m_pf.LastBFREvent); gvBFR.DataSource = rgpfeBFR; gvBFR.DataBind(); if (rgpfeBFR.Length > 0) // we have at least one BFR event, so the last one should be the most recent. { lblNextBFR.Text = m_pf.NextBFR(rgpfeBFR[rgpfeBFR.Length - 1].Date).ToShortDateString(); pnlNextBFR.Visible = true; } string szPane = Request["pane"]; if (!String.IsNullOrEmpty(szPane)) { for (int i = 0; i < accordianPilotInfo.Panes.Count; i++) { switch (szPane) { case "medical": if (accordianPilotInfo.Panes[i] == acpMedical) { accordianPilotInfo.SelectedIndex = i; } break; case "certificates": if (accordianPilotInfo.Panes[i] == acpCertificates) { accordianPilotInfo.SelectedIndex = i; } break; case "flightreview": if (accordianPilotInfo.Panes[i] == acpFlightReviews) { accordianPilotInfo.SelectedIndex = i; } break; case "ipc": if (accordianPilotInfo.Panes[i] == acpIPCs) { accordianPilotInfo.SelectedIndex = i; } break; default: break; } } } }