This commit is contained in:
@@ -164,11 +164,20 @@ namespace AyaNova.PlugIn.V8
|
||||
#endregion
|
||||
|
||||
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)
|
||||
{
|
||||
if (!Map.ContainsKey(id)) return 1;//1=raven administrator account
|
||||
return Map[id];
|
||||
|
||||
}
|
||||
|
||||
private Dictionary<Guid, string> TagMap = new Dictionary<Guid, string>();
|
||||
@@ -204,6 +213,11 @@ namespace AyaNova.PlugIn.V8
|
||||
|
||||
/*
|
||||
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
|
||||
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?
|
||||
@@ -461,7 +475,7 @@ namespace AyaNova.PlugIn.V8
|
||||
|
||||
var rMainObject = await util.PostAsync("User", d.ToString());
|
||||
long RavenId = util.IdFromResponse(rMainObject);
|
||||
Map.Add(c.ID, RavenId);
|
||||
AddMap(c.ID, RavenId);
|
||||
|
||||
//USER OPTIONS
|
||||
if (c.ScheduleBackColor != 0 || !string.IsNullOrWhiteSpace(c.EmailAddress))
|
||||
@@ -569,7 +583,7 @@ namespace AyaNova.PlugIn.V8
|
||||
|
||||
var rMainObject = await util.PostAsync("Customer", d.ToString());
|
||||
long RavenId = util.IdFromResponse(rMainObject);
|
||||
Map.Add(c.ID, RavenId);
|
||||
AddMap(c.ID, RavenId);
|
||||
|
||||
//Attachments / FILES
|
||||
await ExportAttachments(ObjectTID, progress);
|
||||
@@ -650,7 +664,7 @@ namespace AyaNova.PlugIn.V8
|
||||
|
||||
var rMainObject = await util.PostAsync("HeadOffice", d.ToString());
|
||||
long RavenId = util.IdFromResponse(rMainObject);
|
||||
Map.Add(c.ID, RavenId);
|
||||
AddMap(c.ID, RavenId);
|
||||
|
||||
//Attachments / FILES
|
||||
await ExportAttachments(ObjectTID, progress);
|
||||
@@ -729,7 +743,7 @@ namespace AyaNova.PlugIn.V8
|
||||
|
||||
var rMainObject = await util.PostAsync(ObjectTypeName, d.ToString());
|
||||
long RavenId = util.IdFromResponse(rMainObject);
|
||||
Map.Add(c.ID, RavenId);
|
||||
AddMap(c.ID, RavenId);
|
||||
|
||||
//Attachments / FILES
|
||||
await ExportAttachments(ObjectTID, progress);
|
||||
@@ -808,7 +822,7 @@ namespace AyaNova.PlugIn.V8
|
||||
|
||||
var rMainObject = await util.PostAsync(RavenObjectName, d.ToString());
|
||||
long RavenId = util.IdFromResponse(rMainObject);
|
||||
Map.Add(c.ID, RavenId);
|
||||
AddMap(c.ID, RavenId);
|
||||
|
||||
//Attachments / FILES
|
||||
await ExportAttachments(ObjectTID, progress);
|
||||
@@ -889,7 +903,7 @@ namespace AyaNova.PlugIn.V8
|
||||
|
||||
var rMainObject = await util.PostAsync(RavenObjectName, d.ToString());
|
||||
long RavenId = util.IdFromResponse(rMainObject);
|
||||
Map.Add(c.ID, RavenId);
|
||||
AddMap(c.ID, RavenId);
|
||||
|
||||
//Attachments / FILES
|
||||
await ExportAttachments(ObjectTID, progress);
|
||||
@@ -968,7 +982,7 @@ namespace AyaNova.PlugIn.V8
|
||||
|
||||
var rMainObject = await util.PostAsync(ObjectTypeName, d.ToString());
|
||||
long RavenId = util.IdFromResponse(rMainObject);
|
||||
Map.Add(c.ID, RavenId);
|
||||
AddMap(c.ID, RavenId);
|
||||
|
||||
//Attachments / FILES
|
||||
await ExportAttachments(ObjectTID, progress);
|
||||
@@ -1044,7 +1058,7 @@ namespace AyaNova.PlugIn.V8
|
||||
|
||||
var rMainObject = await util.PostAsync(ObjectTypeName, d.ToString());
|
||||
long RavenId = util.IdFromResponse(rMainObject);
|
||||
Map.Add(c.ID, RavenId);
|
||||
AddMap(c.ID, RavenId);
|
||||
|
||||
//Attachments / FILES
|
||||
await ExportAttachments(ObjectTID, progress);
|
||||
@@ -1113,7 +1127,7 @@ namespace AyaNova.PlugIn.V8
|
||||
|
||||
var rMainObject = await util.PostAsync(ObjectTypeName, d.ToString());
|
||||
long RavenId = util.IdFromResponse(rMainObject);
|
||||
Map.Add(c.ID, RavenId);
|
||||
AddMap(c.ID, RavenId);
|
||||
|
||||
//Attachments / FILES
|
||||
await ExportAttachments(ObjectTID, progress);
|
||||
@@ -1195,7 +1209,7 @@ namespace AyaNova.PlugIn.V8
|
||||
|
||||
var rMainObject = await util.PostAsync(ObjectTypeName, d.ToString());
|
||||
long RavenId = util.IdFromResponse(rMainObject);
|
||||
Map.Add(c.ID, RavenId);
|
||||
AddMap(c.ID, RavenId);
|
||||
|
||||
//Attachments / FILES
|
||||
await ExportAttachments(ObjectTID, progress);
|
||||
@@ -1273,7 +1287,7 @@ namespace AyaNova.PlugIn.V8
|
||||
|
||||
var rMainObject = await util.PostAsync(ObjectTypeName, d.ToString());
|
||||
long RavenId = util.IdFromResponse(rMainObject);
|
||||
Map.Add(c.ID, RavenId);
|
||||
AddMap(c.ID, RavenId);
|
||||
|
||||
//Attachments / FILES
|
||||
await ExportAttachments(ObjectTID, progress);
|
||||
@@ -1340,7 +1354,7 @@ namespace AyaNova.PlugIn.V8
|
||||
//make one on the server to update
|
||||
var rMainObject = await util.PostAsync(RavenObjectName + "/Create?serial=" + c.WorkorderService.ServiceNumber);
|
||||
long RavenId = util.IdFromResponse(rMainObject);
|
||||
Map.Add(c.ID, RavenId);
|
||||
AddMap(c.ID, RavenId);
|
||||
|
||||
dynamic d = new JObject();
|
||||
d.concurrencyToken = util.CTokenFromResponse(rMainObject);
|
||||
@@ -1423,7 +1437,7 @@ namespace AyaNova.PlugIn.V8
|
||||
//make one on the server to update
|
||||
var rMainObject = await util.PostAsync(RavenObjectName + "/Create?serial=" + c.WorkorderQuote.QuoteNumber);
|
||||
long RavenId = util.IdFromResponse(rMainObject);
|
||||
Map.Add(c.ID, RavenId);
|
||||
AddMap(c.ID, RavenId);
|
||||
|
||||
dynamic d = new JObject();
|
||||
d.concurrencyToken = util.CTokenFromResponse(rMainObject);
|
||||
@@ -1506,7 +1520,7 @@ namespace AyaNova.PlugIn.V8
|
||||
//make one on the server to update
|
||||
var rMainObject = await util.PostAsync(RavenObjectName + "/Create?serial=" + c.WorkorderPreventiveMaintenance.PreventiveMaintenanceNumber);
|
||||
long RavenId = util.IdFromResponse(rMainObject);
|
||||
Map.Add(c.ID, RavenId);
|
||||
AddMap(c.ID, RavenId);
|
||||
|
||||
dynamic d = new JObject();
|
||||
d.concurrencyToken = util.CTokenFromResponse(rMainObject);
|
||||
@@ -2182,7 +2196,7 @@ namespace AyaNova.PlugIn.V8
|
||||
if (oId > ravenId) ravenId = oId;
|
||||
}
|
||||
|
||||
Map.Add(af.ID, ravenId);
|
||||
AddMap(af.ID, ravenId);
|
||||
}
|
||||
|
||||
progress.SubOp("");
|
||||
|
||||
Reference in New Issue
Block a user