Esempio n. 1
0
 private async void SearchBook()
 {
     BookAccess bookAccess = new BookAccess();
     var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
     try
     {
         if (CanExecute() == true)
         {
             var codeCategorie = SelectedCategory.CodeCategorie;
             codeCategorie = codeCategorie.Replace(" ", "_");
             BooksSearch = await bookAccess.GetBookSearch(WordSearch, codeCategorie);
             if(BooksSearch.Count == 0)
             {
                 string str = loader.GetString("NoResult");
                 ShowToast(str);
             }
         }
         else
         {                    
             string str = loader.GetString("Search_Missing");
             throw new EmptyFieldsException(str);
         }
     }
     catch (EmptyFieldsException e)
     {
         ShowToast(e.ErrorMessage);
     }
     catch (NoNetworkException e)
     {
         ShowToast(e.ErrorMessage);
     }
 }
Esempio n. 2
0
 public async void LoadBook30LastDays()
 {
     BookAccess bookAccess = new BookAccess();
     try
     {
         Books30DaysLast = await bookAccess.GetBook30LastDays();
     }
     catch (NoNetworkException e)
     {
         ShowToast(e.ErrorMessage);
     }
 }