public ActionResult Login(LoginModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            AppRepository repo   = new Repository.AppRepository();
            Person        person = repo.AuthenticateUser(model.UserName, model.Password);

            if (person != null)
            {
                FormsAuthentication.SetAuthCookie(model.UserName, true);
                Session["UserName"] = model.UserName;
                return(RedirectToAction("Index", "Home"));
            }
            else
            {
                ModelState.AddModelError("", "Invalid Username or Password!");
                return(View(model));
            }
        }