Esempio 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));
            }
        }
Esempio 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());
            }
        }
Esempio 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());
            }
        }
Esempio 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));
            }
        }
Esempio 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());
            }
        }
Esempio 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));
            }
        }
Esempio 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());
            }
        }
        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());
            }
        }
Esempio 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"));
            }
        }
Esempio 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"));
            }
        }
Esempio 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());
            }
        }
Esempio 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"));
            }
        }
Esempio 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"));
            }
        }
Esempio 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));
            }
        }
Esempio 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());
            }
        }
Esempio 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"));
            }
        }
Esempio 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));
        }
Esempio 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));
        }
Esempio 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));
            }
        }
Esempio 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));
        }
Esempio 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));
        }
Esempio 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));
        }
Esempio 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());
            }
        }
Esempio 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));
            }
        }
Esempio 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"));
            }
        }
Esempio 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());
            }
        }
        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());
            }
        }
Esempio 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());
            }
        }
Esempio 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));
            }
        }
Esempio 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());
            }
        }