This commit is contained in:
2020-04-28 15:48:20 +00:00
parent d5d77c6ae5
commit f761a56624

View File

@@ -360,6 +360,9 @@ namespace AyaNova.PlugIn.V8
progress.Append("Dumping " + pl.Count.ToString() + " Users");
foreach (UserPickList.UserPickListInfo i in pl)
{
List<string> tags = new List<string>();
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<string> 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<string> standardExcludePropertiesList
{
get
{
return new List<string>()
{
"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<string> standardExcludePropertiesList
//{
// get
// {
// return new List<string>()
// {
// "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