Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2020
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. private void Szukaj_Click(object sender, RoutedEventArgs e)
  2. {
  3. DbClass.openConnection();
  4. DbClass.sql = "SELECT * FROM ksiazki WHERE tytul LIKE '%"+nazwa.Text+"%';";
  5. DbClass.cmd.CommandType = CommandType.Text;
  6. DbClass.cmd.CommandText = DbClass.sql;
  7.  
  8. DbClass.da = new SqlDataAdapter(DbClass.cmd);
  9. DbClass.dt = new DataTable();
  10. DbClass.da.Fill(DbClass.dt);
  11.  
  12. myDataGrid.ItemsSource = DbClass.dt.DefaultView;
  13. DbClass.closeConnection();
  14. }
  15.  
  16. private void Nazwa_DragEnter(object sender, DragEventArgs e)
  17. {
  18.  
  19. }
  20.  
  21. private void Dodaj_Click(object sender, RoutedEventArgs e)
  22. {
  23. Dodawanie Dod = new Dodawanie();
  24. Dod.Show();
  25. }
  26.  
  27. private void Refresh_Click(object sender, RoutedEventArgs e)
  28. {
  29. DbClass.openConnection();
  30.  
  31. DbClass.sql = "SELECT * FROM ksiazki;";
  32. DbClass.cmd.CommandType = CommandType.Text;
  33. DbClass.cmd.CommandText = DbClass.sql;
  34.  
  35. DbClass.da = new SqlDataAdapter(DbClass.cmd);
  36. DbClass.dt = new DataTable();
  37. DbClass.da.Fill(DbClass.dt);
  38.  
  39. myDataGrid.ItemsSource = DbClass.dt.DefaultView;
  40.  
  41. DbClass.closeConnection();
  42. }
  43.  
  44. private void Usun_Click(object sender, RoutedEventArgs e)
  45. {
  46. Usuwanie Us = new Usuwanie();
  47. Us.Show();
  48. }
  49.  
  50. private void Edit_Click(object sender, RoutedEventArgs e)
  51. {
  52. Edytowanie Ed = new Edytowanie();
  53. Ed.Show();
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement