public void LoadProduct()
 {
     lstSanpham = new SanPhamCollection();
     lstLoaisanpham = new LoaiSanPhamCollection();
     lstNhacungcap = new NhacungcapCollection();
     GridView_Sanpham.Refresh();
     GridView_Sanpham.AutoGenerateColumns = false;
     GridView_Sanpham.DataSource = lstSanpham.Items;
 }
 public void LoadSanpham()
 {
     lstSanpham = new SanPhamCollection(1);
     listView1.Items.Clear();
     foreach (Models.SanPham x in lstSanpham.Items)
     {
         ListViewItem item = new ListViewItem();
         item.Text = x.SanphamID.ToString();
         item.SubItems.Add(x.Tensanpham);
         item.SubItems.Add(x.Soluong.ToString());
         listView1.Items.Add(item);
     }
 }
 public void ViewDataKho()
 {
     if (dataGridView1.CurrentRow != null)
     {
         int KhoID;
         int.TryParse(dataGridView1.CurrentRow.Cells[0].Value.ToString(), out KhoID);
         Models.Kho k = lstKho.Find(x => x.KhoID == KhoID);
         if (KhoID > 0)
         {
             textBox1.Text = k.KhoID.ToString();
             textBox2.Text = k.Tenkho;
             lstSanpham=new SanPhamCollection(KhoID);
             GridView_SanPham.DataSource = lstSanpham.Items;
         }
     }
 }