This commit is contained in:
@@ -92,6 +92,14 @@ namespace AyaNova.Biz
|
|||||||
|
|
||||||
//USERS
|
//USERS
|
||||||
await DoImport("GZTW.AyaNova.BLL.User", AyaType.User, job.GId, importMap, importFileName, zipEntries);
|
await DoImport("GZTW.AyaNova.BLL.User", AyaType.User, job.GId, importMap, importFileName, zipEntries);
|
||||||
|
//Now can do event log entries
|
||||||
|
await DoImport("GZTW.AyaNova.BLL.User-eventlog", AyaType.User, job.GId, importMap, importFileName, zipEntries);
|
||||||
|
|
||||||
|
//LOCALE HERE
|
||||||
|
//await DoImport .... blah blah for locale, then:
|
||||||
|
//Now can do user locale settings properly
|
||||||
|
//await DoImport("GZTW.AyaNova.BLL.User-locale", AyaType.User, job.GId, importMap, importFileName, zipEntries);
|
||||||
|
|
||||||
|
|
||||||
//IMPORT UNIT MODEL CATEGORIES AS TAGS
|
//IMPORT UNIT MODEL CATEGORIES AS TAGS
|
||||||
await DoImport("GZTW.AyaNova.BLL.UnitModelCategory", AyaType.Tag, job.GId, importMap, importFileName, zipEntries);
|
await DoImport("GZTW.AyaNova.BLL.UnitModelCategory", AyaType.Tag, job.GId, importMap, importFileName, zipEntries);
|
||||||
|
|||||||
@@ -376,6 +376,11 @@ namespace AyaNova.Biz
|
|||||||
/// IMPORT v7 implementation
|
/// IMPORT v7 implementation
|
||||||
public async Task<bool> ImportV7Async(JObject j, List<ImportAyaNova7MapItem> importMap, Guid jobId)
|
public async Task<bool> ImportV7Async(JObject j, List<ImportAyaNova7MapItem> importMap, Guid jobId)
|
||||||
{
|
{
|
||||||
|
//TODO: when locales are imported that's when it should take a pass over users collection and then set the correct locale accordingly
|
||||||
|
//or default if it's missing
|
||||||
|
//v7 users locale json element:
|
||||||
|
//var V7Locale=j["DefaultLanguage"].Value<string>();
|
||||||
|
|
||||||
//some types need to import from more than one source hence the seemingly redundant switch statement for futureproofing
|
//some types need to import from more than one source hence the seemingly redundant switch statement for futureproofing
|
||||||
switch (j["V7_TYPE"].Value<string>())
|
switch (j["V7_TYPE"].Value<string>())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -329,13 +329,13 @@ namespace AyaNova.Biz
|
|||||||
#region V7 record format
|
#region V7 record format
|
||||||
/*
|
/*
|
||||||
{
|
{
|
||||||
"DefaultLanguage": "Custom English",
|
TODO: "DefaultLanguage": "Custom English",
|
||||||
"DefaultServiceTemplateID": "ca83a7b8-4e5f-4a7b-a02b-9cf78d5f983f",
|
TODO: "DefaultServiceTemplateID": "ca83a7b8-4e5f-4a7b-a02b-9cf78d5f983f",
|
||||||
"UserType": 2,
|
"UserType": 2,
|
||||||
"Active": true,
|
"Active": true,
|
||||||
"ClientID": "00000000-0000-0000-0000-000000000000",
|
TODO: "ClientID": "00000000-0000-0000-0000-000000000000",
|
||||||
"HeadOfficeID": "00000000-0000-0000-0000-000000000000",
|
TODO: "HeadOfficeID": "00000000-0000-0000-0000-000000000000",
|
||||||
"MemberOfGroup": "0f8a80ff-4b03-4114-ae51-2d13b812dd65",
|
TODO: "MemberOfGroup": "0f8a80ff-4b03-4114-ae51-2d13b812dd65",
|
||||||
"Created": "03/21/2005 07:19 AM",
|
"Created": "03/21/2005 07:19 AM",
|
||||||
"Modified": "09/15/2015 12:22 PM",
|
"Modified": "09/15/2015 12:22 PM",
|
||||||
"Creator": "2ecc77fc-69e2-4a7e-b88d-bd0ecaf36aed",
|
"Creator": "2ecc77fc-69e2-4a7e-b88d-bd0ecaf36aed",
|
||||||
@@ -419,6 +419,11 @@ namespace AyaNova.Biz
|
|||||||
User i = new User();
|
User i = new User();
|
||||||
i.Name = j["FirstName"].Value<string>() + " " + j["LastName"].Value<string>();
|
i.Name = j["FirstName"].Value<string>() + " " + j["LastName"].Value<string>();
|
||||||
i.UserType = j["UserType"].Value<UserType>();
|
i.UserType = j["UserType"].Value<UserType>();
|
||||||
|
i.Active = j["Active"].Value<bool>();
|
||||||
|
|
||||||
|
//TODO: i.LocaleId
|
||||||
|
//when locales are imported that's when it should take a pass over users and set them as per here
|
||||||
|
//var V7Locale=j["DefaultLanguage"].Value<string>();
|
||||||
|
|
||||||
User o = await CreateAsync(i);
|
User o = await CreateAsync(i);
|
||||||
if (HasErrors)
|
if (HasErrors)
|
||||||
@@ -435,12 +440,26 @@ namespace AyaNova.Biz
|
|||||||
{
|
{
|
||||||
await ct.SaveChangesAsync();
|
await ct.SaveChangesAsync();
|
||||||
var mapItem = new ImportAyaNova7MapItem(V7Id, AyaType.User, o.Id);
|
var mapItem = new ImportAyaNova7MapItem(V7Id, AyaType.User, o.Id);
|
||||||
//Log
|
|
||||||
EventLogProcessor.AddEntry(new Event(userId, o.Id, AyaType.User, AyaEvent.Created), ct);
|
|
||||||
await ct.SaveChangesAsync();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case "GZTW.AyaNova.BLL.User-eventlog":
|
||||||
|
{
|
||||||
|
//handle EventLog entries for users now that we have the user's created
|
||||||
|
//Log
|
||||||
|
//EventLogProcessor.AddEntry(new Event(userId, o.Id, AyaType.User, AyaEvent.Created), ct);
|
||||||
|
//MODIFIED HERE
|
||||||
|
// await ct.SaveChangesAsync();
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "GZTW.AyaNova.BLL.User-locale":
|
||||||
|
{
|
||||||
|
//handle locale entries for users now that we have the locales created
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//just to hide compiler warning for now
|
//just to hide compiler warning for now
|
||||||
|
|||||||
Reference in New Issue
Block a user