/// <summary> /// 在指定库中根据filterId获取下拉键值集合(code所在数据库) /// </summary> /// <param name="dictTypeName">字典类型名称</param> /// <returns></returns> public string GetFilterDropDown(long?filterId, string code) { if (filterId != null) { var report = _reportAppService.GetReportBase(code); var ft = _tbReportAppService.GetFilter(filterId.Value); if (ft != null) { DataTable table = new DataTable(); //默认的承载库 if (report.DbServerId == null || report.DbServerId == 0) { table = DbHelper.ExecuteGetTable(ft.FilterSql); } else//指定库 { table = _dbServerAppService.ExecuteGetTable(report.DbServerId.Value, ft.FilterSql); } if (table != null && table.Rows.Count > 0) { return(Fun.DataTable2Json(table)); } } } return("[]"); }