public ActionResult ValidatieKlant() { var naam = Request["naam"]; var postcode = int.Parse(Request["postcode"]); var klant = db.GetKlant(naam, postcode); if (klant != null) { Session["klant"] = klant.Voornaam + " " + klant.Naam + " " + klant.KlantNr; return(RedirectToAction("ValidatieKlantJuist")); } return(RedirectToAction("ValidatieKlantFout")); }
public ActionResult BestaandeKlant() { try { if (Request["aanmelden"] != null) { var naam = Request["naam"]; var postcode = Request["postcode"]; var klant = db.GetKlant(naam, postcode); if (klant != null) { Session["klant"] = klant; } else { ViewBag.errorMessage = "Verkeerde naam of postcode"; } } return(View()); } catch (Exception ex) { return(View(ex.Message)); } }