예제 #1
0
 public void LoadProduct()
 {
     lstSanpham     = new SanPhamCollection();
     lstLoaisanpham = new LoaiSanPhamCollection();
     lstNhacungcap  = new NhacungcapCollection();
     GridView_Sanpham.Refresh();
     GridView_Sanpham.AutoGenerateColumns = false;
     GridView_Sanpham.DataSource          = lstSanpham.Items;
 }
예제 #2
0
 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);
     }
 }
예제 #3
0
 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;
         }
     }
 }