This commit is contained in:
2018-08-31 14:45:45 +00:00
parent 687d558b37
commit 4a03db5277
3 changed files with 18 additions and 22 deletions

View File

@@ -69,4 +69,9 @@ IMPORTMAP
NOTES FOR DOCS
- Only an empty database is supported for import
- Only one shot import, can't import again later
- User's login and passwords are not imported and need to be setup again after import
- Many objects are imported as tags:
- List of objects

View File

@@ -418,7 +418,8 @@ namespace AyaNova.Biz
//Copy values
User i = new User();
i.Name = j["FirstName"].Value<string>() + " " + j["LastName"].Value<string>();
i.UserType = j["UserType"].Value<UserType>();
var Temp = j["UserType"].Value<int>();
i.UserType = (UserType)Temp;
//If there is a vendorId set then this user is actually a subcontractor in v7 so set accordingly
var VendorId = new Guid(j["VendorID"].Value<string>());
@@ -431,6 +432,11 @@ namespace AyaNova.Biz
i.EmployeeNumber = j["EmployeeNumber"].Value<string>();
i.Notes = j["Notes"].Value<string>();
//Set unusable random login credentials
i.Salt = Hasher.GenerateSalt();
i.Login = Hasher.GenerateSalt();
i.Password = Hasher.hash(i.Salt, Hasher.GenerateSalt());
User o = await CreateAsync(i);
if (HasErrors)
{
@@ -520,19 +526,19 @@ namespace AyaNova.Biz
case "GZTW.AyaNova.BLL.User-scheduleableusergrouptags":
{
//handle tag entries for users now that we have the SUG tags created
// throw new System.NotImplementedException();
// throw new System.NotImplementedException();
}
break;
break;
case "GZTW.AyaNova.BLL.User-client":
{
//handle setting client id for user client login
//throw new System.NotImplementedException();
}
break;
break;
case "GZTW.AyaNova.BLL.User-headoffice":
{
//handle setting ho id for user headoffice login
//throw new System.NotImplementedException();
//throw new System.NotImplementedException();
}
break;
}

View File

@@ -16,22 +16,7 @@ namespace AyaNova.Util
public enum SeedLevel { SmallOneManShopTrialDataSet, MediumLocalServiceCompanyTrialDataSet, LargeCorporateMultiRegionalTrialDataSet };
// //////////////////////////////////////////////////////
// //Seed database with default manager account
// //
// public static User GenerateDefaultManagerAccountUser()
// {
// User u = new User();
// u.Name = "AyaNova Administrator";
// u.Salt = Hasher.GenerateSalt();
// u.Login = "manager";
// u.Password = Hasher.hash(u.Salt, "l3tm3in");
// u.Roles = AuthorizationRoles.BizAdminFull | AuthorizationRoles.OpsAdminFull | AuthorizationRoles.DispatchFull | AuthorizationRoles.InventoryFull;
// u.OwnerId = 1;
// return u;
// }
//////////////////////////////////////////////////////
//Seed database for trial and testing purposes
//