Esempio n. 1
0
 public ActionResult Login(LoginViewModel login)
 {
     if (ModelState.IsValid)
     {
         account = new AccountSetUp();
         if (account.LoginUser(login))
         {
             Session["username"] = login.Username;
             return(RedirectToAction("Main", "Dashboard"));
         }
         else
         {
             ModelState.Clear();
             ViewBag.error = "😮 Something is wrong Email or Password?";
         }
     }
     return(View());
 }
Esempio n. 2
0
        public ActionResult Signup(UserSignUpVM user)
        {
            if (ModelState.IsValid)
            {
                account = new AccountSetUp();
                if (account.RegisterUser(user))
                {
                    ModelState.Clear();
                    ViewBag.Msg = "🥳 Account created try logging in. Happy Transactions!!!";
                }
                else
                {
                    ModelState.Clear();
                    ViewBag.Msg = "😢 Sorry account unavailable";
                }
            }

            return(View());
        }