Exemplo n.º 1
0
        public void AddNewProductTest()
        {
            ProductSQLContext context = new ProductSQLContext();
            bool succesful            = context.AddNewProduct("Hoi", "Hoi", 2, "Hoi", "Hoi", "Hoi");

            Assert.IsTrue(succesful);
        }
Exemplo n.º 2
0
        public static List <ProductVerkoop> GetSales()
        {
            ProductSQLContext psc = new ProductSQLContext();
            ProductRepository pr  = new ProductRepository(psc);

            return(pr.RetrieveVerkoop());
        }
Exemplo n.º 3
0
        public static List <Product> GetNewestProducts(int aantal)
        {
            ProductSQLContext psc = new ProductSQLContext();
            ProductRepository pr  = new ProductRepository(psc);

            return(pr.RetrieveNewestProducts(aantal));
        }
Exemplo n.º 4
0
        public static Product Find(string key)
        {
            ProductSQLContext psc = new ProductSQLContext();
            ProductRepository pr  = new ProductRepository(psc);

            return(pr.Retrieve(key));
        }
Exemplo n.º 5
0
        public static List <Product> All()
        {
            ProductSQLContext psc = new ProductSQLContext();
            ProductRepository pr  = new ProductRepository(psc);

            return(pr.RetrieveAll());
        }
Exemplo n.º 6
0
        public void DatabaseViewTest()
        {
            ProductSQLContext psc = new ProductSQLContext();
            ProductRepository pr  = new ProductRepository(psc);

            List <ProductVerkoop> test = pr.RetrieveVerkoop();

            string title = test[0].Product.Titel;
        }
Exemplo n.º 7
0
        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");
        }
Exemplo n.º 8
0
        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);
        }
Exemplo n.º 9
0
        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);
        }
Exemplo n.º 10
0
        //-----------------------------------------------------------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));
            }
        }
Exemplo n.º 11
0
 public void Delete()
 {
     ProductSQLContext psc = new ProductSQLContext();
     ProductRepository pr  = new ProductRepository(psc);
 }