示例#1
0
        /// <summary>
        /// Create variables and open the contact registry form. 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAdd_Click(object sender, EventArgs e)
        {
            ContactFiles.Address[] address = handle.getAddress();
            ContactFiles.Email[] email = handle.getEmail();
            ContactFiles.Person[] person = handle.getPerson();
            ContactFiles.Phone[] phone = handle.getPhone();
            ContactForm register = new ContactForm(handle, this, 0, "", "", "", "", "", "", "", "", "", 112); // input empty values to the contactform, set std. combox selection.

            register.Show();
        }
示例#2
0
        /// <summary>
        /// Change a existing contact, fetch existing data from contact, based on the row selected in listview. printout the existing data to the contactform, so that the user can modify just the value she want to edit. 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnChange_Click(object sender, EventArgs e)
        {
            ContactFiles.Address[] address = handle.getAddress();
            ContactFiles.Email[] email = handle.getEmail();
            ContactFiles.Person[] person = handle.getPerson();
            ContactFiles.Phone[] phone = handle.getPhone();

            for(int x = 0; x < address.GetLength(0); x++)
            {
                if(index == address[x].getID())
                {
            ContactForm register = new ContactForm(handle,
                this,
                address[x].getID(),
                person[x].getFirstName(),
                person[x].getLastName(),
                person[x].getPID().ToString(),
                phone[x].getTelWork().ToString(),
                phone[x].getTelHome().ToString(),
                email[x].getEmailWork(),
                address[x].getStreet(),
                address[x].getZipCode(),
                address[x].getCity(),
                address[x].getCountryIndex());
            register.Show();
                }
            }
        }