public ActionResult Index(UserDto model)
        {
            var authorizedUser = new AuthorizeManager().GetSession();

            if (ModelState.IsValid && authorizedUser.ID == model.ID)
            {
                try
                {
                    var user = _repo.Single <User>(model.ID);

                    // 设置model中的UserID
                    model.UserId = user.UserName;

                    user.EmployeeName = model.EmployeeName;
                    user.EmployeeNo   = model.EmployeeNo;
                    user.Department   = model.Department;
                    user.Position     = model.Position;
                    user.Mobile       = model.Mobile;
                    user.IsActive     = true;

                    // 更新用户信息
                    _repo.Update(user);

                    // 更新session中的授权用户
                    var auth = new AuthorizeManager();

                    if (auth.SetSession(user.ID))
                    {
                        ModelState.AddModelError("Success", "保存成功");
                    }
                }
                catch (Exception ex)
                {
                    ModelState.AddModelError("Warn", ex.Message);
                }
            }

            return(View(model));
        }