This commit is contained in:
@@ -164,11 +164,20 @@ namespace AyaNova.PlugIn.V8
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private Dictionary<Guid, long> Map = new Dictionary<Guid, long>();
|
private Dictionary<Guid, long> Map = new Dictionary<Guid, long>();
|
||||||
|
private void AddMap(Guid v7id, long v8id)
|
||||||
|
{
|
||||||
|
if (Map.ContainsKey(v7id))
|
||||||
|
{
|
||||||
|
|
||||||
|
throw new Exception("Error: AddMap - v7id already mapped previously, id is " + v7id.ToString());
|
||||||
|
}
|
||||||
|
else Map.Add(v7id, v8id);
|
||||||
|
}
|
||||||
|
|
||||||
private long SafeGetUserMap(Guid id)
|
private long SafeGetUserMap(Guid id)
|
||||||
{
|
{
|
||||||
if (!Map.ContainsKey(id)) return 1;//1=raven administrator account
|
if (!Map.ContainsKey(id)) return 1;//1=raven administrator account
|
||||||
return Map[id];
|
return Map[id];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Dictionary<Guid, string> TagMap = new Dictionary<Guid, string>();
|
private Dictionary<Guid, string> TagMap = new Dictionary<Guid, string>();
|
||||||
@@ -204,6 +213,11 @@ namespace AyaNova.PlugIn.V8
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
TODO:
|
TODO:
|
||||||
|
|
||||||
|
Only compare original locale keys for hash not ones added in schema updates or dropped
|
||||||
|
|
||||||
|
Need more detail when fails on release mode, right now no idea what actually happened
|
||||||
|
|
||||||
I'd like to see a full log sent to the server on fail
|
I'd like to see a full log sent to the server on fail
|
||||||
keep a record of every op/subop etc in progress, on fail push out that list with the
|
keep a record of every op/subop etc in progress, on fail push out that list with the
|
||||||
exception to somewhere on the server, maybe as an attachment for the manager user?
|
exception to somewhere on the server, maybe as an attachment for the manager user?
|
||||||
@@ -461,7 +475,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
|
|
||||||
var rMainObject = await util.PostAsync("User", d.ToString());
|
var rMainObject = await util.PostAsync("User", d.ToString());
|
||||||
long RavenId = util.IdFromResponse(rMainObject);
|
long RavenId = util.IdFromResponse(rMainObject);
|
||||||
Map.Add(c.ID, RavenId);
|
AddMap(c.ID, RavenId);
|
||||||
|
|
||||||
//USER OPTIONS
|
//USER OPTIONS
|
||||||
if (c.ScheduleBackColor != 0 || !string.IsNullOrWhiteSpace(c.EmailAddress))
|
if (c.ScheduleBackColor != 0 || !string.IsNullOrWhiteSpace(c.EmailAddress))
|
||||||
@@ -569,7 +583,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
|
|
||||||
var rMainObject = await util.PostAsync("Customer", d.ToString());
|
var rMainObject = await util.PostAsync("Customer", d.ToString());
|
||||||
long RavenId = util.IdFromResponse(rMainObject);
|
long RavenId = util.IdFromResponse(rMainObject);
|
||||||
Map.Add(c.ID, RavenId);
|
AddMap(c.ID, RavenId);
|
||||||
|
|
||||||
//Attachments / FILES
|
//Attachments / FILES
|
||||||
await ExportAttachments(ObjectTID, progress);
|
await ExportAttachments(ObjectTID, progress);
|
||||||
@@ -650,7 +664,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
|
|
||||||
var rMainObject = await util.PostAsync("HeadOffice", d.ToString());
|
var rMainObject = await util.PostAsync("HeadOffice", d.ToString());
|
||||||
long RavenId = util.IdFromResponse(rMainObject);
|
long RavenId = util.IdFromResponse(rMainObject);
|
||||||
Map.Add(c.ID, RavenId);
|
AddMap(c.ID, RavenId);
|
||||||
|
|
||||||
//Attachments / FILES
|
//Attachments / FILES
|
||||||
await ExportAttachments(ObjectTID, progress);
|
await ExportAttachments(ObjectTID, progress);
|
||||||
@@ -729,7 +743,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
|
|
||||||
var rMainObject = await util.PostAsync(ObjectTypeName, d.ToString());
|
var rMainObject = await util.PostAsync(ObjectTypeName, d.ToString());
|
||||||
long RavenId = util.IdFromResponse(rMainObject);
|
long RavenId = util.IdFromResponse(rMainObject);
|
||||||
Map.Add(c.ID, RavenId);
|
AddMap(c.ID, RavenId);
|
||||||
|
|
||||||
//Attachments / FILES
|
//Attachments / FILES
|
||||||
await ExportAttachments(ObjectTID, progress);
|
await ExportAttachments(ObjectTID, progress);
|
||||||
@@ -808,7 +822,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
|
|
||||||
var rMainObject = await util.PostAsync(RavenObjectName, d.ToString());
|
var rMainObject = await util.PostAsync(RavenObjectName, d.ToString());
|
||||||
long RavenId = util.IdFromResponse(rMainObject);
|
long RavenId = util.IdFromResponse(rMainObject);
|
||||||
Map.Add(c.ID, RavenId);
|
AddMap(c.ID, RavenId);
|
||||||
|
|
||||||
//Attachments / FILES
|
//Attachments / FILES
|
||||||
await ExportAttachments(ObjectTID, progress);
|
await ExportAttachments(ObjectTID, progress);
|
||||||
@@ -889,7 +903,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
|
|
||||||
var rMainObject = await util.PostAsync(RavenObjectName, d.ToString());
|
var rMainObject = await util.PostAsync(RavenObjectName, d.ToString());
|
||||||
long RavenId = util.IdFromResponse(rMainObject);
|
long RavenId = util.IdFromResponse(rMainObject);
|
||||||
Map.Add(c.ID, RavenId);
|
AddMap(c.ID, RavenId);
|
||||||
|
|
||||||
//Attachments / FILES
|
//Attachments / FILES
|
||||||
await ExportAttachments(ObjectTID, progress);
|
await ExportAttachments(ObjectTID, progress);
|
||||||
@@ -968,7 +982,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
|
|
||||||
var rMainObject = await util.PostAsync(ObjectTypeName, d.ToString());
|
var rMainObject = await util.PostAsync(ObjectTypeName, d.ToString());
|
||||||
long RavenId = util.IdFromResponse(rMainObject);
|
long RavenId = util.IdFromResponse(rMainObject);
|
||||||
Map.Add(c.ID, RavenId);
|
AddMap(c.ID, RavenId);
|
||||||
|
|
||||||
//Attachments / FILES
|
//Attachments / FILES
|
||||||
await ExportAttachments(ObjectTID, progress);
|
await ExportAttachments(ObjectTID, progress);
|
||||||
@@ -1044,7 +1058,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
|
|
||||||
var rMainObject = await util.PostAsync(ObjectTypeName, d.ToString());
|
var rMainObject = await util.PostAsync(ObjectTypeName, d.ToString());
|
||||||
long RavenId = util.IdFromResponse(rMainObject);
|
long RavenId = util.IdFromResponse(rMainObject);
|
||||||
Map.Add(c.ID, RavenId);
|
AddMap(c.ID, RavenId);
|
||||||
|
|
||||||
//Attachments / FILES
|
//Attachments / FILES
|
||||||
await ExportAttachments(ObjectTID, progress);
|
await ExportAttachments(ObjectTID, progress);
|
||||||
@@ -1113,7 +1127,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
|
|
||||||
var rMainObject = await util.PostAsync(ObjectTypeName, d.ToString());
|
var rMainObject = await util.PostAsync(ObjectTypeName, d.ToString());
|
||||||
long RavenId = util.IdFromResponse(rMainObject);
|
long RavenId = util.IdFromResponse(rMainObject);
|
||||||
Map.Add(c.ID, RavenId);
|
AddMap(c.ID, RavenId);
|
||||||
|
|
||||||
//Attachments / FILES
|
//Attachments / FILES
|
||||||
await ExportAttachments(ObjectTID, progress);
|
await ExportAttachments(ObjectTID, progress);
|
||||||
@@ -1195,7 +1209,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
|
|
||||||
var rMainObject = await util.PostAsync(ObjectTypeName, d.ToString());
|
var rMainObject = await util.PostAsync(ObjectTypeName, d.ToString());
|
||||||
long RavenId = util.IdFromResponse(rMainObject);
|
long RavenId = util.IdFromResponse(rMainObject);
|
||||||
Map.Add(c.ID, RavenId);
|
AddMap(c.ID, RavenId);
|
||||||
|
|
||||||
//Attachments / FILES
|
//Attachments / FILES
|
||||||
await ExportAttachments(ObjectTID, progress);
|
await ExportAttachments(ObjectTID, progress);
|
||||||
@@ -1273,7 +1287,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
|
|
||||||
var rMainObject = await util.PostAsync(ObjectTypeName, d.ToString());
|
var rMainObject = await util.PostAsync(ObjectTypeName, d.ToString());
|
||||||
long RavenId = util.IdFromResponse(rMainObject);
|
long RavenId = util.IdFromResponse(rMainObject);
|
||||||
Map.Add(c.ID, RavenId);
|
AddMap(c.ID, RavenId);
|
||||||
|
|
||||||
//Attachments / FILES
|
//Attachments / FILES
|
||||||
await ExportAttachments(ObjectTID, progress);
|
await ExportAttachments(ObjectTID, progress);
|
||||||
@@ -1340,7 +1354,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
//make one on the server to update
|
//make one on the server to update
|
||||||
var rMainObject = await util.PostAsync(RavenObjectName + "/Create?serial=" + c.WorkorderService.ServiceNumber);
|
var rMainObject = await util.PostAsync(RavenObjectName + "/Create?serial=" + c.WorkorderService.ServiceNumber);
|
||||||
long RavenId = util.IdFromResponse(rMainObject);
|
long RavenId = util.IdFromResponse(rMainObject);
|
||||||
Map.Add(c.ID, RavenId);
|
AddMap(c.ID, RavenId);
|
||||||
|
|
||||||
dynamic d = new JObject();
|
dynamic d = new JObject();
|
||||||
d.concurrencyToken = util.CTokenFromResponse(rMainObject);
|
d.concurrencyToken = util.CTokenFromResponse(rMainObject);
|
||||||
@@ -1423,7 +1437,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
//make one on the server to update
|
//make one on the server to update
|
||||||
var rMainObject = await util.PostAsync(RavenObjectName + "/Create?serial=" + c.WorkorderQuote.QuoteNumber);
|
var rMainObject = await util.PostAsync(RavenObjectName + "/Create?serial=" + c.WorkorderQuote.QuoteNumber);
|
||||||
long RavenId = util.IdFromResponse(rMainObject);
|
long RavenId = util.IdFromResponse(rMainObject);
|
||||||
Map.Add(c.ID, RavenId);
|
AddMap(c.ID, RavenId);
|
||||||
|
|
||||||
dynamic d = new JObject();
|
dynamic d = new JObject();
|
||||||
d.concurrencyToken = util.CTokenFromResponse(rMainObject);
|
d.concurrencyToken = util.CTokenFromResponse(rMainObject);
|
||||||
@@ -1506,7 +1520,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
//make one on the server to update
|
//make one on the server to update
|
||||||
var rMainObject = await util.PostAsync(RavenObjectName + "/Create?serial=" + c.WorkorderPreventiveMaintenance.PreventiveMaintenanceNumber);
|
var rMainObject = await util.PostAsync(RavenObjectName + "/Create?serial=" + c.WorkorderPreventiveMaintenance.PreventiveMaintenanceNumber);
|
||||||
long RavenId = util.IdFromResponse(rMainObject);
|
long RavenId = util.IdFromResponse(rMainObject);
|
||||||
Map.Add(c.ID, RavenId);
|
AddMap(c.ID, RavenId);
|
||||||
|
|
||||||
dynamic d = new JObject();
|
dynamic d = new JObject();
|
||||||
d.concurrencyToken = util.CTokenFromResponse(rMainObject);
|
d.concurrencyToken = util.CTokenFromResponse(rMainObject);
|
||||||
@@ -2182,7 +2196,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
if (oId > ravenId) ravenId = oId;
|
if (oId > ravenId) ravenId = oId;
|
||||||
}
|
}
|
||||||
|
|
||||||
Map.Add(af.ID, ravenId);
|
AddMap(af.ID, ravenId);
|
||||||
}
|
}
|
||||||
|
|
||||||
progress.SubOp("");
|
progress.SubOp("");
|
||||||
|
|||||||
Reference in New Issue
Block a user