public ActionResult Create([Bind(Include = "NumeroDRE,NomDRE,Wilaya,AdresseDRE")] DRE dre1) { if (Session["user"] == null) { return(RedirectToAction("Index", "Home")); } if ((Session["user"] as Utilisateur).EtatUser != "Superviseur") { return(RedirectToAction("InvalidAccess", "Home")); } try { dre1.save(); } catch { } if (ModelState.IsValid) { return(RedirectToAction("index")); } return(View()); }