1
0

FrmBigListViewer.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. namespace BooksManageSystem
  10. {
  11. public partial class FrmBigListViewer : Form
  12. {
  13. public FrmBigListViewer()
  14. {
  15. InitializeComponent();
  16. }
  17. DBcon con = new DBcon();
  18. private void FrmBigListViewer_Load(object sender, EventArgs e)
  19. {
  20. this.listBox1.Items.AddRange(con.GetAllBuyList().ToArray());
  21. }
  22. private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
  23. {
  24. }
  25. private void button1_Click(object sender, EventArgs e)
  26. {
  27. if (listBox1.SelectedItems.Count == 1)
  28. {
  29. int bid = (listBox1.SelectedItem as BuyList).BID;
  30. var l = con.GetOPLogByBID(bid);
  31. new FrmLOGViewer(l).ShowDialog();
  32. }
  33. }
  34. private void FrmBigListViewer_FormClosing(object sender, FormClosingEventArgs e)
  35. {
  36. }
  37. private void listBox1_DoubleClick(object sender, EventArgs e)
  38. {
  39. if (listBox1.SelectedItems.Count == 1)
  40. {
  41. int bid = (listBox1.SelectedItem as BuyList).BID;
  42. var l = con.GetOPLogByBID(bid);
  43. new FrmLOGViewer(l).ShowDialog();
  44. }
  45. }
  46. }
  47. }