Ejemplo n.º 1
0
        private async void btnQuery_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                List <UsersUPT> lista    = new List <UsersUPT>();
                UsersUPT        u        = new UsersUPT();
                string          idBuscar = "e058cd1a-e303-4fe6-9a87-b677c8bf00d0";
                lista = await userTableObj.Where(userTableObj => userTableObj.PID == idBuscar).ToListAsync();

                li_nom.ItemsSource       = lista;
                li_nom.DisplayMemberPath = "nombre";
                lista = await userTableObj.Where(userTableObj => userTableObj.PID == idBuscar).ToListAsync();

                li_age.ItemsSource       = lista;
                li_age.DisplayMemberPath = "edad";
                lista = await userTableObj.Where(userTableObj => userTableObj.PID == idBuscar).ToListAsync();

                li_descrip.ItemsSource       = lista;
                li_descrip.DisplayMemberPath = "descripcion";
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Error: {0}", ex);
            }
        }
Ejemplo n.º 2
0
 private void btnSave_Tapped(object sender, TappedRoutedEventArgs e)
 {
     try
     {
         UsersUPT obj = new UsersUPT();
         obj.PID         = txtPID.Text;
         obj.nombre      = txtNombre.Text;
         obj.edad        = txtEdad.Text;
         obj.descripcion = txtDescripcion.Text;
         userTableObj.InsertAsync(obj);
         MessageDialog msgDialog = new MessageDialog("Data Inserted!!!");
         msgDialog.ShowAsync();
     }
     catch (Exception ex)
     {
         MessageDialog msgDialogError = new MessageDialog("Error : " + ex.ToString());
         msgDialogError.ShowAsync();
     }
 }