private void LoadDDLs() { Pilot Allpilots = new Pilot(); Allpilots.GetAllPilots(); uiDropDownListPilot.DataSource = Allpilots.DefaultView; uiDropDownListPilot.DataTextField = "DisplayName"; uiDropDownListPilot.DataValueField = "PilotID"; uiDropDownListPilot.DataBind(); uiDropDownListPilot.Items.Insert(0, new ListItem("Select Pilot", "")); Pilot AllCopilots = new Pilot(); AllCopilots.GetAllCoPilots(); uiDropDownListCoPilot.DataSource = AllCopilots.DefaultView; uiDropDownListCoPilot.DataTextField = "DisplayName"; uiDropDownListCoPilot.DataValueField = "PilotID"; uiDropDownListCoPilot.DataBind(); uiDropDownListCoPilot.Items.Insert(0, new ListItem("Select Co-Pilot", "")); Position AllPositions = new Position(); AllPositions.LoadAll(); uiDropDownListPilotPos.DataSource = AllPositions.DefaultView; uiDropDownListPilotPos.DataTextField = "Title"; uiDropDownListPilotPos.DataValueField = "PositionID"; uiDropDownListPilotPos.DataBind(); uiDropDownListPilotPos.Items.Insert(0, new ListItem("Select Position", "")); uiDropDownListCOPos.DataSource = AllPositions.DefaultView; uiDropDownListCOPos.DataTextField = "Title"; uiDropDownListCOPos.DataValueField = "PositionID"; uiDropDownListCOPos.DataBind(); uiDropDownListCOPos.Items.Insert(0, new ListItem("Select Position", "")); Crew AllCrew = new Crew(); AllCrew.LoadAll(); uiDropDownListCrew.DataSource = AllCrew.DefaultView; uiDropDownListCrew.DataTextField = "Name"; uiDropDownListCrew.DataValueField = "CrewID"; uiDropDownListCrew.DataBind(); uiDropDownListCrew.Items.Insert(0, new ListItem("Select Member", "")); uiDropDownListCrewPos.DataSource = AllPositions.DefaultView; ; uiDropDownListCrewPos.DataTextField = "Title"; uiDropDownListCrewPos.DataValueField = "PositionID"; uiDropDownListCrewPos.DataBind(); uiDropDownListCrewPos.Items.Insert(0, new ListItem("Select Position", "")); AirPort AllAirports = new AirPort(); AllAirports.LoadAll(); uiDropDownListSectorFrom.DataSource = AllAirports.DefaultView; uiDropDownListSectorFrom.DataTextField = "IATACode"; uiDropDownListSectorFrom.DataValueField = "AirPortID"; uiDropDownListSectorFrom.DataBind(); uiDropDownListSectorFrom.Items.Insert(0, new ListItem("Select Airport", "")); uiDropDownListSectorTo.DataSource = AllAirports.DefaultView; uiDropDownListSectorTo.DataTextField = "IATACode"; uiDropDownListSectorTo.DataValueField = "AirPortID"; uiDropDownListSectorTo.DataBind(); uiDropDownListSectorTo.Items.Insert(0, new ListItem("Select Airport", "")); AirPlane Ap = new AirPlane(); Ap.LoadAll(); uiDropDownListAirCraftRegistration.DataSource = Ap.DefaultView; uiDropDownListAirCraftRegistration.DataTextField = "Name"; uiDropDownListAirCraftRegistration.DataValueField = "AirPlaneID"; uiDropDownListAirCraftRegistration.DataBind(); }
private void LoadDDLs() { Pilot Allpilots = new Pilot(); Allpilots.GetAllPilots(); uiDropDownListPilot.DataSource = Allpilots.DefaultView; uiDropDownListPilot.DataTextField = "DisplayName"; uiDropDownListPilot.DataValueField = "PilotID"; uiDropDownListPilot.DataBind(); uiDropDownListPilot.Items.Insert(0, new ListItem("Select Pilot", "")); Pilot AllCopilots = new Pilot(); AllCopilots.GetAllCoPilots(); uiDropDownListCoPilot.DataSource = AllCopilots.DefaultView; uiDropDownListCoPilot.DataTextField = "DisplayName"; uiDropDownListCoPilot.DataValueField = "PilotID"; uiDropDownListCoPilot.DataBind(); uiDropDownListCoPilot.Items.Insert(0, new ListItem("Select Co-Pilot", "")); Crew AllCrew = new Crew(); AllCrew.LoadAll(); uiDropDownListCrew.DataSource = AllCrew.DefaultView; uiDropDownListCrew.DataTextField = "Name"; uiDropDownListCrew.DataValueField = "CrewID"; uiDropDownListCrew.DataBind(); uiDropDownListCrew.Items.Insert(0, new ListItem("Select Member", "")); AirPort AllAirports = new AirPort(); AllAirports.LoadAll(); uiDropDownListSectorFrom.DataSource = AllAirports.DefaultView; uiDropDownListSectorFrom.DataTextField = "IATACode"; uiDropDownListSectorFrom.DataValueField = "AirPortID"; uiDropDownListSectorFrom.DataBind(); uiDropDownListSectorFrom.Items.Insert(0, new ListItem("Select Airport", "0")); uiDropDownListSectorTo.DataSource = AllAirports.DefaultView; uiDropDownListSectorTo.DataTextField = "IATACode"; uiDropDownListSectorTo.DataValueField = "AirPortID"; uiDropDownListSectorTo.DataBind(); uiDropDownListSectorTo.Items.Insert(0, new ListItem("Select Airport", "0")); }
private void LoadDDLs() { Pilot Allpilots = new Pilot(); Allpilots.GetAllPilots(); uiDropDownListPilot.DataSource = Allpilots.DefaultView; uiDropDownListPilot.DataTextField = "DisplayName"; uiDropDownListPilot.DataValueField = "PilotID"; uiDropDownListPilot.DataBind(); uiDropDownListPilot.Items.Insert(0, new ListItem("Select Pilot", "")); Pilot AllCopilots = new Pilot(); AllCopilots.GetAllCoPilots(); uiDropDownListCoPilot.DataSource = AllCopilots.DefaultView; uiDropDownListCoPilot.DataTextField = "DisplayName"; uiDropDownListCoPilot.DataValueField = "PilotID"; uiDropDownListCoPilot.DataBind(); uiDropDownListCoPilot.Items.Insert(0, new ListItem("Select Co-Pilot", "")); Position AllPositions = new Position(); AllPositions.LoadAll(); uiDropDownListPilotPos.DataSource = AllPositions.DefaultView; uiDropDownListPilotPos.DataTextField= "Title"; uiDropDownListPilotPos.DataValueField = "PositionID"; uiDropDownListPilotPos.DataBind(); uiDropDownListPilotPos.Items.Insert(0, new ListItem("Select Position", "")); uiDropDownListCOPos.DataSource = AllPositions.DefaultView; uiDropDownListCOPos.DataTextField = "Title"; uiDropDownListCOPos.DataValueField = "PositionID"; uiDropDownListCOPos.DataBind(); uiDropDownListCOPos.Items.Insert(0, new ListItem("Select Position", "")); }