示例#1
0
        private void btn_save_Click(object sender, EventArgs e)
        {
            var address = new Four51WebAddress(txt_sharedsecret.Text, txt_serviceid.Text)
            {
                InteropID        = txt_address_interopid.Text == "" ? Guid.NewGuid().ToString() : txt_address_interopid.Text,
                CompanyInteropID = txt_address_companyinteropid.Text,
                Name             = txt_address_name.Text,
                FirstName        = txt_address_firstname.Text,
                LastName         = txt_address_lastname.Text,
                CompanyName      = txt_address_companyname.Text,
                AddressLineOne   = txt_address_addresslineone.Text,
                AddressLineTwo   = txt_address_addresslinetwo.Text,
                City             = txt_address_city.Text,
                State            = txt_address_state.Text,
                Zip         = txt_address_zip.Text,
                Country     = txt_address_country.Text,
                PhoneNumber = txt_address_phonenumber.Text
            };

            try
            {
                address.Save();
                MessageBox.Show("Saved: " + address.Name);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
示例#2
0
        private void btn_address_delete_Click(object sender, EventArgs e)
        {
            var address = new Four51WebAddress(txt_sharedsecret.Text, txt_serviceid.Text)
            {
                InteropID        = txt_address_interopid.Text,
                CompanyInteropID = txt_address_companyinteropid.Text
            };

            try
            {
                address.Delete(false);
                MessageBox.Show("Deleted: " + address.InteropID);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }