예제 #1
0
        public ActionResult Login(User user)
        {
            var res = FormsAuthentication.Authenticate(user.Name, user.Password);

            if (res)
            {
                FormsAuthentication.SetAuthCookie(user.Name, false);
                return(View("Index", RepositoryRoom.GetRooms()));
            }
            else
            {
                ModelState.AddModelError("", "Не коррекный логин или пароль");
                return(View());
            }

            return(View());
        }
예제 #2
0
 public ActionResult Del(int Id)
 {
     RepositoryRoom.Del(Id);
     return(View("Index", RepositoryRoom.GetRooms()));
 }
예제 #3
0
 public ActionResult Index()
 {
     return(View(RepositoryRoom.GetRooms()));
 }