コード例 #1
0
        private void button_userAddress_Click(object sender, EventArgs e)
        {
            var addressDetails = new AddressDetails
            {
                textBox_addressStreet  = { Text = settings.User.AddressStreet.Trim() },
                textBox_addressCity    = { Text = settings.User.AddressCity.Trim() },
                textBox_addressState   = { Text = settings.User.AddressState.Trim() },
                textBox_addressZip     = { Text = settings.User.AddressZip.Trim() },
                textBox_addressCountry = { Text = settings.User.AddressCountry.Trim() }
            };


            addressDetails.ShowDialog();
            if (!addressDetails.Saved)
            {
                return;
            }
            settings.User.AddressStreet  = addressDetails.textBox_addressStreet.Text.Trim();
            settings.User.AddressCity    = addressDetails.textBox_addressCity.Text.Trim();
            settings.User.AddressState   = addressDetails.textBox_addressState.Text.Trim();
            settings.User.AddressZip     = addressDetails.textBox_addressZip.Text.Trim();
            settings.User.AddressCountry = addressDetails.textBox_addressCountry.Text.Trim();


            textBox_userAddress.Text = settings.User.AddressStreet + "\r\n"
                                       + settings.User.AddressZip + " "
                                       + settings.User.AddressCity
                                       + (settings.User.AddressState != string.Empty ? " (" + settings.User.AddressState + ")" : string.Empty) + "\r\n"
                                       + settings.User.AddressCountry;
        }
コード例 #2
0
        private void button_companyAddress_Click(object sender, EventArgs e)
        {
            var addressDetails = new AddressDetails
            {
                textBox_addressStreet  = { Text = ClientProfileInfo.AddressStreet.Trim() },
                textBox_addressCity    = { Text = ClientProfileInfo.AddressCity.Trim() },
                textBox_addressState   = { Text = ClientProfileInfo.AddressState.Trim() },
                textBox_addressZip     = { Text = ClientProfileInfo.AddressZip.Trim() },
                textBox_addressCountry = { Text = ClientProfileInfo.AddressCountry.Trim() }
            };


            addressDetails.ShowDialog();
            if (!addressDetails.Saved)
            {
                return;
            }
            ClientProfileInfo.AddressStreet  = addressDetails.textBox_addressStreet.Text.Trim();
            ClientProfileInfo.AddressCity    = addressDetails.textBox_addressCity.Text.Trim();
            ClientProfileInfo.AddressState   = addressDetails.textBox_addressState.Text.Trim();
            ClientProfileInfo.AddressZip     = addressDetails.textBox_addressZip.Text.Trim();
            ClientProfileInfo.AddressCountry = addressDetails.textBox_addressCountry.Text.Trim();


            textBox_companyAddress.Text = ClientProfileInfo.AddressStreet + "\r\n"
                                          + ClientProfileInfo.AddressZip + " "
                                          + ClientProfileInfo.AddressCity
                                          + (ClientProfileInfo.AddressState != string.Empty ? " (" + ClientProfileInfo.AddressState + ")" : string.Empty) + "\r\n"
                                          + ClientProfileInfo.AddressCountry;
        }