Ejemplo n.º 1
0
        //------------------------------------Product

        public ActionResult WijzigThumb(int pid)
        {
            try
            {
                if (Session["SESwkm"] == null)
                {
                    Session["SESwkm"] = new Winkelmand();
                }
                Winkelmand qwkm = (Winkelmand)Session["SESwkm"];

                mvvm.ListCategorie = categoriedbcontroller.GetAllCategories();
                mvvm.ListMerk      = merkdbcontroler.GetAllMerken();
                mvvm.DetailProduct = productdbcontroller.GetProduct(pid);
                mvvm.ListMand      = qwkm.GetAllwinkelmand();

                List <Merk> merken = merkdbcontroler.GetAllMerken();

                mvvm.SelectedMerkID = mvvm.DetailProduct.merk.ID;

                mvvm.Merken = new SelectList(merken, "ID", "Naam");

                List <Categorie> categorieen = categoriedbcontroller.GetAllCategories();

                mvvm.SelectedCategorieID = mvvm.DetailProduct.cat.ID;

                mvvm.Categorieen = new SelectList(categorieen, "ID", "Naam");

                return(View(mvvm));
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine("Product Wijzigproduct()");
                return(View(e));
            }
        }
Ejemplo n.º 2
0
        public ActionResult ToevoegenMerk(MainView main)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    merkdbcontroler.InsertMerk(main.Merk);
                    return(RedirectToAction("Merken", "Beheer"));
                }
                else
                {
                    if (Session["SESwkm"] == null)
                    {
                        Session["SESwkm"] = new Winkelmand();
                    }
                    Winkelmand qwkm = (Winkelmand)Session["SESwkm"];

                    main.ListCategorie = categoriedbcontroller.GetAllCategories();
                    main.ListProduct   = productdbcontroller.GetAllProducten();
                    main.ListMerk      = merkdbcontroler.GetAllMerken();
                    main.ListMand      = qwkm.GetAllwinkelmand();

                    return(View(main));
                }
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine(e);
                return(View());
            }
        }
Ejemplo n.º 3
0
        public ActionResult WijzigGebruiker(MainView main)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    gebruikerdbcontroller.UpdateGebruiker(main.gebruiker);
                    Session["userID"] = null; //sessie weer null maken, voor evt volgende wijziging
                    return(RedirectToAction("GebruikerBeheer", "Beheer"));
                }
                else
                {
                    if (Session["SESwkm"] == null)
                    {
                        Session["SESwkm"] = new Winkelmand();
                    }
                    Winkelmand qwkm = (Winkelmand)Session["SESwkm"];

                    main.ListCategorie = categoriedbcontroller.GetAllCategories();
                    main.ListProduct   = productdbcontroller.GetAllProducten();
                    main.ListMerk      = merkdbcontroler.GetAllMerken();
                    main.ListMand      = qwkm.GetAllwinkelmand();

                    return(View(main));
                }
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine(e);
                return(View());
            }
        }
Ejemplo n.º 4
0
        public ActionResult WijzigAccount(MainView main)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    gebruikerdbcontroller.UpdateGebruiker(main.gebruiker);
                    return(LogOut());
                }
                else
                {
                    if (Session["SESwkm"] == null)
                    {
                        Session["SESwkm"] = new Winkelmand();
                    }
                    Winkelmand qwkm = (Winkelmand)Session["SESwkm"];

                    mvvm.ListCategorie = categoriedbcontroller.GetAllCategories();
                    mvvm.ListProduct   = productdbcontroller.GetAllProducten();
                    mvvm.ListMerk      = merkdbcontroler.GetAllMerken();
                    mvvm.ListMand      = qwkm.GetAllwinkelmand();
                    mvvm.gebruiker     = gebruikerdbcontroller.GetGebruiker(User.Identity.Name);

                    return(View(mvvm));
                }
            }
            catch (Exception e)
            {
                return(View(main));
            }
        }
