/// <summary> /// 修改用户并修改关联角色 /// </summary> /// <param name="u"></param> /// <returns></returns> public bool UpdateUsers(view_sys_user_role u) { var model = new sys_user(); model.User_ID = u.User_ID; model.User_LoginName = u.User_LoginName; model.User_Name = u.User_Name; model.User_Pwd = u.User_Pwd; model.User_Email = u.User_Email; var result = _Sys_UserRepositoryS.Update(model, p => new { p.User_LoginName, p.User_Name, p.User_Pwd, p.User_Email, p.User_CreateTime }); if (result) { var rmodel = new sys_userrole(); rmodel.UserRole_ID = u.UserRole_ID; rmodel.UserRole_RoleID = u.Role_ID; rmodel.UserRole_UserID = u.User_ID; _Sys_UserRoleRepositoryS.Update(rmodel, p => new { p.UserRole_RoleID, p.UserRole_UserID }); } return(result); }
/// <summary> /// 更新实体数据 /// </summary> /// <param name="entity"></param> /// <returns></returns> public bool Update(sys_userrole entity) { return(_Sys_UserRoleRepositoryS.Update(entity)); }