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; } } } }
public void InitPilotInfo() { mfbEASATip.BodyContent = Branding.ReBrand(Resources.Preferences.MedicalEASATip); dateMedical.Date = m_pf.LastMedical; dateMedical.TextControl.ValidationGroup = "valPilotInfo"; MonthsToMedical = m_pf.MonthsToMedical; MedicalType mt = new ProfileCurrency(m_pf).TypeOfMedical; SelectedMedicalType = mt; dateDOB.Date = m_pf.DateOfBirth ?? DateTime.MinValue; UpdateForMedicalType(mt); UsesICAOMedical = m_pf.UsesICAOMedical; UpdateNextMedical(); txtCertificate.Text = m_pf.Certificate; txtLicense.Text = m_pf.License; txtLicense.Attributes["dir"] = txtCertificate.Attributes["dir"] = "auto"; txtMedicalNotes.Text = m_pf.GetPreferenceForKey(MFBConstants.keyMedicalNotes) ?? string.Empty; mfbTypeInDateCFIExpiration.Date = m_pf.CertificateExpiration; mfbDateEnglishCheck.Date = m_pf.EnglishProficiencyExpiration; BasicMedManager.RefreshBasicMedEvents(); gvIPC.DataSource = ProfileEvent.GetIPCEvents(Page.User.Identity.Name); gvIPC.DataBind(); Achievements.UserRatings ur = new Achievements.UserRatings(m_pf.UserName); gvRatings.DataSource = ur.Licenses; gvRatings.DataBind(); ProfileCurrency mc = new ProfileCurrency(m_pf); ProfileEvent[] rgpfeBFR = ProfileEvent.GetBFREvents(Page.User.Identity.Name, mc.LastBFREvent); gvBFR.DataSource = rgpfeBFR; gvBFR.DataBind(); if (rgpfeBFR.Any()) // we have at least one BFR event, so the first one should be the most recent. { lblNextBFR.Text = ProfileCurrency.NextBFR(rgpfeBFR[0].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; } } } }