// Package public void createPackage(List<Product> list, string name, decimal price) { Package p = new Package(); p.name = name; p.price = price; foreach (Product pro in list) { pro.Package1 = p; } p.monthsale = false; db.Packages.Add(p); db.SaveChanges(); }
public void editpackage(List<Product> l,Package p, string name, decimal price) { p.name = name; p.price = price; foreach (Product pro in l) { pro.Package1 = p; } db.SaveChanges(); }
public void deletePackage(Package p) { db.Packages.Remove(p); db.SaveChanges(); }