/// <summary> /// 编辑用户角色 /// </summary> /// <param name="args"></param> /// <returns></returns> public CommandResult <object> CreateOrUpdateUserRole(CreateOrUpdateUserRoleArgs args) { ArgumentHelper.Require(args.SchoolId, "SchoolId", Arguments.Positive); ArgumentHelper.Require(args.RoleId, "RoleId", Arguments.Positive); ArgumentHelper.Require(args.UserId, "UserId", Arguments.Positive); ArgumentHelper.Require(args.CreateBy, "CreateBy", Arguments.Positive); ArgumentHelper.Require(args.ModifyBy, "ModifyBy", Arguments.Positive); return(ContainerFactory <IUserRepository> .Instance.CreateOrUpdateUserRole(args)); }
public CommandResult <object> CreateOrUpdateUserRole(CreateOrUpdateUserRoleArgs args) { try { var result = ContainerFactory <ISqlExcuteContext> .Instance.ExcuteScalarProceDure(0, "create_or_update_userrole", args); return(result); } catch (Exception e) { LogHelper.Error(this.GetType(), "用户模块-编辑用户角色信息失败", e); return(CommandResult.Failure <object>(e.ToString())); } }
public string UpdateUserRole(CreateOrUpdateUserRoleArgs model) { if (model != null) { model.CreateBy = ApplicationContext.UserId; model.ModifyBy = ApplicationContext.UserId; model.SchoolId = ApplicationContext.SchoolId; var result = UserService.Instance.CreateOrUpdateUserRole(model); if (result.Code == 200) { ApplicationContext.RoleId = model.RoleId; } return(JsonHelper.Serialize(result)); } return(JsonHelper.Serialize(CommandResult.Failure("数据格式错误"))); }