void BuscarCLientes() { DataTable dtResult = new DataTable(); objClientes.mysConec = mysConec; dtResult = objClientes.BuscarCliPro(dtClientes, 1, "n_id", ""); if (dtResult != null) { if (dtResult.Rows.Count != 0) { TxtNumRuc.Text = dtResult.Rows[0]["c_numdoc"].ToString(); LblIdCliente.Text = dtResult.Rows[0]["n_id"].ToString(); TxtNomCli.Text = dtResult.Rows[0]["c_nombre"].ToString(); TxtDireccion.Text = dtResult.Rows[0]["c_dir"].ToString(); //dtPrecios = objVentas.UltimoPrecioCliente(STU_SISTEMA.EMPRESAID, Convert.ToInt32(LblIdCliente.Text)); FgDetalle.Focus(); FgDetalle.Select(1, 1); } else { TxtNumRuc.Text = ""; LblIdCliente.Text = ""; TxtNomCli.Text = ""; TxtDireccion.Text = ""; } } }
private void TxtNumRuc_Validated(object sender, EventArgs e) { if (TxtNumRuc.Text != "") { DataTable DtCliente2 = new DataTable(); DtCliente2 = funGen.DataTableFiltrar(dtClientes, "c_numdoc = '" + TxtNumRuc.Text + "'"); if ((DtCliente2 != null) && (DtCliente2.Rows.Count != 0)) { TxtNomCli.Text = DtCliente2.Rows[0]["c_nombre"].ToString(); TxtDireccion.Text = DtCliente2.Rows[0]["c_dir"].ToString(); LblIdCliente.Text = DtCliente2.Rows[0]["n_id"].ToString(); FgDetalle.Focus(); FgDetalle.Select(1, 1); } else { TxtNumRuc.Text = ""; LblIdCliente.Text = ""; TxtNumRuc.Focus(); TxtNomCli.Text = ""; TxtDireccion.Text = ""; } } }