예제 #1
0
 public ActionResult Login()
 {
     if (Session["UserData"] == null)
     {
         Session["UserData"] = new UserData();
     }
     UserData ud = new UserData();
     return View(ud);
 }
예제 #2
0
 public ActionResult Login(UserData input)
 {
     Models.MoveToLondon mtl = new Models.MoveToLondon();
     UserProfile uf = mtl.UserProfiles.FirstOrDefault();
     UserData ud = Session["UserData"] as UserData;
     string pass = uf.Password;
     if (input.UserName == uf.UserName && input.Password == pass)
     {
         ud.IsLoggedIn = true;
         return RedirectToAction("Index");
     }
     else
     {
         return RedirectToAction("Login");
     }
 }
예제 #3
0
 public ActionResult Index()
 {
     Session["IsEnglishVersion"] = true;
     if (Session["UserData"] == null)
     {
         Session["UserData"] = new UserData();
         return RedirectToAction("Login");
     }
     else
     {
         UserData ud = Session["UserData"] as UserData;
         if (ud.IsLoggedIn)
         {
             RoomData rd = new RoomData();
             rd.Rooms.Add(new Room());
             rd.Rooms.Add(new Room());
             return View("Index", rd);
         }
         else
         {
             return RedirectToAction("Login");
         }
     }
 }