Exemplo n.º 1
0
        /// <summary>
        /// создание списка контактов
        /// </summary>
        /// <param name="responseJson"></param>
        /// <returns></returns>
        private static List <Contact> CreateListContacts(ResponseJson responseJson)
        {
            List <Contact> contacts = new List <Contact>();

            foreach (Response p in responseJson.Responses)
            {
                Contact a = new Contact();
                a.Firstname      = p.Properties.Firstname.Value;
                a.Lastname       = p.Properties.Lastname.Value;
                a.Lifecyclestage = p.Properties.Lastmodifieddate.Value;
                a.Company        = p.Properties.Company.Value;
                a.Vid            = p.Vid;
                a.PortalId       = p.PortalId;
                contacts.Add(a);
            }
            return(contacts);
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            string timeOffset = "1524735957939";
            string result     = GetJsonWithContacts(timeOffset);

            Console.Write(result);

            ResponseJson responseJson = JsonConvert.DeserializeObject <ResponseJson>(result);

            Console.WriteLine();

            Console.WriteLine(responseJson.Responses.Count);

            List <Contact> contacts = CreateListContacts(responseJson);

            CreateCSVFile(contacts);

            Console.ReadKey();
        }