Esempio n. 1
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. 2
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. 3
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. 4
0
        public ViewResult LogOn()
        {
            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. 5
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();
            }
        }
Esempio n. 6
0
        public ActionResult Categorieen()
        {
            if (Session["SESwkm"] == null)
            {
                Session["SESwkm"] = new Winkelmand();
            }
            Winkelmand qwkm = (Winkelmand)Session["SESwkm"];

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

            return View(mvvm);
        }
Esempio n. 7
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. 8
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();
            }
        }
Esempio n. 9
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();
            }
        }
Esempio n. 10
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();
                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 MijnOrders()
        {
            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, -1, true);

                return View(mvvm);
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine("Exception @Home/Index" + e);
                return View();
            }
        }
Esempio n. 12
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();
            }
        }
Esempio n. 13
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. 14
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. 15
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. 16
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. 17
0
        public ActionResult WijzigAccount()
        {
            if (Session["SESwkm"] == null)
            {
                Session["SESwkm"] = new Winkelmand();
            }
            Winkelmand qwkm = (Winkelmand)Session["SESwkm"];

            if (Session["userID"] == null)
            {
                Session["userID"] = gebruikerdbcontroller.GetGebruiker(User.Identity.Name).ID;
            }

            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. 18
0
        public ActionResult WijzigProduct(int pid)
        {
            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.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. 19
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. 20
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. 21
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. 22
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. 23
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();
            }
        }
Esempio n. 24
0
        public ActionResult ZetProductActief(int pid)
        {
            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();

            try
            {
                productdbcontroller.ActiefProduct(pid);
                return RedirectToAction("Producten", "beheer");
            }
            catch (Exception e)
            {
                return View(e);
            }
        }
Esempio n. 25
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. 26
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. 27
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. 28
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. 29
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. 30
0
        public ActionResult Add(int pid)
        {
            try
            {
                if (Session["SESwkm"] == null)
                {
                    Session["SESwkm"] = new Winkelmand();
                }

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

                return RedirectToAction("Index", "Winkelmand");
            }
            catch (Exception e)
            {
                return RedirectToAction("Index", "Winkelmand");
            }
        }