This commit is contained in:
@@ -739,54 +739,37 @@ namespace AyaNova.PlugIn.V8
|
|||||||
//create user here
|
//create user here
|
||||||
//--------------------------------
|
//--------------------------------
|
||||||
|
|
||||||
d = new JObject();
|
d = new JObject();
|
||||||
d.name = GetUniqueName(c.Contact);
|
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();
|
|
||||||
|
|
||||||
|
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; }
|
|
||||||
|
|
||||||
//-------------
|
var rContact = await util.PostAsync("user", d.ToString());
|
||||||
//[EmailAddress]
|
long RavenContactId = util.IdFromResponse(rContact);
|
||||||
public string EmailAddress { get; set; }
|
|
||||||
// [Phone]
|
|
||||||
public string Phone1 { get; set; }
|
//USER OPTIONS
|
||||||
//[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 rOptions = await util.GetAsync("user-option/" + RavenContactId.ToString());
|
var rOptions = await util.GetAsync("user-option/" + RavenContactId.ToString());
|
||||||
d = rOptions.ObjectResponse["data"];
|
d = rOptions.ObjectResponse["data"];
|
||||||
d.phone1 = c.Phone1;
|
d.phone1 = c.Phone1;
|
||||||
d.phone2 = c.Phone2;
|
d.phone2 = c.Phone2;
|
||||||
d.phone3 = c.Phone3;
|
d.phone3 = c.Phone3;
|
||||||
|
|
||||||
d.emailAddress = c.Email;
|
|
||||||
|
|
||||||
|
d.emailAddress = c.Email;
|
||||||
if (LocaleMap.ContainsKey(c.DefaultLanguage))
|
|
||||||
d.translationId = LocaleMap[c.DefaultLanguage];
|
|
||||||
else
|
// d.translationId = 1;
|
||||||
d.translationId = 1;
|
|
||||||
|
|
||||||
await util.PutAsync("user-option/" + RavenContactId.ToString(), d.ToString());
|
await util.PutAsync("user-option/" + RavenContactId.ToString(), d.ToString());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------
|
//----------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user