public bool Update(SANPHAM sp) { var product = db.SANPHAMs.Find(sp.Id); int categoryID = new DANHMUCBLL().GetIDByName(sp.CategoryName); product.Name = sp.Name; product.Description = sp.Description; product.Price = sp.Price; product.CategoryName = sp.CategoryName; product.ImageName = sp.ImageName; product.MetaTitle = sp.MetaTitle; product.CreateDays = DateTime.Now; product.CategoryID = categoryID; db.SaveChanges(); return(true); }
public bool xoasp(SANPHAM n) { return(sp.xoa(n)); }
public bool suasp(SANPHAM n) { return(sp.sua(n)); }
public bool themsp(SANPHAM n) { return(sp.them(n)); }
public bool ktkc_sp(SANPHAM n) { return(sp.ktkc(n)); }
public int Insert(SANPHAM sp) { db.SANPHAMs.Add(sp); db.SaveChanges(); return(sp.Id); }