Ejemplo n.º 1
0
        public void Update()
        {
            RecensieSQLContext rcs = new RecensieSQLContext();
            RecensieRepository rr  = new RecensieRepository(rcs);
            Recensie           r   = rr.Retrieve("2");

            r.Opmerking = r.Opmerking + " aangepast";
            //  rr.Update(r);
        }
Ejemplo n.º 2
0
        public void Retrieve()
        {
            RecensieSQLContext rcs = new RecensieSQLContext();
            RecensieRepository rr  = new RecensieRepository(rcs);

            Recensie r = rr.Retrieve("1");

            Assert.IsTrue(r.Score == 7);
            Assert.IsTrue(r.ProductId == 1);
        }
Ejemplo n.º 3
0
        public void Create()
        {
            RecensieSQLContext rcs = new RecensieSQLContext();
            RecensieRepository rr  = new RecensieRepository(rcs);

            Recensie r = rr.Retrieve("1");

            r.GebruikerId = 2;

            //  rr.Create(r);
        }
Ejemplo n.º 4
0
        public void Add(FormCollection form)
        {
            int    score     = Convert.ToInt32(form["score"]);
            string opmerking = form["opmerking"];
            int    userId    = Convert.ToInt32(form["userId"]);
            int    productId = Convert.ToInt32(form["productId"]);
            bool   tevreden;

            if (form["tevreden"] == "on")
            {
                tevreden = true;
            }
            else
            {
                tevreden = false;
            }
            Recensie newRecensie = new Recensie(opmerking, tevreden, score, userId, productId);

            newRecensie.SaveOrUpdate();

            Response.Redirect(Request.UrlReferrer.ToString());
        }
Ejemplo n.º 5
0
        // GET: Product/{id}
        public ActionResult Product(string id)
        {
            if (id != null)
            {
                Product p = DalWebshop.Models.Product.Find(id);
                ViewBag.Product   = p;
                ViewBag.Kortingen = p.RetrieveKorting();
            }

            if (Session["AuthGebruiker"] != null)
            {
                Gebruiker g = (Gebruiker)Session["AuthGebruiker"];
                ViewBag.CanReview = Recensie.CanReview(Convert.ToInt32(id), g.Id);
            }
            else
            {
                ViewBag.CanReview = false;
            }

            ViewBag.Recensies = DalWebshop.Models.Recensie.FindByProductId(Convert.ToInt32(id));

            return(View("~/Views/Product/Product.cshtml"));
        }
Ejemplo n.º 6
0
        public void CanReveiw()
        {
            bool canReview = Recensie.CanReview(17, 1);

            Assert.IsTrue(canReview);
        }
Ejemplo n.º 7
0
 public void Update(Recensie obj)
 {
     _interface.Update(obj);
 }
Ejemplo n.º 8
0
 public string Create(Recensie obj)
 {
     return(_interface.Create(obj));
 }