This commit is contained in:
@@ -137,6 +137,7 @@ namespace AyaNova.Api.Controllers
|
|||||||
await ct.SaveChangesAsync();
|
await ct.SaveChangesAsync();
|
||||||
|
|
||||||
//BIZLOG: Not going to log this for now, it's too common an operation and would require bringing in more info. If decide to implement should log the parent object with text of tag instead
|
//BIZLOG: Not going to log this for now, it's too common an operation and would require bringing in more info. If decide to implement should log the parent object with text of tag instead
|
||||||
|
//and don't forget about import from v7 as well
|
||||||
|
|
||||||
return CreatedAtAction("GetTagMap", new { id = o.Id }, new ApiCreatedResponse(o));
|
return CreatedAtAction("GetTagMap", new { id = o.Id }, new ApiCreatedResponse(o));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -258,6 +258,11 @@ namespace AyaNova.Biz
|
|||||||
case "GZTW.AyaNova.BLL.DispatchZone":
|
case "GZTW.AyaNova.BLL.DispatchZone":
|
||||||
case "GZTW.AyaNova.BLL.ScheduleableUserGroup":
|
case "GZTW.AyaNova.BLL.ScheduleableUserGroup":
|
||||||
{
|
{
|
||||||
|
switch (j["IMPORT_TASK"].Value<string>())
|
||||||
|
{
|
||||||
|
case "main":
|
||||||
|
{
|
||||||
|
#region main import task
|
||||||
var NewTagName = j["Name"].Value<string>();
|
var NewTagName = j["Name"].Value<string>();
|
||||||
|
|
||||||
var ShortTypeName = string.Empty;
|
var ShortTypeName = string.Empty;
|
||||||
@@ -330,17 +335,79 @@ namespace AyaNova.Biz
|
|||||||
await ImportAyaNova7Biz.LogEventCreatedModifiedEvents(j, importMap, AyaType.Tag, ct);
|
await ImportAyaNova7Biz.LogEventCreatedModifiedEvents(j, importMap, AyaType.Tag, ct);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "scheduleableusergrouptags":
|
case "scheduleableusergrouptags":
|
||||||
{
|
{
|
||||||
|
#region attribute sched user group tags
|
||||||
|
/*
|
||||||
|
{
|
||||||
|
"ID": "871e77b2-979a-4f26-930b-46f7c05fc19f",
|
||||||
|
"Created": "08/30/2018 08:12 AM",
|
||||||
|
"Modified": "08/30/2018 08:13 AM",
|
||||||
|
"Creator": "2ecc77fc-69e2-4a7e-b88d-bd0ecaf36aed",
|
||||||
|
"Modifier": "2ecc77fc-69e2-4a7e-b88d-bd0ecaf36aed",
|
||||||
|
"Name": "Yet another test group",
|
||||||
|
"Active": true,
|
||||||
|
"Description": "More testing yay!",
|
||||||
|
"ScheduleableUsers": [
|
||||||
|
{
|
||||||
|
"Created": "08/30/2018 08:13 AM",
|
||||||
|
"Creator": "2ecc77fc-69e2-4a7e-b88d-bd0ecaf36aed",
|
||||||
|
"Modified": "08/30/2018 08:13 AM",
|
||||||
|
"Modifier": "2ecc77fc-69e2-4a7e-b88d-bd0ecaf36aed",
|
||||||
|
"ID": "676475be-8301-47d0-bd54-af9dbd1fe7eb",
|
||||||
|
"ScheduleableUserID": "1d859264-3f32-462a-9b0c-a67dddfdf4d3",
|
||||||
|
"ScheduleableUserGroupID": "871e77b2-979a-4f26-930b-46f7c05fc19f"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Created": "08/30/2018 08:13 AM",
|
||||||
|
"Creator": "2ecc77fc-69e2-4a7e-b88d-bd0ecaf36aed",
|
||||||
|
"Modified": "08/30/2018 08:13 AM",
|
||||||
|
"Modifier": "2ecc77fc-69e2-4a7e-b88d-bd0ecaf36aed",
|
||||||
|
"ID": "173499c3-a616-42a0-b08c-74008f8fa352",
|
||||||
|
"ScheduleableUserID": "42b282bb-100b-4b31-aa14-5c831d7cda66",
|
||||||
|
"ScheduleableUserGroupID": "871e77b2-979a-4f26-930b-46f7c05fc19f"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Created": "08/30/2018 08:13 AM",
|
||||||
|
"Creator": "2ecc77fc-69e2-4a7e-b88d-bd0ecaf36aed",
|
||||||
|
"Modified": "08/30/2018 08:13 AM",
|
||||||
|
"Modifier": "2ecc77fc-69e2-4a7e-b88d-bd0ecaf36aed",
|
||||||
|
"ID": "19c9b3d6-eeb2-44ac-be4e-6ec93d15b02a",
|
||||||
|
"ScheduleableUserID": "e6ff9bc6-a550-4242-8c41-857f740e2841",
|
||||||
|
"ScheduleableUserGroupID": "871e77b2-979a-4f26-930b-46f7c05fc19f"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
*/
|
||||||
var V7Id = new Guid(j["ID"].Value<string>());
|
var V7Id = new Guid(j["ID"].Value<string>());
|
||||||
var RavenId = importMap.Where(m => m.V7ObjectId == V7Id).First().NewObjectAyaTypeId.ObjectId;
|
var RavenTagId = importMap.Where(m => m.V7ObjectId == V7Id).First().NewObjectAyaTypeId.ObjectId;
|
||||||
|
|
||||||
|
foreach (JToken t in j["ScheduleableUsers"])
|
||||||
|
{
|
||||||
|
var techId = new Guid(t["ScheduleableUserID"].Value<String>());
|
||||||
|
var RavenUserId = importMap.Where(m => m.V7ObjectId == techId).First().NewObjectAyaTypeId.ObjectId;
|
||||||
|
var Creator = importMap.Where(m => m.V7ObjectId == new Guid(t["Creator"].Value<string>())).First().NewObjectAyaTypeId.ObjectId;
|
||||||
|
|
||||||
|
TagMap tm = new TagMap();
|
||||||
|
tm.TagToObjectId = RavenUserId;
|
||||||
|
tm.TagId = RavenTagId;
|
||||||
|
tm.OwnerId = Creator;
|
||||||
|
ct.TagMap.Add(tm);
|
||||||
|
}
|
||||||
|
ct.SaveChanges();
|
||||||
//handle tag entries for users now that we have the SUG tags created
|
//handle tag entries for users now that we have the SUG tags created
|
||||||
// throw new System.NotImplementedException();
|
// throw new System.NotImplementedException();
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user