/// <summary> /// Exports users. /// </summary> /// <param name="stream">The stream.</param> /// <param name="organizationId">The organization identifier.</param> /// <returns></returns> public Stream ExportUsers(Stream stream, int organizationId) { var users = _userRepository.Get(x => x.OrganizationRights.Count(r => r.OrganizationId == organizationId) > 0); var set = new DataSet(); set.Tables.Add(GetUserTable(users)); return(_excelHandler.Export(set, stream)); }
public async Task <IResultModel <ExcelExportResultModel> > ExportLogin(LoginLogQueryModel model) { var result = new ResultModel <ExcelExportResultModel>(); var list = await _loginLogRepository.Query(model); if (model.IsOutOfExportCountLimit) { return(result.Failed($"导出数据不能超过{model.ExportCountLimit}条")); } return(result.Success(_excelHandler.Export(model.Export, list))); }