Exemple #1
0
 public ActionResult Login(Customer acc)
 {
     if (query.TryLogin(acc.Email, acc.Password))
     {
         Customer a = query.getAccount(acc.Email);
         Session["user"]     = a;
         Session["name"]     = a.CustomerName;
         Session["username"] = a.CustomerName;
         Session["acc_id"]   = a.CustomerID;
         ViewBag.message     = "Login succesfully!";
         return(RedirectToAction("Index", "Watch"));
     }
     Session["message"] = "Login failed!";
     ViewBag.message    = "Login failed!";
     return(View());
 }