//busca un auto por patente que tiene que estar registrado anteriormente // en el sistema , si no, le avisa que no esta registrado private void btn_Buscar_patente_Click(object sender, EventArgs e) { DataTable tabla = new DataTable(); DataTable tabla1 = new DataTable(); DataTable tabla2 = new DataTable(); DataTable tablaTipoDoc = new DataTable(); tabla = autoCliente.Consultar_Automovil_Cliente(txt_patente.Text.Trim()); if (this.txt_patente.Text == "") { //valida que en se ingrese alguna patente MessageBox.Show("No ingreso una patente"); txt_patente.Focus(); } else { if (tabla.Rows.Count > 0) { tabla2 = autoCliente.consultar_lugar_playa(this.txt_patente.Text.Trim()); if (tabla2.Rows.Count > 0) { MessageBox.Show("El vehiculo ya se encuentra en el estacionamiento!"); return; } this.txt_nroDoc.Text = tabla.Rows[0]["num_doc1"].ToString(); this.cmb_tipoDoc.Text = tabla.Rows[0]["tipo_doc2"].ToString(); tablaTipoDoc = autoCliente.descripcion_TIPODOC(cmb_tipoDoc.Text); tipoDocumento.Text = tablaTipoDoc.Rows[0]["descripcion"].ToString(); tabla1 = autoCliente.Consultar_Cliente(txt_nroDoc.Text); this.txt_nomCliente.Text = tabla1.Rows[0]["nombres"].ToString(); this.txt_apellido.Text = tabla1.Rows[0]["apellido"].ToString(); cmb_IdPlaya.Enabled = true; txt_Estacionamiento.Enabled = true; txt_horaDesde.Text = DateTime.Now.ToShortTimeString(); dt_fecha_entrada.Text = DateTime.Now.ToString("dd/MM/yyyy"); this.dt_fecha_entrada.Focus(); this.txt_patente.Enabled = false; } else { //ingreso una patente que no existe en el sistema MessageBox.Show("El auto no esta registrado en el sistema"); txt_patente.Text = ""; txt_patente.Focus(); } //valida que no se busque una patente que ya esta registrada en el estacionamiento } }