Ejemplo n.º 5
0
        //------------------------------------Klant

        public ActionResult WijzigGebruiker(int kid)
        {
            try
            {
                if (Session["SESwkm"] == null)
                {
                    Session["SESwkm"] = new Winkelmand();
                }
                Winkelmand qwkm = (Winkelmand)Session["SESwkm"];

                if (Session["userID"] == null)
                {
                    Session["userID"] = kid;
                }

                mvvm.ListCategorie = categoriedbcontroller.GetAllCategories();
                mvvm.ListProduct   = productdbcontroller.GetAllProducten();
                mvvm.ListMerk      = merkdbcontroler.GetAllMerken();
                mvvm.gebruiker     = gebruikerdbcontroller.GetGebruiker(kid);
                mvvm.ListMand      = qwkm.GetAllwinkelmand();

                return(View(mvvm));
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine(e);
                return(View());
            }
        }
Ejemplo n.º 6
0
        public ActionResult ToevoegenProduct()
        {
            try
            {
                if (Session["SESwkm"] == null)
                {
                    Session["SESwkm"] = new Winkelmand();
                }
                Winkelmand qwkm = (Winkelmand)Session["SESwkm"];

                mvvm.ListCategorie = categoriedbcontroller.GetAllCategories();
                mvvm.ListProduct   = productdbcontroller.GetAllProducten();
                mvvm.ListMerk      = merkdbcontroler.GetAllMerken();
                mvvm.ListMand      = qwkm.GetAllwinkelmand();

                List <Merk> merken = merkdbcontroler.GetAllMerken();


                mvvm.Merken = new SelectList(merken, "ID", "Naam");

                List <Categorie> categorieen = categoriedbcontroller.GetAllCategories();


                mvvm.Categorieen = new SelectList(categorieen, "ID", "Naam");
                return(View(mvvm));
            }
            catch (Exception e)
            {
                return(View(e));
            }
        }
Ejemplo n.º 7
0
        public ActionResult WijzigStatus(int oid)
        {
            try
            {
                if (Session["SESwkm"] == null)
                {
                    Session["SESwkm"] = new Winkelmand();
                }
                Winkelmand qwkm = (Winkelmand)Session["SESwkm"];

                mvvm.ListCategorie = categoriedbcontroller.GetAllCategories();
                mvvm.ListProduct   = productdbcontroller.GetAllProducten();
                mvvm.ListMerk      = merkdbcontroler.GetAllMerken();
                mvvm.ListMand      = qwkm.GetAllwinkelmand();
                mvvm.status        = orderdbcontroller.GetStatus(oid);
                mvvm.order         = orderdbcontroller.GetOrder(oid);

                List <Status> statussen = orderdbcontroller.GetAllStatussen();

                mvvm.SelectedStatusID = mvvm.status.ID;

                mvvm.Statussen = new SelectList(statussen, "ID", "Naam");

                return(View(mvvm));
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine(e);
                return(View());
            }
        }
Ejemplo n.º 8
0
        public ActionResult Zoeken(MainView viewmodel, string returnURL)
        {
            try
            {
                if (Session["SESwkm"] == null)
                {
                    Session["SESwkm"] = new Winkelmand();
                }
                Winkelmand qwkm = (Winkelmand)Session["SESwkm"];

                mvvm.ListCategorie = categoriedbcontroller.GetAllCategories();
                mvvm.ListProduct   = productdbcontroller.ZoekAllProducten(viewmodel.SearchViewModel.Query, -1, -1, 100);
                mvvm.ListMerk      = merkdbcontroler.GetAllMerken();
                mvvm.ListMand      = qwkm.GetAllwinkelmand();

                //ViewBag.Zoek = viewmodel.SearchViewModel.Query;

                return(View(mvvm));
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine("Exception @Home/Index" + e);
                return(View());
            }
        }
Ejemplo n.º 9
0
        public ActionResult Cancel(int oid)
        {
            try
            {
                if (Session["SESwkm"] == null)
                {
                    Session["SESwkm"] = new Winkelmand();
                }
                Winkelmand qwkm = (Winkelmand)Session["SESwkm"];

                mvvm.ListCategorie = categoriedbcontroller.GetAllCategories();
                mvvm.ListMerk      = merkdbcontroler.GetAllMerken();
                mvvm.ListMand      = qwkm.GetAllwinkelmand();
                mvvm.gebruiker     = gebruikerdbcontroller.GetGebruiker(User.Identity.Name);

                if (!orderdbcontroler.CheckOrderRegelID(oid, mvvm.gebruiker.ID))
                {
                    return(RedirectToAction("MijnOrders", "Order"));
                }

                orderdbcontroler.CancelOrder(oid);

                return(RedirectToAction("MijnOrders", "Order"));
            }
            catch (Exception e)
            {
                return(RedirectToAction("MijnOrders", "Order"));
            }
        }
