예제 #1
0
 private void Basic_search(object sender, RoutedEventArgs e)
 {
     if (this.Verify_category())
     {
         RegistrySearchCondition condition = new RegistrySearchCondition
         {
             Default_search = false,
             Category       = SearchCategoryButton.Content.ToString(),
             Currency       = "",
             Amount_from    = -1,
             Amount_to      = -1,
             Type           = "",
             From_date      = new DateTime(),
             To_date        = new DateTime(),
             In_description = ""
         };
         List <RegistryRow> results = DatabaseHandler.Get_registries(GlobalVariables.temporary_file_path, condition);
         if (results.Count() >= 1)
         {
             SearchResultsDialog results_dialog = new SearchResultsDialog();
             results_dialog.Set_rows(results);
             if (results_dialog.custom_show_dialog())
             {
                 GlobalVariables.registry_view.Set_rows();
             }
         }
         else
         {
             NoResultsDialog no_results_dialog = new NoResultsDialog();
             no_results_dialog.ShowDialog();
         }
     }
 }
 private void Search_button(object sender, RoutedEventArgs e)
 {
     if (this.Verify_search())
     {
         RegistrySearchCondition condition = new RegistrySearchCondition
         {
             Type           = this.Type_,
             In_description = this.Description,
             Category       = this.Category,
             Currency       = this.Currency,
             To_date        = this.Date_to,
             From_date      = this.Date_from,
             Amount_from    = this.Amount_from,
             Amount_to      = this.Amount_to
         };
         List <RegistryRow> search_results = DatabaseHandler.Get_registries(GlobalVariables.temporary_file_path, condition);
         if (search_results.Count() >= 1)
         {
             SearchResultsDialog results_dialog = new SearchResultsDialog();
             results_dialog.Set_rows(search_results);
             if (results_dialog.custom_show_dialog())
             {
                 this.success = true;
             }
         }
         else
         {
             NoResultsDialog no_results_dialog = new NoResultsDialog();
             no_results_dialog.ShowDialog();
         }
     }
 }