Esempio n. 1
0
        private void BTEliminaPilot_Click(object sender, EventArgs e)
        {
            if (LBNomPilot.Text != ":")
            {
                /////////////////////////
                /// FORMA 1. ELIMINA A PARTIR DEL NOM DE L'ESCUDERIA
                pilot pil = new pilot();
                pil.eliminaPilot(LBNomPilot.Text);

                /////////////////////////

                //// FORMA 2. ELIMINAR A PARTIR DE L'OBJECTE //
                ////CONSTRUÏM OBJECTE
                //String escuderia, pais, motor;
                //int any;

                //escuderia = LBEscuderia.Text;
                //pais = LBPais.Text;
                //motor = LBMotor.Text;
                //any = Convert.ToInt32(LBAny.Text);

                //escuderia es = new escuderia(escuderia, pais, any, motor);

                //es.eliminaEscuderia();

                // tornem les labels a la situació inicial
                LBNomPilot.Text          = ":";
                LBNacionalitatPilot.Text = ":";
                LBEscuderiaPilot.Text    = ":";
                LBDorsalPilot.Text       = ":";
                TBNompilot.Text          = "";
            }
        }
Esempio n. 2
0
        private void BElimina_Click(object sender, EventArgs e)
        {
            if (!LBNom.Text.Equals(":"))
            {
                pilot p = new pilot();
                p.eliminaPilot(LBNom.Text);


                // tornem les labels a la situació inicial
                LBEscuderia.Text = ":";
                LBNom.Text       = ":";
                LBDorsal.Text    = "(:)";
                LBPais.Text      = ":";
            }
        }