public PersonDocument GetTransformedDocument(ContactPayload payload, List <SyncFeedEntryLink> links) { PersonDocument person = new PersonDocument(); contacttype contact = payload.Contacttype; if (String.IsNullOrEmpty(payload.LocalID)) { person.CrmId = payload.SyncUuid.ToString();// person.Id = GetLocalId(payload.SyncUuid); } else { person.Id = payload.LocalID; } person.firstname.Value = contact.firstName; person.lastname.Value = contact.familyName; person.middlename.Value = contact.middleName; person.fullname.Value = contact.fullName; if (!String.IsNullOrEmpty(person.Id)) { person.primaryperson.Value = "true"; } else { person.primaryperson.Value = contact.primacyIndicator.ToString(); } person.salutation.Value = contact.salutation; person.suffix.Value = contact.suffix; person.title.Value = contact.title; return(person); }
public ContactPayload GetTransformedPayload(PersonDocument document, out List <SyncFeedEntryLink> links) { contacttype contact = new contacttype(); ContactPayload payload = new ContactPayload(); links = new List <SyncFeedEntryLink>(); contact.uuid = GetUuid(document.Id, document.CrmId).ToString(); contact.applicationID = document.Id; payload.SyncUuid = StringToGuid(contact.uuid); payload.LocalID = document.Id; SyncFeedEntryLink selfLink = SyncFeedEntryLink.CreateSelfLink(String.Format("{0}{1}('{2}')", _datasetLink, SupportedResourceKinds.contacts, document.Id)); links.Add(selfLink); contact.familyName = (document.lastname.IsNull) ? null : document.lastname.Value.ToString(); contact.firstName = (document.firstname.IsNull) ? null : document.firstname.Value.ToString(); contact.middleName = (document.middlename.IsNull) ? null : document.middlename.Value.ToString(); contact.salutation = (document.salutation.IsNull) ? null : document.salutation.Value.ToString(); contact.suffix = (document.suffix.IsNull) ? null : document.suffix.Value.ToString(); contact.title = (document.title.IsNull) ? null : document.title.Value.ToString(); contact.fullName = (document.fullname.IsNull) ? null : document.fullname.Value.ToString(); if ((!document.primaryperson.IsNull) && (document.primaryperson.Value.ToString().Equals("true", StringComparison.InvariantCultureIgnoreCase))) { contact.primacyIndicator = true; } payload.Contacttype = contact; return(payload); }
public static void addContact(bool student, contacttype type, string phone) { if (student) { Navigate.RandomStudent(); CustomControls.click("//*[@id=\"tab-profile\"]/div[2]/div/ul/li[1]/a", propertytype.XPath); CustomControls.click("//*[@id=\"btn-contact\"]", propertytype.XPath); } else { Navigate.RandomEmployee(); CustomControls.click("//*[@id=\"li-contacts\"]", propertytype.XPath); CustomControls.click("//*[@id=\"btn-contact\"]", propertytype.XPath); } Wait.ImplicitWait(5); CustomControls.click("//*[@id=\"contact-type\"]", propertytype.XPath); Wait.ImplicitWait(5); CustomControls.Selectdropdown("//*[@id=\"contact-type\"]", Enum.GetName(typeof(contacttype), type), propertytype.XPath); Wait.ImplicitWait(5); CustomControls.Entertext("//*[@id=\"contact-type-value\"]", phone, propertytype.XPath); Wait.ImplicitWait(5); CustomControls.click("//*[@id=\"save-close-button\"]", propertytype.XPath); Wait.ImplicitWait(5); CustomControls.click("//*[@id=\"appbody\"]/div[6]/div[7]/button[2]", propertytype.XPath); Wait.ImplicitWait(5); }