This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -418,7 +418,8 @@ namespace AyaNova.Biz
|
|||||||
//Copy values
|
//Copy values
|
||||||
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>();
|
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
|
//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>());
|
var VendorId = new Guid(j["VendorID"].Value<string>());
|
||||||
@@ -431,6 +432,11 @@ namespace AyaNova.Biz
|
|||||||
i.EmployeeNumber = j["EmployeeNumber"].Value<string>();
|
i.EmployeeNumber = j["EmployeeNumber"].Value<string>();
|
||||||
i.Notes = j["Notes"].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);
|
User o = await CreateAsync(i);
|
||||||
if (HasErrors)
|
if (HasErrors)
|
||||||
{
|
{
|
||||||
@@ -520,19 +526,19 @@ namespace AyaNova.Biz
|
|||||||
case "GZTW.AyaNova.BLL.User-scheduleableusergrouptags":
|
case "GZTW.AyaNova.BLL.User-scheduleableusergrouptags":
|
||||||
{
|
{
|
||||||
//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();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "GZTW.AyaNova.BLL.User-client":
|
case "GZTW.AyaNova.BLL.User-client":
|
||||||
{
|
{
|
||||||
//handle setting client id for user client login
|
//handle setting client id for user client login
|
||||||
//throw new System.NotImplementedException();
|
//throw new System.NotImplementedException();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "GZTW.AyaNova.BLL.User-headoffice":
|
case "GZTW.AyaNova.BLL.User-headoffice":
|
||||||
{
|
{
|
||||||
//handle setting ho id for user headoffice login
|
//handle setting ho id for user headoffice login
|
||||||
//throw new System.NotImplementedException();
|
//throw new System.NotImplementedException();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,22 +16,7 @@ namespace AyaNova.Util
|
|||||||
|
|
||||||
public enum SeedLevel { SmallOneManShopTrialDataSet, MediumLocalServiceCompanyTrialDataSet, LargeCorporateMultiRegionalTrialDataSet };
|
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
|
//Seed database for trial and testing purposes
|
||||||
//
|
//
|
||||||
|
|||||||
Reference in New Issue
Block a user