public ActionResult Create(CompteViewModel cvm) { try { // TODO: Add insert logic here CompteCourantService CS = new CompteCourantService(); CompteCourant account = new CompteCourant() { AgenceKey = 1, CIN = cvm.CIN, DateOuverture = cvm.DateOuverture, Solde = cvm.Solde, DecouvertMax = 240f }; CS.Add(account); CS.Commit(); Session["Cin"] = cvm.CIN; return(RedirectToAction("Index")); } catch { return(View()); } }