Ejemplo n.º 10
0
        public ActionResult Betaling()
        {
            try
            {
                if (!User.Identity.IsAuthenticated)
                {
                    return(RedirectToAction("Index", "Account"));
                }
                if (Session["SESwkm"] == null)
                {
                    return(RedirectToAction("Index", "Home"));
                }

                Winkelmand qwkm = (Winkelmand)Session["SESwkm"];

                mvvm.ListCategorie = categoriedbcontroller.GetAllCategories();
                mvvm.ListProduct   = productdbcontroller.GetAllProducten();
                mvvm.ListMerk      = merkdbcontroler.GetAllMerken();
                mvvm.ListMand      = qwkm.GetAllwinkelmand();
                mvvm.gebruiker     = gebruikerdbcontroller.GetGebruiker(User.Identity.Name);

                return(View(mvvm));
            }
            catch (Exception e)
            {
                return(RedirectToAction("Index", "Winkelmand"));
            }
        }
Ejemplo n.º 11
0
        public ActionResult Detail(int oid)
        {
            try
            {
                if (Session["SESwkm"] == null)
                {
                    Session["SESwkm"] = new Winkelmand();
                }
                Winkelmand qwkm = (Winkelmand)Session["SESwkm"];

                mvvm.ListCategorie  = categoriedbcontroller.GetAllCategories();
                mvvm.ListMerk       = merkdbcontroler.GetAllMerken();
                mvvm.ListMand       = qwkm.GetAllwinkelmand();
                mvvm.gebruiker      = gebruikerdbcontroller.GetGebruiker(User.Identity.Name);
                mvvm.ListOrder      = orderdbcontroler.GetAllOrders(mvvm.gebruiker.ID);
                mvvm.ListOrderRegel = orderdbcontroler.GetAllOrderRegels(oid);

                if (!orderdbcontroler.CheckOrderRegelID(oid, mvvm.gebruiker.ID))
                {
                    return(RedirectToAction("MijnOrders", "Order"));
                }

                return(View(mvvm));
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine("Exception @Home/Index" + e);
                return(View());
            }
        }
Ejemplo n.º 12
0
        public ActionResult Detail(int pid = -1)
        {
            try
            {
                //TODO: check if pid bestaat
                if (pid == -1)
                {
                    return(RedirectToAction("Index", "Producten"));
                }
                if (Session["SESwkm"] == null)
                {
                    Session["SESwkm"] = new Winkelmand();
                }
                Winkelmand qwkm = (Winkelmand)Session["SESwkm"];

                mvvm.ListCategorie = categoriedbcontroller.GetAllCategories();
                mvvm.ListProduct   = productdbcontroller.GetAllProducten();
                mvvm.ListMerk      = merkdbcontroler.GetAllMerken();
                mvvm.DetailProduct = productdbcontroller.GetProduct(pid);
                mvvm.ListMand      = qwkm.GetAllwinkelmand();

                return(View(mvvm));
            }
            catch (Exception e)
            {
                return(RedirectToAction("Index", "Producten"));
            }
        }
Ejemplo n.º 13
0
        public ActionResult Aantal(int pid, Operator opr)
        {
            try
            {
                if (Session["SESwkm"] == null)
                {
                    Session["SESwkm"] = new Winkelmand();
                }

                Winkelmand qwkm = (Winkelmand)Session["SESwkm"];

                if (opr == Operator.PLUS)
                {
                    qwkm.WinkelmandItemPlus(pid);
                }
                else if (opr == Operator.MIN)
                {
                    qwkm.WinkelmandItemMin(pid);
                }

                return(RedirectToAction("Index", "Winkelmand"));
            }
            catch (Exception e)
            {
                return(RedirectToAction("Index", "Winkelmand"));
            }
        }
