Пример #1
0
 private void btnBuscar_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         Biblioteca.Establecimiento est = new Biblioteca.Establecimiento()
         {
             Id_tributario = txtRut.Text
         };
         if (est.read())
         {
             txtNombre.Text          = est.Nombre;
             cb_ciudad.SelectedIndex = est.Id_ciudad - 1;
             txtDirecion.Text        = est.Direccion;
             txtEmail.Text           = est.Email;
             txtFono.Text            = est.Fono;
             lblMsj.Content          = "Establecimiento Encontrado.";
         }
         else
         {
             lblMsj.Content = "Establecimiento No Encontrado.";
         }
     }
     catch (Exception ex)
     {
         lblMsj.Content = "Error: " + ex;
     }
 }
 private void Buscark()
 {
     try
     {
         Biblioteca.Establecimiento est = new Biblioteca.Establecimiento()
         {
             Id_tributario = txtRut.Text
         };
         if (est.read())
         {
             txtNombre.Text          = est.Nombre;
             cb_ciudad.SelectedIndex = est.Id_ciudad - 1;
             txtDirecion.Text        = est.Direccion;
             txtEmail.Text           = est.Email;
             txtFono.Text            = est.Fono;
         }
     }
     catch (Exception ex)
     {
         lblMsj.Content = "Error: " + ex;
     }
 }