This commit is contained in:
2020-11-25 21:44:14 +00:00
parent 480b382802
commit 1c361fa66d

View File

@@ -739,54 +739,37 @@ namespace AyaNova.PlugIn.V8
//create user here
//--------------------------------
d = new JObject();
d.name = GetUniqueName(c.Contact);
progress.Op("Contact " + d.name);
d.userType=RavenUserType.Customer;
d.customerId=RavenId;
d.active = false;//all imported users are inactive to start
d.roles = 0;//todo: try to determine role from v7 member of group? or is that even possible?
d.login = util.RandomString();
d.password = util.RandomString();
d = new JObject();
d.name = GetUniqueName(c.Contact);
progress.Op("Contact " + d.name);
d.userType = RavenUserType.Customer;
d.customerId = RavenId;
d.active = false;//all imported users are inactive to start
d.roles = 0;//todo: try to determine role from v7 member of group? or is that even possible?
d.login = util.RandomString();
d.password = util.RandomString();
var rMainObject = await util.PostAsync("user", d.ToString());
long RavenContactId = util.IdFromResponse(rMainObject);
//USER OPTIONS
/*
[Required]
public long TranslationId { get; set; }
//-------------
//[EmailAddress]
public string EmailAddress { get; set; }
// [Phone]
public string Phone1 { get; set; }
//[Phone]
public string Phone2 { get; set; }
//in v7 this was pager address so not attributing it with Phone as not sure what would be in that field
public string Phone3 { get; set; }
*/
var rContact = await util.PostAsync("user", d.ToString());
long RavenContactId = util.IdFromResponse(rContact);
//USER OPTIONS
var rOptions = await util.GetAsync("user-option/" + RavenContactId.ToString());
d = rOptions.ObjectResponse["data"];
d.phone1 = c.Phone1;
d.phone2 = c.Phone2;
d.phone3 = c.Phone3;
d.emailAddress = c.Email;
d.phone1 = c.Phone1;
d.phone2 = c.Phone2;
d.phone3 = c.Phone3;
if (LocaleMap.ContainsKey(c.DefaultLanguage))
d.translationId = LocaleMap[c.DefaultLanguage];
else
d.translationId = 1;
d.emailAddress = c.Email;
// d.translationId = 1;
await util.PutAsync("user-option/" + RavenContactId.ToString(), d.ToString());
//----------------------------------