Ejemplo n.º 14
0
        public ActionResult Registreren(MainView main)
        {
            if (Session["SESwkm"] == null)
            {
                Session["SESwkm"] = new Winkelmand();
            }
            Winkelmand qwkm = (Winkelmand)Session["SESwkm"];

            mvvm.ListCategorie = categoriedbcontroller.GetAllCategories();
            mvvm.ListProduct   = productdbcontroller.GetAllProducten();
            mvvm.ListMerk      = merkdbcontroler.GetAllMerken();
            mvvm.ListMand      = qwkm.GetAllwinkelmand();

            try
            {
                if (ModelState.IsValid)
                {
                    gebruikerdbcontroller.InsertBeheerder(main.gebruiker);
                    return(RedirectToAction("Beheerders", "Beheer"));
                }
                else
                {
                    return(View(mvvm));
                }
            }
            catch (Exception e)
            {
                return(View(mvvm));
            }
        }
Ejemplo n.º 15
0
        public ActionResult Contact()
        {
            try
            {
                if (Session["SESwkm"] == null)
                {
                    Session["SESwkm"] = new Winkelmand();
                }
                Winkelmand qwkm = (Winkelmand)Session["SESwkm"];

                mvvm.ListCategorie = categoriedbcontroller.GetAllCategories();
                mvvm.ListProduct   = productdbcontroller.GetAllProducten();
                mvvm.ListMerk      = merkdbcontroler.GetAllMerken();
                mvvm.ListMand      = qwkm.GetAllwinkelmand();
                mvvm.email         = new Email();

                if (contactSucces == true)
                {
                    ViewBag.ContactSucces = true;
                }

                return(View(mvvm));
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine("Exception @Home/Index " + e);
                return(View());
            }
        }
Ejemplo n.º 16
0
        public ActionResult Verwerken()
        {
            try
            {
                double totaalPrijs = 0;
                int    poid        = -1;

                if (!User.Identity.IsAuthenticated)
                {
                    return(RedirectToAction("Index", "Account"));
                }
                if (Session["SESwkm"] == null)
                {
                    return(RedirectToAction("Index", "Home"));
                }

                Winkelmand qwkm = (Winkelmand)Session["SESwkm"];

                mvvm.ListMand  = qwkm.GetAllwinkelmand();
                mvvm.gebruiker = gebruikerdbcontroller.GetGebruiker(User.Identity.Name);

                for (int q = 0; q < mvvm.ListMand.Count; q++)
                {
                    if (mvvm.gebruiker.Goldmembership == true)
                    {
                        totaalPrijs += ((mvvm.ListMand[q].Prijs * mvvm.ListMand[q].Aantal) * 0.96);
                    }
                    else
                    {
                        totaalPrijs += (mvvm.ListMand[q].Prijs * mvvm.ListMand[q].Aantal);
                    }
                }

                orderdbcontroller.InsertOrder(mvvm.gebruiker.ID, totaalPrijs);
                poid = orderdbcontroller.GetOrderID(mvvm.gebruiker.ID);

                for (int a = 0; a < mvvm.ListMand.Count; a++)
                {
                    if (mvvm.gebruiker.Goldmembership == true)
                    {
                        orderdbcontroller.InsertOrderRegel(mvvm.ListMand[a].ID, poid, mvvm.ListMand[a].Aantal, ((mvvm.ListMand[a].Prijs * mvvm.ListMand[a].Aantal) * 0.96));
                    }
                    else
                    {
                        orderdbcontroller.InsertOrderRegel(mvvm.ListMand[a].ID, poid, mvvm.ListMand[a].Aantal, (mvvm.ListMand[a].Prijs * mvvm.ListMand[a].Aantal));
                    }
                }

                qwkm.DeleteAllwinkelmand();

                return(RedirectToAction("Voltooid", "Winkelmand", new { oid = poid }));
            }
            catch (Exception e)
            {
                return(RedirectToAction("Index", "Winkelmand"));
            }
        }
Ejemplo n.º 17
0
        public ActionResult Producten()
        {
            if (Session["SESwkm"] == null)
            {
                Session["SESwkm"] = new Winkelmand();
            }
            Winkelmand qwkm = (Winkelmand)Session["SESwkm"];

            mvvm.ListCategorie = categoriedbcontroller.GetAllCategories();
            mvvm.ListProduct   = productdbcontroller.GetAllProducten(ProductDBController.OrderAllProducten.ALLES, -1, -1, 100, true);
            mvvm.ListMerk      = merkdbcontroler.GetAllMerken();
            mvvm.ListMand      = qwkm.GetAllwinkelmand();

            return(View(mvvm));
        }
