예제 #1
0
        private void ListContacts()
        {
            string token = (string)Session["token"];

            txtCompanyName.Text   = "";
            txtContactName.Text   = "";
            txtContactTypeID.Text = "";

            ContactManager contactManager = new ContactManager();

            ContactGetHeader contactHeader = contactManager.GetContacts(token);

            DisplayContacts(contactHeader);
        }
예제 #2
0
        private void DisplayContacts(ContactGetHeader contactHeader)
        {
            string       listText;
            ListItem     item;
            ContactToGet contact;

            ListBoxContacts.Items.Clear();

            for (int i = 0; i < contactHeader.Contacts.Count; i++)
            {
                contact = contactHeader.Contacts[i];
                ContactType type = contact.ContactType;

                string contactTypeID = type.Id.ToString();

                listText = contact.CompanyName + "," + contact.Name + "," + contact.Email + "," + contact.Telephone + "," + contactTypeID;

                item = new ListItem(listText, contact.Id.ToString());

                this.ListBoxContacts.Items.Add(item);
            }
        }