This commit is contained in:
@@ -237,6 +237,12 @@ namespace AyaNova.PlugIn.V8
|
|||||||
private Dictionary<string, long> LocaleMap = new Dictionary<string, long>();
|
private Dictionary<string, long> LocaleMap = new Dictionary<string, long>();
|
||||||
|
|
||||||
private string ImportTag = "v7-import";
|
private string ImportTag = "v7-import";
|
||||||
|
|
||||||
|
private static void AddImportTag(List<string> tags){
|
||||||
|
if(!string.IsNullOrWhiteSpace(ImportTag))
|
||||||
|
tags.Add(ImportTag);
|
||||||
|
}
|
||||||
|
|
||||||
private bool ExportAssignedDocs = false;
|
private bool ExportAssignedDocs = false;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Dump the objects into a temporary directory as a series of JSON files
|
/// Dump the objects into a temporary directory as a series of JSON files
|
||||||
@@ -523,7 +529,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
|
|
||||||
|
|
||||||
List<string> tags = new List<string>();
|
List<string> tags = new List<string>();
|
||||||
tags.Add(ImportTag);
|
AddImportTag(tags);
|
||||||
|
|
||||||
//skip administrator user fields
|
//skip administrator user fields
|
||||||
//but do export administrator
|
//but do export administrator
|
||||||
@@ -681,7 +687,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
|
|
||||||
|
|
||||||
List<string> tags = new List<string>();
|
List<string> tags = new List<string>();
|
||||||
tags.Add(ImportTag);
|
AddImportTag(tags);
|
||||||
|
|
||||||
//skip administrator user fields
|
//skip administrator user fields
|
||||||
//but do export administrator
|
//but do export administrator
|
||||||
@@ -857,7 +863,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
{
|
{
|
||||||
if (!progress.KeepGoing) return;
|
if (!progress.KeepGoing) return;
|
||||||
List<string> tags = new List<string>();
|
List<string> tags = new List<string>();
|
||||||
tags.Add(ImportTag);
|
AddImportTag(tags);
|
||||||
|
|
||||||
Client c = Client.GetItem(i.ID);
|
Client c = Client.GetItem(i.ID);
|
||||||
var ObjectTID = new TypeAndID(RootObjectTypes.Client, c.ID);
|
var ObjectTID = new TypeAndID(RootObjectTypes.Client, c.ID);
|
||||||
@@ -1114,7 +1120,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
{
|
{
|
||||||
if (!progress.KeepGoing) return;
|
if (!progress.KeepGoing) return;
|
||||||
List<string> tags = new List<string>();
|
List<string> tags = new List<string>();
|
||||||
tags.Add(ImportTag);
|
AddImportTag(tags);
|
||||||
|
|
||||||
HeadOffice c = HeadOffice.GetItem(i.ID);
|
HeadOffice c = HeadOffice.GetItem(i.ID);
|
||||||
var ObjectTID = new TypeAndID(RootObjectTypes.HeadOffice, c.ID);
|
var ObjectTID = new TypeAndID(RootObjectTypes.HeadOffice, c.ID);
|
||||||
@@ -1282,7 +1288,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
{
|
{
|
||||||
if (!progress.KeepGoing) return;
|
if (!progress.KeepGoing) return;
|
||||||
List<string> tags = new List<string>();
|
List<string> tags = new List<string>();
|
||||||
tags.Add(ImportTag);
|
AddImportTag(tags);
|
||||||
|
|
||||||
Contract c = Contract.GetItem(i.ID);
|
Contract c = Contract.GetItem(i.ID);
|
||||||
var ObjectTID = new TypeAndID(RootObjectTypes.Contract, c.ID);
|
var ObjectTID = new TypeAndID(RootObjectTypes.Contract, c.ID);
|
||||||
@@ -1392,7 +1398,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
{
|
{
|
||||||
if (!progress.KeepGoing) return;
|
if (!progress.KeepGoing) return;
|
||||||
List<string> tags = new List<string>();
|
List<string> tags = new List<string>();
|
||||||
tags.Add(ImportTag);
|
AddImportTag(tags);
|
||||||
|
|
||||||
LoanItem c = LoanItem.GetItem(i.ID);
|
LoanItem c = LoanItem.GetItem(i.ID);
|
||||||
var ObjectTID = new TypeAndID(RootObjectTypes.LoanItem, c.ID);
|
var ObjectTID = new TypeAndID(RootObjectTypes.LoanItem, c.ID);
|
||||||
@@ -1485,7 +1491,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
{
|
{
|
||||||
if (!progress.KeepGoing) return;
|
if (!progress.KeepGoing) return;
|
||||||
List<string> tags = new List<string>();
|
List<string> tags = new List<string>();
|
||||||
tags.Add(ImportTag);
|
AddImportTag(tags);
|
||||||
|
|
||||||
Part c = Part.GetItem(i.ID);
|
Part c = Part.GetItem(i.ID);
|
||||||
var ObjectTID = new TypeAndID(RootObjectTypes.Part, c.ID);
|
var ObjectTID = new TypeAndID(RootObjectTypes.Part, c.ID);
|
||||||
@@ -1573,7 +1579,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
{
|
{
|
||||||
if (!progress.KeepGoing) return;
|
if (!progress.KeepGoing) return;
|
||||||
List<string> tags = new List<string>();
|
List<string> tags = new List<string>();
|
||||||
tags.Add(ImportTag);
|
AddImportTag(tags);
|
||||||
|
|
||||||
Project c = Project.GetItem(i.ID);
|
Project c = Project.GetItem(i.ID);
|
||||||
var ObjectTID = new TypeAndID(RootObjectTypes.Project, c.ID);
|
var ObjectTID = new TypeAndID(RootObjectTypes.Project, c.ID);
|
||||||
@@ -1654,7 +1660,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
{
|
{
|
||||||
if (!progress.KeepGoing) return;
|
if (!progress.KeepGoing) return;
|
||||||
List<string> tags = new List<string>();
|
List<string> tags = new List<string>();
|
||||||
tags.Add(ImportTag);
|
AddImportTag(tags);
|
||||||
PurchaseOrder c = PurchaseOrder.GetItem(i.LT_PurchaseOrder_Label_PONumber.Value);
|
PurchaseOrder c = PurchaseOrder.GetItem(i.LT_PurchaseOrder_Label_PONumber.Value);
|
||||||
|
|
||||||
//get receipts for this PO
|
//get receipts for this PO
|
||||||
@@ -1731,7 +1737,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
{
|
{
|
||||||
if (!progress.KeepGoing) return;
|
if (!progress.KeepGoing) return;
|
||||||
List<string> tags = new List<string>();
|
List<string> tags = new List<string>();
|
||||||
tags.Add(ImportTag);
|
AddImportTag(tags);
|
||||||
|
|
||||||
Unit c = Unit.GetItem(i.ID);
|
Unit c = Unit.GetItem(i.ID);
|
||||||
var ObjectTID = new TypeAndID(RootObjectTypes.Unit, c.ID);
|
var ObjectTID = new TypeAndID(RootObjectTypes.Unit, c.ID);
|
||||||
@@ -1880,7 +1886,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
{
|
{
|
||||||
if (!progress.KeepGoing) return;
|
if (!progress.KeepGoing) return;
|
||||||
List<string> tags = new List<string>();
|
List<string> tags = new List<string>();
|
||||||
tags.Add(ImportTag);
|
AddImportTag(tags);
|
||||||
|
|
||||||
UnitModel c = UnitModel.GetItem(i.ID);
|
UnitModel c = UnitModel.GetItem(i.ID);
|
||||||
var ObjectTID = new TypeAndID(RootObjectTypes.UnitModel, c.ID);
|
var ObjectTID = new TypeAndID(RootObjectTypes.UnitModel, c.ID);
|
||||||
@@ -1976,7 +1982,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
{
|
{
|
||||||
if (!progress.KeepGoing) return;
|
if (!progress.KeepGoing) return;
|
||||||
List<string> tags = new List<string>();
|
List<string> tags = new List<string>();
|
||||||
tags.Add(ImportTag);
|
AddImportTag(tags);
|
||||||
|
|
||||||
Vendor c = Vendor.GetItem(i.ID);
|
Vendor c = Vendor.GetItem(i.ID);
|
||||||
var ObjectTID = new TypeAndID(RootObjectTypes.Vendor, c.ID);
|
var ObjectTID = new TypeAndID(RootObjectTypes.Vendor, c.ID);
|
||||||
@@ -2092,7 +2098,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
{
|
{
|
||||||
if (!progress.KeepGoing) return;
|
if (!progress.KeepGoing) return;
|
||||||
List<string> tags = new List<string>();
|
List<string> tags = new List<string>();
|
||||||
tags.Add(ImportTag);
|
AddImportTag(tags);
|
||||||
|
|
||||||
dynamic d = new JObject();
|
dynamic d = new JObject();
|
||||||
d.name = GetUniqueName(i.Name);
|
d.name = GetUniqueName(i.Name);
|
||||||
@@ -2157,7 +2163,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
{
|
{
|
||||||
if (!progress.KeepGoing) return;
|
if (!progress.KeepGoing) return;
|
||||||
List<string> tags = new List<string>();
|
List<string> tags = new List<string>();
|
||||||
tags.Add(ImportTag);
|
AddImportTag(tags);
|
||||||
|
|
||||||
dynamic d = new JObject();
|
dynamic d = new JObject();
|
||||||
d.name = GetUniqueName(i.Name);
|
d.name = GetUniqueName(i.Name);
|
||||||
@@ -2195,7 +2201,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
var ObjectTypeName = "Memo";
|
var ObjectTypeName = "Memo";
|
||||||
progress.Append("Exporting all " + " " + ObjectTypeName + "s");
|
progress.Append("Exporting all " + " " + ObjectTypeName + "s");
|
||||||
List<string> tags = new List<string>();
|
List<string> tags = new List<string>();
|
||||||
tags.Add(ImportTag);
|
AddImportTag(tags);
|
||||||
|
|
||||||
//Get all user id's then get all memo id's for each user id then fetch each memo and finally export
|
//Get all user id's then get all memo id's for each user id then fetch each memo and finally export
|
||||||
UserPickList upl = UserPickList.GetList(false);
|
UserPickList upl = UserPickList.GetList(false);
|
||||||
@@ -2267,7 +2273,8 @@ namespace AyaNova.PlugIn.V8
|
|||||||
{
|
{
|
||||||
if (!progress.KeepGoing) return;
|
if (!progress.KeepGoing) return;
|
||||||
List<string> tags = new List<string>();
|
List<string> tags = new List<string>();
|
||||||
tags.Add(ImportTag);
|
AddImportTag(tags);
|
||||||
|
|
||||||
|
|
||||||
Workorder c = Workorder.GetItem(i.LT_O_Workorder.Value);
|
Workorder c = Workorder.GetItem(i.LT_O_Workorder.Value);
|
||||||
if (IsDuplicatev7v8IdMapItem(c.ID, c.WorkorderService.ServiceNumber.ToString(), progress)) continue;
|
if (IsDuplicatev7v8IdMapItem(c.ID, c.WorkorderService.ServiceNumber.ToString(), progress)) continue;
|
||||||
@@ -2368,7 +2375,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
{
|
{
|
||||||
if (!progress.KeepGoing) return;
|
if (!progress.KeepGoing) return;
|
||||||
List<string> tags = new List<string>();
|
List<string> tags = new List<string>();
|
||||||
tags.Add(ImportTag);
|
AddImportTag(tags);
|
||||||
|
|
||||||
Workorder c = Workorder.GetItem(i.LT_O_WorkorderQuote.Value);
|
Workorder c = Workorder.GetItem(i.LT_O_WorkorderQuote.Value);
|
||||||
if (IsDuplicatev7v8IdMapItem(c.ID, c.WorkorderQuote.QuoteNumber.ToString(), progress)) continue;
|
if (IsDuplicatev7v8IdMapItem(c.ID, c.WorkorderQuote.QuoteNumber.ToString(), progress)) continue;
|
||||||
@@ -2448,7 +2455,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
{
|
{
|
||||||
if (!progress.KeepGoing) return;
|
if (!progress.KeepGoing) return;
|
||||||
List<string> tags = new List<string>();
|
List<string> tags = new List<string>();
|
||||||
tags.Add(ImportTag);
|
AddImportTag(tags);
|
||||||
|
|
||||||
Workorder c = Workorder.GetItem(i.LT_O_WorkorderPreventiveMaintenance.Value);
|
Workorder c = Workorder.GetItem(i.LT_O_WorkorderPreventiveMaintenance.Value);
|
||||||
if (IsDuplicatev7v8IdMapItem(c.ID, c.WorkorderPreventiveMaintenance.PreventiveMaintenanceNumber.ToString(), progress)) continue;
|
if (IsDuplicatev7v8IdMapItem(c.ID, c.WorkorderPreventiveMaintenance.PreventiveMaintenanceNumber.ToString(), progress)) continue;
|
||||||
@@ -2532,7 +2539,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
if (c.IsFollowUp)
|
if (c.IsFollowUp)
|
||||||
{
|
{
|
||||||
List<string> tags = new List<string>();
|
List<string> tags = new List<string>();
|
||||||
tags.Add(ImportTag);
|
AddImportTag(tags);
|
||||||
dynamic d = new JObject();
|
dynamic d = new JObject();
|
||||||
|
|
||||||
//It's a Review / followup tied to another object that should have already been migrated
|
//It's a Review / followup tied to another object that should have already been migrated
|
||||||
@@ -2610,7 +2617,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
foreach (Guid gUserId in c.ScheduleableUsersMarkerAppliesTo)
|
foreach (Guid gUserId in c.ScheduleableUsersMarkerAppliesTo)
|
||||||
{
|
{
|
||||||
List<string> tags = new List<string>();
|
List<string> tags = new List<string>();
|
||||||
tags.Add(ImportTag);
|
AddImportTag(tags);
|
||||||
dynamic d = new JObject();
|
dynamic d = new JObject();
|
||||||
if (!V7ToV8IdMap.ContainsKey(gUserId))
|
if (!V7ToV8IdMap.ContainsKey(gUserId))
|
||||||
{
|
{
|
||||||
@@ -2743,7 +2750,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
{
|
{
|
||||||
if (!progress.KeepGoing) return;
|
if (!progress.KeepGoing) return;
|
||||||
List<string> tags = new List<string>();
|
List<string> tags = new List<string>();
|
||||||
tags.Add(ImportTag);
|
AddImportTag(tags);
|
||||||
|
|
||||||
ClientServiceRequest c = ClientServiceRequest.GetItem(i.LT_O_ClientServiceRequest.Value);
|
ClientServiceRequest c = ClientServiceRequest.GetItem(i.LT_O_ClientServiceRequest.Value);
|
||||||
var ObjectTID = new TypeAndID(RootObjectTypes.ClientServiceRequest, c.ID);
|
var ObjectTID = new TypeAndID(RootObjectTypes.ClientServiceRequest, c.ID);
|
||||||
|
|||||||
Reference in New Issue
Block a user