Ejemplo n.º 18
0
        public ActionResult ToevoegenMerk()
        {
            if (Session["SESwkm"] == null)
            {
                Session["SESwkm"] = new Winkelmand();
            }
            Winkelmand qwkm = (Winkelmand)Session["SESwkm"];

            mvvm.ListCategorie = categoriedbcontroller.GetAllCategories();
            mvvm.ListProduct   = productdbcontroller.GetAllProducten();
            mvvm.ListMerk      = merkdbcontroler.GetAllMerken();
            mvvm.ListMand      = qwkm.GetAllwinkelmand();

            return(View(mvvm));
        }
Ejemplo n.º 19
0
        public ActionResult LogOn(MainView viewmodel, String returnURL)
        {
            if (ModelState.IsValid)
            {
                AccountDBController accountdbcontroller = new AccountDBController();
                bool geldig = accountdbcontroller.IsGeldig(viewmodel.LogOnViewModel.Email, viewmodel.LogOnViewModel.Wachtwoord);
                if (geldig)
                {
                    FormsAuthentication.SetAuthCookie(viewmodel.LogOnViewModel.Email, false);

                    Gebruiker gebruiker = gebruikerdbcontroller.GetGebruiker(viewmodel.LogOnViewModel.Email); //gebruiker ophalen
                    orderdbcontroller.Goldmembership(gebruiker);                                              //kijken of klant in aanmerking komt voor goldmembership

                    return(Redirect(returnURL ?? Url.Action("Index", "Account")));
                }
                else
                {
                    ModelState.AddModelError("", "Email en wachtwoord komen niet overeen.");
                    if (Session["SESwkm"] == null)
                    {
                        Session["SESwkm"] = new Winkelmand();
                    }
                    Winkelmand qwkm = (Winkelmand)Session["SESwkm"];

                    mvvm.ListCategorie = categoriedbcontroller.GetAllCategories();
                    mvvm.ListProduct   = productdbcontroller.GetAllProducten();
                    mvvm.ListMerk      = merkdbcontroler.GetAllMerken();
                    mvvm.ListMand      = qwkm.GetAllwinkelmand();

                    return(View(mvvm));
                }
            }
            else
            {
                if (Session["SESwkm"] == null)
                {
                    Session["SESwkm"] = new Winkelmand();
                }
                Winkelmand qwkm = (Winkelmand)Session["SESwkm"];

                mvvm.ListCategorie = categoriedbcontroller.GetAllCategories();
                mvvm.ListProduct   = productdbcontroller.GetAllProducten();
                mvvm.ListMerk      = merkdbcontroler.GetAllMerken();
                mvvm.ListMand      = qwkm.GetAllwinkelmand();

                return(View(mvvm));
            }
        }
Ejemplo n.º 20
0
        public ActionResult Bestellingen(int klantID)
        {
            if (Session["SESwkm"] == null)
            {
                Session["SESwkm"] = new Winkelmand();
            }
            Winkelmand qwkm = (Winkelmand)Session["SESwkm"];

            mvvm.ListCategorie = categoriedbcontroller.GetAllCategories();
            mvvm.ListProduct   = productdbcontroller.GetAllProducten();
            mvvm.ListMerk      = merkdbcontroler.GetAllMerken();
            mvvm.ListOrder     = orderdbcontroller.GetAllOrdersPerKlant(klantID);
            mvvm.ListMand      = qwkm.GetAllwinkelmand();

            return(View(mvvm));
        }
Ejemplo n.º 21
0
        public ActionResult MijnAccount(String email)
        {
            if (Session["SESwkm"] == null)
            {
                Session["SESwkm"] = new Winkelmand();
            }
            Winkelmand qwkm = (Winkelmand)Session["SESwkm"];

            mvvm.ListCategorie = categoriedbcontroller.GetAllCategories();
            mvvm.ListProduct   = productdbcontroller.GetAllProducten();
            mvvm.ListMerk      = merkdbcontroler.GetAllMerken();
            mvvm.ListMand      = qwkm.GetAllwinkelmand();
            mvvm.gebruiker     = gebruikerdbcontroller.GetGebruiker(User.Identity.Name);

            return(View(mvvm));
        }
