|
|
|
|
@@ -94,46 +94,46 @@ namespace AyaNova.Biz
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
//FIRST: import items that will become tags first into temporary cache lists
|
|
|
|
|
Dictionary<string,Dictionary<Guid,string>> tagLists=new Dictionary<string, Dictionary<Guid, string>>();
|
|
|
|
|
Dictionary<string,Dictionary<Guid,string>> TagLists=new Dictionary<string, Dictionary<Guid, string>>();
|
|
|
|
|
|
|
|
|
|
//IMPORT UNIT MODEL CATEGORIES AS TAGS
|
|
|
|
|
tagLists.Add("UnitModelCategory",new Dictionary<Guid, string>());
|
|
|
|
|
ImportTagList("GZTW.AyaNova.BLL.UnitModelCategory", job.GId, tagLists["UnitModelCategory"], importFileName, zipEntries);
|
|
|
|
|
TagLists.Add("UnitModelCategory",new Dictionary<Guid, string>());
|
|
|
|
|
ImportTagList("GZTW.AyaNova.BLL.UnitModelCategory", job.GId, TagLists["UnitModelCategory"], importFileName, zipEntries);
|
|
|
|
|
|
|
|
|
|
//IMPORT Unit service type AS TAGS
|
|
|
|
|
tagLists.Add("UnitServiceType",new Dictionary<Guid, string>());
|
|
|
|
|
ImportTagList("GZTW.AyaNova.BLL.UnitServiceType", job.GId, tagLists["UnitServiceType"], importFileName, zipEntries);
|
|
|
|
|
TagLists.Add("UnitServiceType",new Dictionary<Guid, string>());
|
|
|
|
|
ImportTagList("GZTW.AyaNova.BLL.UnitServiceType", job.GId, TagLists["UnitServiceType"], importFileName, zipEntries);
|
|
|
|
|
|
|
|
|
|
//IMPORT Workorder Item Type AS TAGS
|
|
|
|
|
tagLists.Add("WorkorderItemType",new Dictionary<Guid, string>());
|
|
|
|
|
ImportTagList("GZTW.AyaNova.BLL.WorkorderItemType", job.GId, tagLists["WorkorderItemType"], importFileName, zipEntries);
|
|
|
|
|
TagLists.Add("WorkorderItemType",new Dictionary<Guid, string>());
|
|
|
|
|
ImportTagList("GZTW.AyaNova.BLL.WorkorderItemType", job.GId, TagLists["WorkorderItemType"], importFileName, zipEntries);
|
|
|
|
|
|
|
|
|
|
//IMPORT Client group AS TAGS
|
|
|
|
|
tagLists.Add("ClientGroup",new Dictionary<Guid, string>());
|
|
|
|
|
ImportTagList("GZTW.AyaNova.BLL.ClientGroup", job.GId, tagLists["ClientGroup"], importFileName, zipEntries);
|
|
|
|
|
TagLists.Add("ClientGroup",new Dictionary<Guid, string>());
|
|
|
|
|
ImportTagList("GZTW.AyaNova.BLL.ClientGroup", job.GId, TagLists["ClientGroup"], importFileName, zipEntries);
|
|
|
|
|
|
|
|
|
|
//IMPORT Workorder category AS TAGS
|
|
|
|
|
tagLists.Add("WorkorderCategory",new Dictionary<Guid, string>());
|
|
|
|
|
ImportTagList("GZTW.AyaNova.BLL.WorkorderCategory", job.GId, tagLists["WorkorderCategory"], importFileName, zipEntries);
|
|
|
|
|
TagLists.Add("WorkorderCategory",new Dictionary<Guid, string>());
|
|
|
|
|
ImportTagList("GZTW.AyaNova.BLL.WorkorderCategory", job.GId, TagLists["WorkorderCategory"], importFileName, zipEntries);
|
|
|
|
|
|
|
|
|
|
//IMPORT Part Category AS TAGS
|
|
|
|
|
tagLists.Add("PartCategory",new Dictionary<Guid, string>());
|
|
|
|
|
ImportTagList("GZTW.AyaNova.BLL.PartCategory", job.GId, tagLists["PartCategory"], importFileName, zipEntries);
|
|
|
|
|
TagLists.Add("PartCategory",new Dictionary<Guid, string>());
|
|
|
|
|
ImportTagList("GZTW.AyaNova.BLL.PartCategory", job.GId, TagLists["PartCategory"], importFileName, zipEntries);
|
|
|
|
|
|
|
|
|
|
//IMPORT Dispatch zones AS TAGS
|
|
|
|
|
tagLists.Add("DispatchZone",new Dictionary<Guid, string>());
|
|
|
|
|
ImportTagList("GZTW.AyaNova.BLL.DispatchZone", job.GId, tagLists["DispatchZone"], importFileName, zipEntries);
|
|
|
|
|
TagLists.Add("DispatchZone",new Dictionary<Guid, string>());
|
|
|
|
|
ImportTagList("GZTW.AyaNova.BLL.DispatchZone", job.GId, TagLists["DispatchZone"], importFileName, zipEntries);
|
|
|
|
|
|
|
|
|
|
//IMPORT Scheduleable User Groups AS TAGS
|
|
|
|
|
tagLists.Add("ScheduleableUserGroup",new Dictionary<Guid, string>());
|
|
|
|
|
ImportTagList("GZTW.AyaNova.BLL.ScheduleableUserGroup", job.GId, tagLists["ScheduleableUserGroup"], importFileName, zipEntries);
|
|
|
|
|
TagLists.Add("ScheduleableUserGroup",new Dictionary<Guid, string>());
|
|
|
|
|
ImportTagList("GZTW.AyaNova.BLL.ScheduleableUserGroup", job.GId, TagLists["ScheduleableUserGroup"], importFileName, zipEntries);
|
|
|
|
|
|
|
|
|
|
//Now can set users to correct tag for scheduleable user group
|
|
|
|
|
// await ImportTagList("GZTW.AyaNova.BLL.ScheduleableUserGroup", "scheduleableusergrouptags", AyaType.Tag, job.GId, importMap, importFileName, zipEntries);
|
|
|
|
|
|
|
|
|
|
//IMPORT REGIONS AS TAGS
|
|
|
|
|
tagLists.Add("Region",new Dictionary<Guid, string>());
|
|
|
|
|
ImportTagList("GZTW.AyaNova.BLL.Region", job.GId, tagLists["Region"], importFileName, zipEntries);
|
|
|
|
|
TagLists.Add("Region",new Dictionary<Guid, string>());
|
|
|
|
|
ImportTagList("GZTW.AyaNova.BLL.Region", job.GId, TagLists["Region"], importFileName, zipEntries);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -142,16 +142,16 @@ namespace AyaNova.Biz
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
//USERS
|
|
|
|
|
await DoImport("GZTW.AyaNova.BLL.User", "main", AyaType.User, job.GId, importMap, importFileName, zipEntries);
|
|
|
|
|
await DoImport("GZTW.AyaNova.BLL.User", "main", AyaType.User, job.GId, importMap, importFileName, zipEntries, TagLists);
|
|
|
|
|
//Now can do event log entries
|
|
|
|
|
await DoImport("GZTW.AyaNova.BLL.User", "eventlog", AyaType.User, job.GId, importMap, importFileName, zipEntries);
|
|
|
|
|
await DoImport("GZTW.AyaNova.BLL.User", "eventlog", AyaType.User, job.GId, importMap, importFileName, zipEntries, TagLists);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//IMPORT LOCALES
|
|
|
|
|
await DoImport("GZTW.AyaNova.BLL.Locale", "main", AyaType.Locale, job.GId, importMap, importFileName, zipEntries);
|
|
|
|
|
await DoImport("GZTW.AyaNova.BLL.Locale", "main", AyaType.Locale, job.GId, importMap, importFileName, zipEntries, TagLists);
|
|
|
|
|
//Now can do user locale settings properly
|
|
|
|
|
await DoImport("GZTW.AyaNova.BLL.User", "locale", AyaType.User, job.GId, importMap, importFileName, zipEntries);
|
|
|
|
|
await DoImport("GZTW.AyaNova.BLL.User", "locale", AyaType.User, job.GId, importMap, importFileName, zipEntries, TagLists);
|
|
|
|
|
|
|
|
|
|
//TODO: CLIENT
|
|
|
|
|
//do import for client here
|
|
|
|
|
@@ -185,8 +185,10 @@ namespace AyaNova.Biz
|
|
|
|
|
/// <param name="importMap"></param>
|
|
|
|
|
/// <param name="importFileName"></param>
|
|
|
|
|
/// <param name="zipEntries"></param>
|
|
|
|
|
/// <param name="tagLists"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
private async Task DoImport(string entryStartsWith, string importTask, AyaType importerType, Guid jobId, List<ImportAyaNova7MapItem> importMap, string importFileName, List<string> zipEntries)
|
|
|
|
|
private async Task DoImport(string entryStartsWith, string importTask, AyaType importerType, Guid jobId,
|
|
|
|
|
List<ImportAyaNova7MapItem> importMap, string importFileName, List<string> zipEntries, Dictionary<string, Dictionary<Guid, string>> tagLists)
|
|
|
|
|
{
|
|
|
|
|
var zipObjectList = zipEntries.Where(m => m.StartsWith(entryStartsWith)).ToList();
|
|
|
|
|
long importCount = 0;
|
|
|
|
|
@@ -215,7 +217,7 @@ namespace AyaNova.Biz
|
|
|
|
|
j.Add("V7_TYPE", JToken.FromObject(entryStartsWith));
|
|
|
|
|
j.Add("IMPORT_TASK", JToken.FromObject(importTask));
|
|
|
|
|
|
|
|
|
|
bImportSucceeded = await o.ImportV7Async(j, importMap, jobId);
|
|
|
|
|
bImportSucceeded = await o.ImportV7Async(j, importMap, jobId, tagLists);
|
|
|
|
|
if (bImportSucceeded)
|
|
|
|
|
importCount++;
|
|
|
|
|
else
|
|
|
|
|
|