Aras学习笔记 (47) 根据File Id提取文件下载次数方法
1 public int GetDownloadTimes(string FileId) 2 { 3 int DownloadTimes = 0; 4 5 try 6 { 7 List<ParameterModel> parameterList = new List<ParameterModel>(); 8 parameterList.Add(new ParameterModel("ITEM_ID", FileId)); 9 parameterList.Add(new ParameterModel("ACTION", "FileDownload")); 10 11 List<HISTORY> historyList = GetListByParameters<HISTORY>(parameterList); 12 if (historyList != null) 13 { 14 DownloadTimes = historyList.Count; 15 } 16 } 17 catch (Exception ex) 18 { 19 20 } 21 22 return DownloadTimes; 23 }
前提是File要启用History: