/// <summary> /// 编辑用户 /// </summary> /// <param name="user"></param> /// <returns></returns> public bool EditUser(User_U user) { using (var factory = new BaseAccess(base._DBConfigPath)) { try { var model = factory.Single <UserEntity>(user.ID); model = user.Adapter <UserEntity>(model);//将页面对象user的属性转换到数据库对象modle中 factory.Update <UserEntity>(model, false); //处理用户分组 var userDep = factory.Single <UserOrganizationEntity>(Specification <UserOrganizationEntity> .Create(c => c.UserID == user.ID && c.IsDefault == 1)); if (userDep.OrganizationID != user.UserDeptID) { userDep.OrganizationID = user.UserDeptID; factory.Update <UserOrganizationEntity>(userDep, false); } factory.Commit(); //清理缓存 Manage.Open.CacheshipFactory.Instance.ClearSSOUserCache(user.ID); return(true); } catch (Exception ex) { factory.Rollback(); return(false); } } }
public JsonResult _Edit(User_U user) { try { if (_UserFacade.Value.EditUser(user)) { return(Json(AjaxResult.Success("用户修改成功!"))); } else { return(Json(AjaxResult.Error("用户修改失败!"))); } } catch (Exception ex) { return(Json(AjaxResult.Error(ex.Message))); } }
/// <summary> /// 编辑用户 /// </summary> /// <param name="user"></param> /// <returns></returns> public bool EditUser(User_U user) { //不实现 return(false); }