public ActionResult UserDetail()
 {
     UserModel userModel = new UserModel();
     userModel.UserName = "******";
     userModel.Password = "******";
     userModel.Sex = 0;
     userModel.Age = 30;
     userModel.Height = 170;
     userModel.Weight = 70;
     userModel.Graduated = "毕业院校";
     return View(userModel);
 }
        public ActionResult Login(UserViewModel model)
        {
            if (ModelState.IsValid)
            {
                UserModel userModel = new UserModel();
                User user = userModel.findByEmail(model.Email);

                if (user != null && verifyMd5Hash(model.Password, user.Password))
                {
                    Session["user"] = user;
                    return RedirectToAction("List", "Customer");
                }

                ViewData["authErrorMessage"] = "The e-mail and/or password entered is invalid. Please try again.";
            }

            return View(model);
        }
        //
        // GET: /User/
        public JsonResult Get()
        {
            var user = Session["user"];

            if( user == null )
            {
                return fail();
            }
            else
            {
                var model = new UserModel();
                var _user = (User)user;

                return Json( new {
                    success = true,
                    role = _user.Role.name
                }, JsonRequestBehavior.AllowGet);
            }
        }
 public ActionResult UserDetail(UserModel userModel)
 {
     return View(userModel);
 }
예제 #5
0
 public ActionResult UpdateUser(UserModel model)
 {
     return Json(model);
 }
예제 #6
0
 public ActionResult GetUserById(UserModel model)
 {
     return Json(model);
 }
예제 #7
0
 public ActionResult AddUser(UserModel model)
 {
     return Json(model);
 }