public void AddNewProductTest() { ProductSQLContext context = new ProductSQLContext(); bool succesful = context.AddNewProduct("Hoi", "Hoi", 2, "Hoi", "Hoi", "Hoi"); Assert.IsTrue(succesful); }
public static List <ProductVerkoop> GetSales() { ProductSQLContext psc = new ProductSQLContext(); ProductRepository pr = new ProductRepository(psc); return(pr.RetrieveVerkoop()); }
public static List <Product> GetNewestProducts(int aantal) { ProductSQLContext psc = new ProductSQLContext(); ProductRepository pr = new ProductRepository(psc); return(pr.RetrieveNewestProducts(aantal)); }
public static Product Find(string key) { ProductSQLContext psc = new ProductSQLContext(); ProductRepository pr = new ProductRepository(psc); return(pr.Retrieve(key)); }
public static List <Product> All() { ProductSQLContext psc = new ProductSQLContext(); ProductRepository pr = new ProductRepository(psc); return(pr.RetrieveAll()); }
public void DatabaseViewTest() { ProductSQLContext psc = new ProductSQLContext(); ProductRepository pr = new ProductRepository(psc); List <ProductVerkoop> test = pr.RetrieveVerkoop(); string title = test[0].Product.Titel; }
public void Retrieve() { ProductSQLContext psc = new ProductSQLContext(); ProductRepository pr = new ProductRepository(psc); Product p = pr.Retrieve("1"); Assert.IsTrue(p.Id == 1); Assert.IsTrue(p.Titel == "Test"); }
public void Create() { ProductSQLContext psc = new ProductSQLContext(); ProductRepository pr = new ProductRepository(psc); Product p = pr.Retrieve("1"); p.Prijs = p.Prijs + 4; pr.Create(p); }
public void Update() { ProductSQLContext psc = new ProductSQLContext(); ProductRepository pr = new ProductRepository(psc); Product p = pr.Retrieve("1"); p.Prijs = p.Prijs + 4; // p.KortingId = 5; pr.Update(p); }
//-----------------------------------------------------------Fat Model---------------------------------------------------- public string SaveOrUpdate() { ProductSQLContext psc = new ProductSQLContext(); ProductRepository pr = new ProductRepository(psc); if (Id != 0) { pr.Update(this); return(this.Id.ToString()); } else { return(pr.Create(this)); } }
public void Delete() { ProductSQLContext psc = new ProductSQLContext(); ProductRepository pr = new ProductRepository(psc); }