Advertisement
Guest User

Untitled

a guest
May 26th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. private void UsunProdukt(string nazwaL, string nazwaP)
  2. {
  3. foreach (string filepath in Directory.EnumerateFiles(Application.StartupPath + "/listy/" + nazwaL, nazwaP+".prod"))
  4. {
  5. File.Delete(filepath);
  6. MessageBox.Show("Usunięto produkt");
  7. foreach(Lista lista in zbiorlist)
  8. {
  9. if(lista.NazwaL==nazwaL)
  10. {
  11. foreach(Produkt prod in lista.Produkty)
  12. {
  13. if(prod.Nazwa==nazwaP)
  14. {
  15. lista.Produkty.Remove(prod);
  16. break;
  17. }
  18. }
  19. CzyscKontener(panelProdukty);
  20. CzyscKontener(panelOtworzListe);
  21. WyswietlProdukty(lista.NumerL);
  22. WyswietlListy();
  23. break;
  24. }
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement