private void buscar_Click(object sender, EventArgs e)
 {
     if (clienteId == 0 && this.valido())
     {
         GD2C2015DataSet.ClientesRow[] result = (GD2C2015DataSet.ClientesRow[])this.gD2C2015DataSet.Clientes.Select("cli_dni='" + this.dni.Text + "' AND cli_activo=1");
         if (result.Length == 0)
         {
             MessageBox.Show("No existe el cliente con el dni ingresado");
             return;
         }
         else if (result.Length > 1)
         {
             BusquedaClienteForm form = new BusquedaClienteForm(this.dni.Text, "Consulta");
             form.MdiParent = this.MdiParent;
             form.Show();
             this.Close();
         }
         else
         {
             GD2C2015DataSet.ClientesRow row = result.First();
             clienteId = row.cli_id;
         }
     }
     historialMillasTableAdapter.Fill(gD2C2015DataSet.historialMillas, clienteId);
     this.millas_acumuladas.Text = this.historialMillasTableAdapter.millasDisponibles(clienteId).ToString();
     this.clienteId = 0;
 }
 private void button1_Click(object sender, EventArgs e)
 {
     if (this.clienteId != 0 && !this.volverABuscar)
     {
         GD2C2015DataSet.ClientesRow[] result = (GD2C2015DataSet.ClientesRow[])this.gD2C2015DataSet.Clientes.Select("cli_id='" + clienteId + "'");
         GD2C2015DataSet.ClientesRow row = result.First();
         clienteId = row.cli_id;
         this.nombreLabel.Text = row.cli_nombre;
         this.apellidoLabel.Text = row.cli_apellido;
         millasAcumuladas = Convert.ToInt32(this.historialMillasTableAdapter1.millasDisponibles(clienteId));
         millasLabel.Text = millasAcumuladas.ToString();
         this.volverABuscar = true;
     }
     else if (this.valido())
     {
         GD2C2015DataSet.ClientesRow[] result = (GD2C2015DataSet.ClientesRow[])this.gD2C2015DataSet.Clientes.Select("cli_dni='" + this.dni.Text + "' AND cli_activo=1");
         if (result.Length == 0)
         {
             MessageBox.Show("No existe el cliente con el dni ingresado");
             return;
         }
         else if (result.Length > 1)
         {
             BusquedaClienteForm form = new BusquedaClienteForm(this.dni.Text, "Canje");
             form.MdiParent = this.MdiParent;
             form.Show();
             this.Close();
         }
         else
         {
             GD2C2015DataSet.ClientesRow row = result.First();
             clienteId = row.cli_id;
             this.nombreLabel.Text = row.cli_nombre;
             this.apellidoLabel.Text = row.cli_apellido;
             millasAcumuladas = Convert.ToInt32(this.historialMillasTableAdapter1.millasDisponibles(clienteId));
             millasLabel.Text = millasAcumuladas.ToString();
             this.volverABuscar = true;
         }
     }
 }