|
|
|
@@ -48,7 +48,7 @@ namespace jdis_import |
|
|
|
_inspectionTypes = rservice.RestGet<InspectionType>("inspectionTypes.svc");
|
|
|
|
_templates = rservice.RestGet<Template>("templates.svc");
|
|
|
|
|
|
|
|
|
|
|
|
Console.WriteLine("Web APIs have loaded.");
|
|
|
|
_exeDir = Environment.CurrentDirectory;
|
|
|
|
SetupDirectories();
|
|
|
|
List<ToDo> list = new List<ToDo>();
|
|
|
|
@@ -64,6 +64,7 @@ namespace jdis_import |
|
|
|
var ewsScopes = new string[] { "https://outlook.office365.com/.default" };
|
|
|
|
try
|
|
|
|
{
|
|
|
|
Console.WriteLine("Connecting To Exchange.");
|
|
|
|
var authResult = await cca.AcquireTokenForClient(ewsScopes)
|
|
|
|
.ExecuteAsync();
|
|
|
|
|
|
|
|
@@ -86,6 +87,7 @@ namespace jdis_import |
|
|
|
view.PropertySet = new PropertySet(BasePropertySet.IdOnly, ItemSchema.Subject, ItemSchema.DateTimeReceived);
|
|
|
|
view.OrderBy.Add(ItemSchema.DateTimeReceived, SortDirection.Descending);
|
|
|
|
view.Traversal = ItemTraversal.Shallow;
|
|
|
|
Console.WriteLine("Line 90: Finding emails.");
|
|
|
|
FindItemsResults<Item> findResults = ewsClient.FindItems(fid, searchFilter, view);
|
|
|
|
foreach (EmailMessage msg in findResults.Items)
|
|
|
|
{
|
|
|
|
@@ -115,6 +117,7 @@ namespace jdis_import |
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Console.WriteLine("Beginning Import.");
|
|
|
|
foreach (ToDo import in list)
|
|
|
|
{
|
|
|
|
//System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls;
|
|
|
|
|