コード例 #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
ファイル: UserValidator.cs プロジェクト: georgevolkov/HatShop
 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;
 }
コード例 #3
0
 public ActionResult Index(UserModel model)
 {
     return View();
 }
コード例 #4
0
 public JsonResult Login(UserModel model)
 {
     var categoryList = new JsonResult();
     return Json(categoryList, JsonRequestBehavior.AllowGet);
 }