Esempio n. 1
0
 public ActionResult Register(Customer inCustomer)
 {
     if (ModelState.IsValid)
     {
         using (var db = new DatabaseContext())
         {
             SecurityImplementation.RegisterImplementation(inCustomer);
         }
         return(RedirectToAction("Login", "Security"));
     }
     return(View());
 }
Esempio n. 2
0
 public ActionResult Login(LoginCustomer LoggedIn)
 {
     if (ModelState.IsValid)
     {
         if (SecurityImplementation.User_in_DB(LoggedIn))
         {
             // Username && Password correct
             Session["LoggedIn"] = "true";
             //Sesion to store username
             Session["Username"] = LoggedIn.Username;
             //  ViewBag.InLogged = true;
             return(RedirectToAction("Index", "Home"));
         }
         else
         {
             // Username && Password wrong
             Session["LoggedIn"] = "false";
             // ViewBag.InLogged = false;
             return(View("LoginFailed"));
         }
     }
     // Check to see if Login Credentials are OK
     return(View());
 }