private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
 {
     dataGridView1.ClearSelection();
     if (e.KeyChar == 13)
     {
         DataTable dt = new DataTable();
         C.Dni = txtBuscarCliente.Text;
         dt    = C.BuscarCliente(C.Dni);
         try
         {
             dataGridView1.Rows.Clear();
             for (int i = 0; i < dt.Rows.Count; i++)
             {
                 dataGridView1.Rows.Add(dt.Rows[i][0]);
                 dataGridView1.Rows[i].Cells[0].Value = dt.Rows[i][0].ToString();
                 dataGridView1.Rows[i].Cells[1].Value = dt.Rows[i][1].ToString();
                 dataGridView1.Rows[i].Cells[2].Value = dt.Rows[i][2].ToString();
                 dataGridView1.Rows[i].Cells[3].Value = dt.Rows[i][3].ToString();
                 dataGridView1.Rows[i].Cells[4].Value = dt.Rows[i][4].ToString();
                 dataGridView1.Rows[i].Cells[5].Value = dt.Rows[i][5].ToString();
             }
             dataGridView1.ClearSelection();
             timer1.Stop();
         }
         catch (Exception ex)
         {
             DevComponents.DotNetBar.MessageBoxEx.Show(ex.Message);
         }
     }
     else
     {
         ListarClientes();
         timer1.Start();
     }
 }
        private void Buscar()
        {
            try
            {
                if (!validarBusqueda())
                {
                    return;
                }
                clsCliente objCliente = new clsCliente(strNombreApp);
                objCliente.Documento = this.txtDocumento.Text;


                if (!objCliente.BuscarCliente())
                {
                    this.lblMensaje.Text   = objCliente.Error;
                    this.pnlAlerta.Visible = true;
                    objCliente             = null;
                    return;
                }
                this.txtNombre.Text    = objCliente.Nombre;
                this.txtEmail.Text     = objCliente.Email;
                this.txtNombre.Enabled = false;
                this.txtEmail.Enabled  = false;
                this.pnlAlerta.Visible = false;
            }
            catch (Exception ex)
            {
                this.lblMensaje.Text   = ex.Message;
                this.pnlAlerta.Visible = true;
                return;
            }
        }
Beispiel #3
0
        private void Buscar()
        {
            try
            {
                if (!ValidarDoc())
                {
                    return;
                }
                clsCliente objCliente = new clsCliente(strNombreApp);
                objCliente.Documento = this.txtDocumento.Text;

                if (!objCliente.BuscarCliente())
                {
                    this.lblMensaje.Text    = objCliente.Error;
                    this.pnlAlerta.Visible  = true;
                    this.pnlBotones.Visible = true;
                    objCliente = null;
                    return;
                }
                this.txtNombre.Text       = objCliente.Nombre;
                this.txtNombre.Enabled    = false;
                this.pnlVenta.Visible     = true;
                this.pnlAlerta.Visible    = false;
                this.txtDocumento.Enabled = false;
                this.btnContinuar.Visible = false;
                this.btnRegistrar.Visible = true;
                this.pnlBotones.Visible   = false;
            }
            catch (Exception ex)
            {
                this.lblMensaje.Text   = ex.Message;
                this.pnlAlerta.Visible = true;
                return;
            }
        }
Beispiel #4
0
        public IActionResult buscar([FromBody] clsCliente clsCliente)
        {
            clsCliente        clscliente = new clsCliente();
            List <clsCliente> clientes   = new List <clsCliente>();

            clscliente.id_cliente = clsCliente.id_cliente;
            clientes = clscliente.BuscarCliente();
            if (clientes.Count == 0)
            {
                return(NotFound(clientes));
            }
            else
            {
                return(Ok(clientes));
            }
        }