本文整理汇总了C#中CTCT.ConstantContact.AddContact方法的典型用法代码示例。如果您正苦于以下问题:C# ConstantContact.AddContact方法的具体用法?C# ConstantContact.AddContact怎么用?C# ConstantContact.AddContact使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTCT.ConstantContact
的用法示例。
在下文中一共展示了ConstantContact.AddContact方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LiveGetContactByEmail
public void LiveGetContactByEmail()
{
var cc = new ConstantContact(ApiKey, AccessToken);
var contact = new Contact();
contact.EmailAddresses.Add(new EmailAddress { EmailAddr = String.Format("{0}@email.com", Guid.NewGuid()), ConfirmStatus = ConfirmStatus.NoConfirmationRequired, Status = Status.Active });
contact.Lists.Add(new ContactList { Id = "1", Status = Status.Active });
Contact nc = cc.AddContact(contact, false);
Assert.IsNotNull(nc);
Assert.IsNotNull(nc.Id);
var result = cc.GetContacts(nc.EmailAddresses[0].EmailAddr, 1, DateTime.Now.AddMonths(-1));
Assert.IsNotNull(result);
Assert.IsNotNull(result.Results);
Assert.AreEqual(1, result.Results.Count);
}
示例2: LiveAddContactTest
public void LiveAddContactTest()
{
var cc = new ConstantContact(ApiKey, AccessToken);
var contact = new Contact();
contact.EmailAddresses.Add(new EmailAddress { EmailAddr = String.Format("{0}@email.com", Guid.NewGuid()), ConfirmStatus = ConfirmStatus.NoConfirmationRequired, Status = Status.Active });
contact.Lists.Add(new ContactList { Id = "1", Status = Status.Active });
var nc = cc.AddContact(contact, false);
Assert.IsNotNull(nc);
Assert.IsNotNull(nc.Id);
}
示例3: LiveUpdateContactTest
public void LiveUpdateContactTest()
{
var cc = new ConstantContact(ApiKey, AccessToken);
var contact = new Contact();
contact.EmailAddresses.Add(new EmailAddress { EmailAddr = String.Format("{0}@email.com", Guid.NewGuid()), ConfirmStatus = ConfirmStatus.NoConfirmationRequired, Status = Status.Active });
contact.Lists.Add(new ContactList { Id = "1", Status = Status.Active });
var nc = cc.AddContact(contact, false);
Assert.IsNotNull(nc);
Assert.IsNotNull(nc.Id);
nc.CompanyName = "some company";
var retrievedContact = cc.UpdateContact(nc, false);
Assert.IsNotNull(retrievedContact);
Assert.AreEqual(retrievedContact.Id, nc.Id);
Assert.AreEqual(retrievedContact.CompanyName, nc.CompanyName);
}