Ejemplo n.º 22
0
        public ActionResult KlantenLijst()
        {
            if (Session["SESwkm"] == null)
            {
                Session["SESwkm"] = new Winkelmand();
            }
            Winkelmand qwkm = (Winkelmand)Session["SESwkm"];

            mvvm.ListCategorie = categoriedbcontroller.GetAllCategories();
            mvvm.ListProduct   = productdbcontroller.GetAllProducten();
            mvvm.ListMerk      = merkdbcontroler.GetAllMerken();
            mvvm.ListGebruiker = gebruikerdbcontroller.GetAllBestelGebruikers();
            mvvm.ListMand      = qwkm.GetAllwinkelmand();

            return(View(mvvm));
        }
Ejemplo n.º 23
0
        public ActionResult ToevoegenProduct(MainView main)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    main.DetailProduct.merk  = merkdbcontroler.GetMerk(main.SelectedMerkID);
                    main.DetailProduct.cat   = categoriedbcontroller.GetCategorie(main.SelectedCategorieID);
                    main.DetailProduct.Image = "geenfoto.png";
                    productdbcontroller.InsertProduct(main.DetailProduct);

                    return(RedirectToAction("Producten", "beheer"));
                }
                else
                {
                    if (Session["SESwkm"] == null)
                    {
                        Session["SESwkm"] = new Winkelmand();
                    }
                    Winkelmand qwkm = (Winkelmand)Session["SESwkm"];

                    main.ListCategorie = categoriedbcontroller.GetAllCategories();
                    main.ListProduct   = productdbcontroller.GetAllProducten();
                    main.ListMerk      = merkdbcontroler.GetAllMerken();
                    main.ListMand      = qwkm.GetAllwinkelmand();


                    List <Merk> merken = merkdbcontroler.GetAllMerken();


                    main.Merken = new SelectList(merken, "ID", "Naam");

                    List <Categorie> categorieen = categoriedbcontroller.GetAllCategories();


                    main.Categorieen = new SelectList(categorieen, "ID", "Naam");

                    return(View(main));
                }
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine(e);
                return(View());
            }
        }
Ejemplo n.º 24
0
        public ActionResult WijzigThumb(MainView main, HttpPostedFileBase imageName)
        {
            try
            {
                if (imageName != null && imageName.ContentLength > 0 && (imageName.ContentType.Equals("image/png") || imageName.ContentType.Equals("image/gif") || imageName.ContentType.Equals("image/jpeg")))
                {
                    var fileName = Path.GetFileName(imageName.FileName);
                    var path     = Path.Combine(Server.MapPath("~/Content/Upload"), fileName);
                    imageName.SaveAs(path);

                    productdbcontroller.UpdateProductAfbeelding(main.DetailProduct.ID, fileName);

                    return(RedirectToAction("Producten", "beheer"));
                }
                else
                {
                    if (Session["SESwkm"] == null)
                    {
                        Session["SESwkm"] = new Winkelmand();
                    }
                    Winkelmand qwkm = (Winkelmand)Session["SESwkm"];

                    mvvm.ListCategorie = categoriedbcontroller.GetAllCategories();
                    mvvm.ListProduct   = productdbcontroller.GetAllProducten();
                    mvvm.ListMerk      = merkdbcontroler.GetAllMerken();
                    mvvm.ListMand      = qwkm.GetAllwinkelmand();

                    List <Merk> merken = merkdbcontroler.GetAllMerken();

                    mvvm.Merken = new SelectList(merken, "ID", "Naam");

                    List <Categorie> categorieen = categoriedbcontroller.GetAllCategories();

                    mvvm.Categorieen = new SelectList(categorieen, "ID", "Naam");

                    return(View(mvvm));
                }
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine("Product Wijzigproduct(Product product)");
                return(View(e));
            }
        }
