예제 #1
0
        async void OnCreateDPEClicked(object sender, EventArgs e)
        {
            Pilot newPilot = Database.AddPilot(this.txtName.Text, this.txtPassword.Text, this.txtEmail.Text, this.txtCity.Text, this.txtState.Text, null);

            if (newPilot != null)
            {
                foreach (var certification in this.Certifications)
                {
                    Database.AddCertificationToDPE(newPilot.ID, certification.Name);
                }
            }

            Navigation.InsertPageBefore(new HomePage(newPilot), this);
            await Navigation.PopAsync();
        }
예제 #2
0
        static public Pilot FindPilot(string password, string email)
        {
            if (_database == null)
            {
                Initialize();
            }

            Pilot pilot = _database.FindWithQuery <Pilot>("SELECT * FROM Pilots WHERE Password = ? AND email = ?", new object[] { password, email });

            if (pilot == null)
            {
                return(null);
            }

            if (pilot.HomeAirportID != null)
            {
                pilot.HomeAirport = _database.FindWithQuery <Airport>("SELECT * FROM Airports WHERE LocID = ?", pilot.HomeAirportID);
            }

            return(pilot);
        }
예제 #3
0
 internal static void AddPilot(Pilot newPilot)
 {
     AddPilot(newPilot.Name, newPilot.Password, newPilot.Email, newPilot.HomeAirport);
 }