Пример #1
0
        private void txtCuit_TextChanged(object sender, EventArgs e)
        {
            int    b      = 0;
            string NroDoc = txtCuit.Text;

            if (NroDoc.Length < 3)
            {
                return;
            }
            cCliente  cli  = new cCliente();
            DataTable trdo = cli.GetClientesxCuit(NroDoc);

            if (trdo.Rows.Count > 0)
            {
                if (trdo.Rows[0]["CodCliente"].ToString() != "")
                {
                    Int32 CodCliente = Convert.ToInt32(trdo.Rows[0]["CodCliente"].ToString());
                    GetClientexCodigo(CodCliente);
                    b = 1;
                }
            }
            if (b == 0)
            {
                txtCodCliente.Text = "";
                txtApellido.Text   = "";
                txtNombre.Text     = "";
            }
        }