private void Add_new_category(object sender, RoutedEventArgs e) { string category_name = AddCategoryDialogCategoryName.Text; if (DatabaseHandler.Sanitize_string(category_name)) { if (category_name == "Category") { InvalidInputDialog invalid_input_dialog = new InvalidInputDialog(); invalid_input_dialog.Set_msg("Invalid category name"); invalid_input_dialog.ShowDialog(); return; } if (DatabaseHandler.Category_exists(GlobalVariables.temporary_file_path, category_name) != true) { this.category_name = category_name; this.success = true; this.Close(); } } else { InvalidInputDialog invalid_input_dialog = new InvalidInputDialog(); invalid_input_dialog.Set_msg("Are you using any ilegal chars ('!@#$%^&*()_+=,./\";:[]{}\\|)?"); invalid_input_dialog.ShowDialog(); } }
private bool Verify_description() { if (DatabaseHandler.Sanitize_string(EditRegistryDialogDescriptionBox.Text)) { this.Description = EditRegistryDialogDescriptionBox.Text; return true; } return false; }
private bool Verify_description() { if (DatabaseHandler.Sanitize_string(InsertRegistryDialogDescriptionBox.Text)) { this.Description = InsertRegistryDialogDescriptionBox.Text; return(true); } return(false); }
private bool Verify_description() { if (AdvanceSearchDialogDescriptionBox.Text == "") { this.Description = ""; return(true); } if (DatabaseHandler.Sanitize_string(AdvanceSearchDialogDescriptionBox.Text)) { this.Description = AdvanceSearchDialogDescriptionBox.Text; return(true); } return(false); }
private bool Verify_category() { string category = SearchCategoryButton.Content.ToString(); if (DatabaseHandler.Sanitize_string(category)) { if (DatabaseHandler.Category_exists(GlobalVariables.temporary_file_path, category)) { return(true); } } else { // put here SQL injection detected dialog } return(false); }
private bool Verify_category() { string category = EditRegistryDialogCategoryButton.Content.ToString(); if (DatabaseHandler.Sanitize_string(category)) { if (DatabaseHandler.Category_exists(GlobalVariables.temporary_file_path, category)) { this.Category = category; return true; } } else { // put here SQL injection detected dialog } return false; }
private bool Verify_currency() { string currency = InsertRegistryDialogCurrencyButton.Content.ToString(); if (DatabaseHandler.Sanitize_string(currency)) { if (DatabaseHandler.Currency_exists(GlobalVariables.temporary_file_path, currency)) { this.Currency = currency; return(true); } } else { // put here SQL injection detected dialog } return(false); }
private void Add_new_currency(object sender, RoutedEventArgs e) { string currency_name = AddCurrencyDialogCurrencyNameBox.Text; if (DatabaseHandler.Sanitize_string(currency_name)) { if (DatabaseHandler.Currency_exists(GlobalVariables.temporary_file_path, currency_name) != true) { double vs_usd_rate; try { vs_usd_rate = Convert.ToDouble(AddCurrencyDialogCurrencyRateBox.Text); } catch { return; } if (vs_usd_rate > 0) { DatabaseHandler.Add_currency(GlobalVariables.temporary_file_path, currency_name, vs_usd_rate); this.correcly_created = true; this.Close(); } else { InvalidInputDialog invalid_input_dialog = new InvalidInputDialog(); invalid_input_dialog.Set_msg("The Currency rate can't be negative"); invalid_input_dialog.ShowDialog(); } } } else { InvalidInputDialog invalid_input_dialog = new InvalidInputDialog(); invalid_input_dialog.Set_msg("Are you using any ilegal chars ('!@#$%^&*()_+=,./\";:[]{}\\|)?"); invalid_input_dialog.ShowDialog(); } }