Skip to content

Commit

Permalink
fix: Add GetNewEvents and GetDepartments to COM
Browse files Browse the repository at this point in the history
  • Loading branch information
Capucinimo committed Feb 21, 2022
1 parent 08d5f2e commit f4d8e97
Showing 1 changed file with 23 additions and 17 deletions.
40 changes: 23 additions & 17 deletions src/ComDiadocApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ BoxEventList GetNewEvents(
string[] messageTypes = null,
string[] typeNamedIds = null,
string[] documentDirections = null,
long? timestampFromTicks = null,
long? timestampToTicks = null,
long timestampFromTicks = 0,
long timestampToTicks = 0,
string counteragentBoxId = null,
string orderBy = null,
int? limit = null);
int limit = 0);

BoxEvent GetEvent(string authToken, string boxId, string eventId);
void SaveEntityContent(string authToken, string boxId, string messageId, string entityId, string filePath);
Expand Down Expand Up @@ -496,7 +496,7 @@ void DeleteEmployeePowerOfAttorney(
string issuerInn);

Departments.Department GetDepartmentByFullId(string authToken, string boxId, string departmentId);
Departments.DepartmentList GetDepartments(string authToken, string boxId, int? page = null, int? count = null);
Departments.DepartmentList GetDepartments(string authToken, string boxId, int page = 0, int count = 0);
Departments.Department CreateDepartment(string authToken, string boxId, [MarshalAs(UnmanagedType.IDispatch)] object departmentToCreate);
Departments.Department UpdateDepartment(string authToken, string boxId, string departmentId, [MarshalAs(UnmanagedType.IDispatch)] object departmentToUpdate);
void DeleteDepartment(string authToken, string boxId, string departmentId);
Expand Down Expand Up @@ -682,13 +682,26 @@ public BoxEventList GetNewEvents(
string[] messageTypes = null,
string[] typeNamedIds = null,
string[] documentDirections = null,
long? timestampFromTicks = null,
long? timestampToTicks = null,
long timestampFromTicks = 0,
long timestampToTicks = 0,
string counteragentBoxId = null,
string orderBy = null,
int? limit = null)
int limit = 0)
{
return diadoc.GetNewEvents(authToken, boxId, afterEventId, afterIndexKey, departmentId, messageTypes, typeNamedIds, documentDirections, timestampFromTicks, timestampToTicks, counteragentBoxId, orderBy, limit);
return diadoc.GetNewEvents(
authToken,
boxId,
afterEventId,
afterIndexKey,
departmentId,
messageTypes,
typeNamedIds,
documentDirections,
timestampFromTicks != 0 ? timestampFromTicks : (long?)null,
timestampToTicks != 0 ? timestampToTicks : (long?)null,
counteragentBoxId,
orderBy,
limit != 0 ? limit : (int?)null);
}

public BoxEvent GetEvent(string authToken, string boxId, string eventId)
Expand Down Expand Up @@ -786,9 +799,9 @@ public Departments.Department GetDepartmentByFullId(string authToken, string box
return diadoc.GetDepartmentByFullId(authToken, boxId, departmentId);
}

public Departments.DepartmentList GetDepartments(string authToken, string boxId, int? page = null, int? count = null)
public Departments.DepartmentList GetDepartments(string authToken, string boxId, int page = 0, int count = 0)
{
return diadoc.GetDepartments(authToken, boxId, page, count);
return diadoc.GetDepartments(authToken, boxId, page != 0 ? page : (int?)null, count != 0 ? count : (int?)null);
}

public Departments.Department CreateDepartment(string authToken, string boxId, object departmentToCreate)
Expand Down Expand Up @@ -1127,13 +1140,6 @@ public GeneratedFile GenerateTitleXml(
string letterId = null,
string documentId = null)
{
if (authToken == null) throw new ArgumentNullException("authToken");
if (boxId == null) throw new ArgumentNullException("boxId");
if (documentTypeNamedId == null) throw new ArgumentNullException("documentTypeNamedId");
if (documentFunction == null) throw new ArgumentNullException("documentFunction");
if (documentVersion == null) throw new ArgumentNullException("documentVersion");
if (userContractData == null) throw new ArgumentNullException("userContractData");

return diadoc.GenerateTitleXml(
authToken,
boxId,
Expand Down

0 comments on commit f4d8e97

Please sign in to comment.