Exemplo n.º 1
0
        public RedirectToRouteResult XoaMatHang(int iMaSP)
        {
            dbQLClothesDataContext db = new dbQLClothesDataContext();
            var products = from table in db.SanPhams
                           where table.MaSP == iMaSP
                           select table;

            foreach (var prd in products)
            {
                db.SanPhams.DeleteOnSubmit(prd);
            }
            db.SubmitChanges();
            return(RedirectToAction("Home", "ClothesStore", new { id = iMaSP }));
        }