From f761a56624132abc25e36e1db922f9775d2919f7 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 28 Apr 2020 15:48:20 +0000 Subject: [PATCH] --- source/Plugins/AyaNova.Plugin.V8/V8.cs | 128 +++++++++++++++---------- 1 file changed, 75 insertions(+), 53 deletions(-) diff --git a/source/Plugins/AyaNova.Plugin.V8/V8.cs b/source/Plugins/AyaNova.Plugin.V8/V8.cs index 104bc3c..1deba62 100644 --- a/source/Plugins/AyaNova.Plugin.V8/V8.cs +++ b/source/Plugins/AyaNova.Plugin.V8/V8.cs @@ -360,6 +360,9 @@ namespace AyaNova.PlugIn.V8 progress.Append("Dumping " + pl.Count.ToString() + " Users"); foreach (UserPickList.UserPickListInfo i in pl) { + List tags = new List(); + tags.Add(ImportTag); + //skip administrator if (i.ID == User.AdministratorID) continue; @@ -370,6 +373,16 @@ namespace AyaNova.PlugIn.V8 if (c.VendorID != Guid.Empty) d.userType = 7;//7 is the RAVEN user type for subcontractor + d.active = false;//all imported users are inactive to start + d.employeeNumber = c.EmployeeNumber; + d.notes = c.Notes; + if (c.RegionID != Guid.Empty) + { + var t = TagMap[c.RegionID]; + if (TagMap.ContainsKey() { + } + } + //JObject xtra = new JObject(); //xtra.Add("hexaScheduleBackColor", System.Drawing.ColorTranslator.ToHtml(System.Drawing.Color.FromArgb(c.ScheduleBackColor))); @@ -625,68 +638,77 @@ namespace AyaNova.PlugIn.V8 #endregion dump #region Utility methods - - private static string EnsureValidFileName(string fileName) + private void AddTagIfExists(Guid g, List tags) { - //make lower and replace spaces with dashes - fileName = fileName.ToLowerInvariant().Replace(" ", "-"); - - //ensure each character is a valid path character - foreach (char c in System.IO.Path.GetInvalidFileNameChars()) + var t = TagMap[g]; + if (!string.IsNullOrWhiteSpace(t)) { - fileName = fileName.Replace(c, '_'); + tags.Add(t); } - return fileName; + } + //private static string EnsureValidFileName(string fileName) + //{ + // //make lower and replace spaces with dashes + // fileName = fileName.ToLowerInvariant().Replace(" ", "-"); + + // //ensure each character is a valid path character + // foreach (char c in System.IO.Path.GetInvalidFileNameChars()) + // { + // fileName = fileName.Replace(c, '_'); + // } + // return fileName; + //} - private static void makeFolderIfNotExist(string fldr, bool shouldNotExist = false) - { - if (Directory.Exists(fldr)) - { - if (shouldNotExist) - throw new System.Exception("Error: path already exists and shouldn't:\r\n" + fldr); - return; - } - Directory.CreateDirectory(fldr); - } - private List standardExcludePropertiesList - { - get - { - return new List() - { - "CanWiki", - "CanDuplicate", - "IsValid", - "IsDirty", - "CurrentUserID", - "IsEditing", - "IsNew", - "IsDeleted", - "IsSavable", - "Notify", - "BrokenRulesText", - "Docs", - "MapQuestURL", - "FullAddress" - //"XXX", - //"XXX", - //"XXX", - //"XXX", - //"XXX", - //"XXX", - //"XXX", - //"XXX", - //"XXX", - //"XXX", - //"XXX" - }; + //private static void makeFolderIfNotExist(string fldr, bool shouldNotExist = false) + //{ + // if (Directory.Exists(fldr)) + // { + // if (shouldNotExist) + // throw new System.Exception("Error: path already exists and shouldn't:\r\n" + fldr); + // return; + // } + // Directory.CreateDirectory(fldr); + //} - } - } + //private List standardExcludePropertiesList + //{ + // get + // { + // return new List() + // { + // "CanWiki", + // "CanDuplicate", + // "IsValid", + // "IsDirty", + // "CurrentUserID", + // "IsEditing", + // "IsNew", + // "IsDeleted", + // "IsSavable", + // "Notify", + // "BrokenRulesText", + // "Docs", + // "MapQuestURL", + // "FullAddress" + // //"XXX", + // //"XXX", + // //"XXX", + // //"XXX", + // //"XXX", + // //"XXX", + // //"XXX", + // //"XXX", + // //"XXX", + // //"XXX", + // //"XXX" + // }; + + // } + //} #endregion #region contract resolver