Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. private void button26_Click(object sender, EventArgs e)
  2. {
  3. numericUpDown2.Minimum = 0;
  4. int x = Convert.ToInt32(numericUpDown2.Value);
  5. Mesos_patiekalai kotletas = new Mesos_patiekalai();
  6. sqlCommand = sqlConnection.CreateCommand();
  7. sqlCommand.CommandText = "SELECT * FROM maistas LIMIT 1, 1";
  8. dataReader = sqlCommand.ExecuteReader();
  9. while (dataReader.Read())
  10. {
  11. kotletas.pavadinimas = dataReader.GetString(0);
  12. kotletas.kaina = dataReader.GetFloat(1);
  13. }
  14. pirkiniuKrepselis.Add(new Krepselis { pavadinimas = kotletas.pavadinimas, kaina = kotletas.kaina, kiekis = x });
  15. foreach (Krepselis k in pirkiniuKrepselis)
  16. listBox1.Items.Add(k.pavadinimas + " " + k.kaina + " " + k.kiekis);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement