Example #1
0
        internal void ThemSPKhuyenMai(SanPhamKhuyenMai item)
        {
            db.SanPhamKhuyenMais.Add(item);
            db.SaveChanges();
            SanPhamModel s = new SanPhamModel();

            s.UpdateGiaBan(item.MaSP);
        }
Example #2
0
        internal void DeleteSPKhuyenMai(string makm, string masp)
        {
            SanPhamKhuyenMai sp = db.SanPhamKhuyenMais.Where(m => m.MaSP == masp && m.MaKM == makm).FirstOrDefault();

            db.SanPhamKhuyenMais.Remove(sp);
            db.SaveChanges();
            SanPhamModel s = new SanPhamModel();

            s.UpdateGiaBan(masp);
        }