예제 #1
0
        public ActionResult signin(string y)
        {
            string nom      = Request["nom"];
            string prenom   = Request["Prenom"];
            string email    = Request["Email"];
            string addresse = Request["Adresse"];
            string tele     = Request["Tele"];
            string pass     = Request["pass"];

            if (nom.Equals("") || prenom.Equals("") || email.Equals("") || addresse.Equals("") || tele.Equals("") || pass.Equals(""))
            {
                return(View());
            }
            else
            {
                Client client = new Client(nom, prenom, email, addresse, tele, pass);
                ConnexionBD.setClient(client);
                Client user = ConnexionBD.login(email, pass);

                Session["user"] = user;
                return(RedirectToAction("Accueil"));
            }
        }
예제 #2
0
        public ActionResult EstUser()
        {
            string email = Request["Email_l"];
            string pass  = Request["passl"];

            Client user = ConnexionBD.login(email, pass);

            if (user != null)
            {
                Session["user"] = user;
                if (ConnexionBD.estAdmin(user.Email, user.password))
                {
                    return(RedirectToAction("Index", "Admin/"));
                }

                else
                {
                    return(RedirectToAction("Accueil"));
                }
            }

            ViewBag.er = "Erreur ";
            return(RedirectToAction("login"));
        }