Пример #1
0
        public ActionResult Index(UserModel model)
        {
            if (!UserValidator.UserEmptyLoginValidate(model, this.ModelState))
                return PartialView("_LoginPartial");

            Session["UserName"] = model.UserName;
            return Json(new {success = true});
        }
Пример #2
0
 public static bool UserEmptyLoginValidate(UserModel model, ModelStateDictionary modelState)
 {
     if (model.UserName == null || model.Password == null)
         return false;
     if (model.UserName != "aaa")
     {
         modelState.AddModelError("UserName", "Неправильное имя пользователя или пароль");
         return false;
     }
     return true;
 }
 public ActionResult Index(UserModel model)
 {
     return View();
 }
Пример #4
0
 public JsonResult Login(UserModel model)
 {
     var categoryList = new JsonResult();
     return Json(categoryList, JsonRequestBehavior.AllowGet);
 }