Пример #1
0
 private void btnCrear_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (!(String.IsNullOrEmpty(txtRut.Text) || String.IsNullOrEmpty(txtNombre.Text) || String.IsNullOrEmpty(txtDirecion.Text) || String.IsNullOrEmpty(txtEmail.Text) ||
               String.IsNullOrEmpty(txtFono.Text)))
         {
             Biblioteca.Establecimiento est = new Biblioteca.Establecimiento()
             {
                 Id_tributario = txtRut.Text,
                 Direccion     = txtDirecion.Text,
                 Email         = txtEmail.Text,
                 Fono          = txtFono.Text,
                 Nombre        = txtNombre.Text,
                 Id_ciudad     = cb_ciudad.SelectedIndex + 1
             };
             lblMsj.Content = est.crud(2);
         }
         else
         {
             lblMsj.Content = "Llene todos los campos.";
         }
     }
     catch (Exception ex)
     {
         lblMsj.Content = "Error: " + ex;
     }
 }
 private void btnCrear_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         Biblioteca.Establecimiento est = new Biblioteca.Establecimiento()
         {
             Id_tributario = txtRut.Text,
         };
         lblMsj.Content = est.crud(3);
     }
     catch (Exception ex)
     {
         lblMsj.Content = "Error: " + ex;
     }
 }