Skip to content

Commit

Permalink
add datetime modified report
Browse files Browse the repository at this point in the history
  • Loading branch information
chuongmep committed Feb 28, 2024
1 parent 462d4cd commit d1b7f09
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions APSToolkit/BIM360/BIM360.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1757,6 +1757,7 @@ public DataTable BatchReportItemVersion(string projectId, string folderId,string
dataTable.Columns.Add("ItemId", typeof(string));
dataTable.Columns.Add("LatestVersion", typeof(long));
dataTable.Columns.Add("LatestURN", typeof(string));
dataTable.Columns.Add("LastModifiedTime", typeof(DateTime));
BatchReportItemVersionRecursive(projectId, folderId,extenstion,ref dataTable,isRecursive);
return dataTable;
}
Expand All @@ -1778,6 +1779,7 @@ private void BatchReportItemVersionRecursive(string projectId,string folderId,st
string urn = string.Empty;
dynamic? item = GetLatestVersionItem(get2LeggedToken, projectId, id);
string fileName = item?.attributes.displayName;
DateTime lastModifiedTime = item?.attributes.lastModifiedTime;
long versionNumber = item?.attributes.versionNumber;
string itemId = item?.relationships.item.data.id;
bool flag = item?.relationships.ContainsKey("derivatives");
Expand All @@ -1789,6 +1791,7 @@ private void BatchReportItemVersionRecursive(string projectId,string folderId,st
row["ItemId"] = itemId??string.Empty;
row["LatestVersion"] = versionNumber;
row["LatestURN"] = urn??string.Empty;
row["LastModifiedTime"] = lastModifiedTime;
dt.Rows.Add(row);
}
else if (itemInfo.Value.type == "folders" && isRecursive)
Expand All @@ -1803,6 +1806,7 @@ public DataTable BatchReportItem(string projectId, string itemId)
dataTable.Columns.Add("ItemId", typeof(string));
dataTable.Columns.Add("Version", typeof(long));
dataTable.Columns.Add("URN", typeof(string));
dataTable.Columns.Add("LastModifiedTime", typeof(DateTime));
var itemsApi = new ItemsApi();
// refresh token
string get2LeggedToken = Auth.Authentication.Get2LeggedToken().Result;
Expand All @@ -1812,6 +1816,7 @@ public DataTable BatchReportItem(string projectId, string itemId)
{
string urn = string.Empty;
long version = itemInfo.Value.attributes.versionNumber;
DateTime lastModifiedTime = itemInfo.Value.attributes.lastModifiedTime;
// check DynamicDictionary contains derivatives, fix does not contain a definition for 'derivatives'
bool flag = itemInfo.Value.relationships.ContainsKey("derivatives");
if (flag)
Expand All @@ -1822,6 +1827,7 @@ public DataTable BatchReportItem(string projectId, string itemId)
row["ItemId"] = itemId;
row["Version"] = version;
row["URN"] = urn;
row["LastModifiedTime"] = lastModifiedTime;
dataTable.Rows.Add(row);

}
Expand Down

0 comments on commit d1b7f09

Please sign in to comment.