Пример #1
0
        public void SuaSanPham(SANPHAM sp)
        {
            var lt        = new LT_SANPHAM();
            var dsSanPham = lt.DocDanhSachSanPham();

            for (int i = 0; i < dsSanPham.Count; i++)
            {
                if (dsSanPham[i].maSp == sp.maSp)
                {
                    dsSanPham[i] = sp;
                }
            }
            lt.LuuDanhSachSanPham(dsSanPham);
        }
Пример #2
0
        public List <SANPHAM> XoaSanPham(string keyword)
        {
            var            luutru    = new LT_SANPHAM();
            var            dsSanPham = luutru.DocDanhSachSanPham();
            List <SANPHAM> ketqua    = new List <SANPHAM>();

            foreach (var sp in dsSanPham)
            {
                if (sp.tenSp.Contains(keyword))
                {
                    ketqua.Remove(sp);
                }
            }
            luutru.LuuDanhSachSanPham(dsSanPham);
            return(ketqua);
        }