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)); } }
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)); }
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()); } }
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()); } }
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)); } }
//------------------------------------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()); } }
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)); } }
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)); } }
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()); } }
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")); } }
public ActionResult Voltooid(int oid) { 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); Email email = new Email(); email.berichtVan = mvvm.gebruiker.Email; email.Bericht = "Beste klant,<br><br>Bedankt voor je bestelling! We zullen deze zo snel mogelijk naar je opsturen. Mocht je je bedenken, dan heb je 7 dagen de tijd om je bestelling te annuleren.<br><br><br>Met vriendelijke groet, <br>Het Intosport team"; email.Onderwerp = "Orderbevestiging IntoSport"; email.SendEmail(); ViewBag.OrderID = oid; return(View(mvvm)); } catch (Exception e) { return(RedirectToAction("Index", "Winkelmand")); } }