コード例 #1
0
ファイル: RegistroPasa.cs プロジェクト: marcostoff71/CRUDS-c-
 private void btnAceptar_Click(object sender, EventArgs e)
 {
     if (Validaciones())
     {
         Pasajero p1 = new Pasajero(txtNombre.Text, txtApellidoPa.Text, txtApellidoMa.Text, int.Parse(txtEdad.Text), txtOcupacion.Text);
         LPasajero.AgregarPasajero(p1);
         this.Dispose();
         this.Close();
     }
 }
コード例 #2
0
ファイル: Registro.cs プロジェクト: marcostoff71/CRUDS-c-
 private void btnGuardarPasa_Click(object sender, EventArgs e)
 {
     if (ValiPasa())
     {
         Pasajero pasa = new Pasajero();
         pasa.Nombre           = txtNombre.Text;
         pasa.Apellido_Materno = txtApellidoMa.Text;
         pasa.Apellido_Paterno = txtApellidoPa.Text;
         pasa.Edad             = int.Parse(txtEdadPasa.Text);
         pasa.Ocupacion        = txtOcupacionPasa.Text;
         if (this.pasa == null)
         {
             LPasajero.AgregarPasajero(pasa);
         }
         else
         {
             pasa.Id = this.pasa.Id;
             LPasajero.ModificarPasajero(pasa);
         }
         this.Close();
     }
 }