Ejemplo n.º 25
0
        public ActionResult Delete(int pid)
        {
            try
            {
                if (Session["SESwkm"] == null)
                {
                    RedirectToAction("Index", "Winkelmand");
                }

                Winkelmand qwkm = (Winkelmand)Session["SESwkm"];
                qwkm.Deletewinkelmand(pid);

                return(RedirectToAction("Index", "Winkelmand"));
            }
            catch (Exception e)
            {
                return(RedirectToAction("Index", "Winkelmand"));
            }
        }
Ejemplo n.º 26
0
        public ActionResult Index()
        {
            try
            {
                if (Session["SESwkm"] == null)
                {
                    Session["SESwkm"] = new Winkelmand();
                }
                Winkelmand qwkm = (Winkelmand)Session["SESwkm"];

                mvvm.ListCategorie = categoriedbcontroller.GetAllCategories();
                mvvm.ListProduct   = productdbcontroller.GetAllProducten(Project.DBControllers.ProductDBController.OrderAllProducten.RANDOM);
                mvvm.ListMerk      = merkdbcontroler.GetAllMerken();
                mvvm.ListMand      = qwkm.GetAllwinkelmand();

                return(View(mvvm));
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine("Exception @Home/Index" + e);
                return(View());
            }
        }
Ejemplo n.º 27
0
        public ActionResult Management()
        {
            try
            {
                if (Session["SESwkm"] == null)
                {
                    Session["SESwkm"] = new Winkelmand();
                }
                Winkelmand qwkm = (Winkelmand)Session["SESwkm"];

                mvvm.ListCategorie = categoriedbcontroller.GetAllCategories();
                mvvm.ListProduct   = productdbcontroller.GetAllProducten();
                mvvm.ListMerk      = merkdbcontroler.GetAllMerken();
                mvvm.ListMand      = qwkm.GetAllwinkelmand();

                return(View(mvvm));
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine("Exception @Management/Management" + e);
                return(View());
            }
        }
Ejemplo n.º 28
0
        public ActionResult Registreren()
        {
            try
            {
                if (Session["SESwkm"] == null)
                {
                    Session["SESwkm"] = new Winkelmand();
                }
                Winkelmand qwkm = (Winkelmand)Session["SESwkm"];

                mvvm.ListCategorie = categoriedbcontroller.GetAllCategories();
                mvvm.ListProduct   = productdbcontroller.GetAllProducten();
                mvvm.ListMerk      = merkdbcontroler.GetAllMerken();
                mvvm.ListMand      = qwkm.GetAllwinkelmand();

                return(View(mvvm));
            }
            catch (Exception e)
            {
                ViewBag.foutmelding = "er ging wat fout " + e;
                return(View());
            }
        }
Ejemplo n.º 29
0
        public ActionResult Contact(MainView viewModel)
        {
            if (ModelState.IsValid)
            {
                viewModel.email.SendEmailToWebshop();
                contactSucces = true;
                return(Contact());
            }
            else
            {
                if (Session["SESwkm"] == null)
                {
                    Session["SESwkm"] = new Winkelmand();
                }
                Winkelmand qwkm = (Winkelmand)Session["SESwkm"];

                mvvm.ListCategorie = categoriedbcontroller.GetAllCategories();
                mvvm.ListProduct   = productdbcontroller.GetAllProducten();
                mvvm.ListMerk      = merkdbcontroler.GetAllMerken();
                mvvm.ListMand      = qwkm.GetAllwinkelmand();

                return(View(mvvm));
            }
        }
Ejemplo n.º 30
0
        //------------------------------------Bestelling

        public ActionResult BekijkProducten(int oid)
        {
            try
            {
                if (Session["SESwkm"] == null)
                {
                    Session["SESwkm"] = new Winkelmand();
                }
                Winkelmand qwkm = (Winkelmand)Session["SESwkm"];

                mvvm.ListCategorie      = categoriedbcontroller.GetAllCategories();
                mvvm.ListProduct        = productdbcontroller.GetAllProducten();
                mvvm.ListMerk           = merkdbcontroler.GetAllMerken();
                mvvm.ListMand           = qwkm.GetAllwinkelmand();
                mvvm.ListOrderViewModel = orderdbcontroller.GetProductenPerOrder(oid);

                return(View(mvvm));
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine(e);
                return(View());
            }
        }