Example #1
0
        public void FieldsGetListTest()
        {
            Prompt.Ymlp.YmlpConnector target = InitializeApi();

            List <Field> FieldList         = null;  // TODO: Initialize to an appropriate value
            List <Field> FieldListExpected = null;  // TODO: Initialize to an appropriate value
            bool         expected          = false; // TODO: Initialize to an appropriate value
            bool         actual;

            actual = target.FieldsGetList(out FieldList);
            Assert.AreEqual(FieldListExpected, FieldList);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
Example #2
0
        public static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            bool          secure = false;
            YmlpConnector proxy  = new Prompt.Ymlp.YmlpConnector(YmlpKey, YmlpUser, secure);

            Console.WriteLine("Available fields");
            List <Field> fl;

            if (proxy.FieldsGetList(out fl) == false)
            {
                Console.WriteLine("Error getting Field list");
                PrintExceptions(proxy.Exceptions);
                return;
            }
            else
            {
                foreach (var i in fl)
                {
                    Console.WriteLine("id: {0} / field: {1}", i.Id, i.FieldName);
                }
            }

            List <Group> grouplist;

            if (proxy.GroupsGetList(out grouplist) == false)
            {
                Console.WriteLine("Error getting groups, exit!");
                PrintExceptions(proxy.Exceptions);
                return;
            }

            foreach (var group in grouplist)
            {
                // Get all information about all contacts in a group
                Console.WriteLine("GROUP  ---  {0} (id: {1}, # contacts: {2})", group.GroupName, group.Id, group.NumberOfContacts);

                // Get all the available fields
                var            fieldlist = fl.Select(f => f.Id).ToList();
                List <Contact> cl;
                if (proxy.ContactsGetList(out cl, group.Id, fieldlist) == false)
                {
                    Console.WriteLine("Error getting contacts");
                    PrintExceptions(proxy.Exceptions);
                    return;
                }
                else
                {
                    // Loop all contacts
                    foreach (var contact in cl)
                    {
                        Console.WriteLine("contact e-mail: {0}", contact.EmailAddress);
                        Console.WriteLine("        state : {0}", contact.State);
                        Console.WriteLine("        create: {0}", contact.CreateDate);
                        if (contact.Fields.Count > 0)
                        {
                            Console.WriteLine("        Extra fields found");
                        }
                        foreach (var field in contact.Fields)
                        {
                            // For every contact print all fields from that contact
                            Console.WriteLine(" {0,22}: {1}", field.Key, field.Value);
                        }
                    }
                }
            }
            Console.Write("Press any key to continue . . . ");
            Console.ReadKey(true);
        }