Пример #1
0
        private void BuscarButton_Click(object sender, EventArgs e)
        {
            int    id     = 0;
            string filtro = "1=1";

            int.TryParse(PersonaIdtextBox.Text, out id);
            try
            {
                if (ValidarTexbox(PersonaIdtextBox) && persona.Buscar(id))
                {
                    PersonaIdtextBox.Text            = persona.PersonaId.ToString();
                    NombrestextBox.Text              = persona.Nombre;
                    TelefonosdataGridView.DataSource = persona.ListadoTeleFonos("TipoId, Telefono", filtro, "");
                    ActivarBotones(true);
                }
                else
                {
                    Mensajes(2, "Id no Existe!");
                    Limpiar();
                    ActivarBotones(false);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }