예제 #1
0
        private void process_button_click(object sender, EventArgs e)
        {
            closed = false;
            bool valid = new AddressParser(tbAddress.Text).parseAddress().IsCompleteAddress();

            if (valid)
            {
                try
                {
                    if (SearchResult == null || addressChanged)
                    {
                        SearchResult   = new GetDeepSearch().search(tbAddress.Text, SettingForm.GetZWID());
                        addressChanged = false;
                    }
                    this.Hide();
                }
                catch (Exception ee)
                {
                    MessageBox.Show(String.Format("Something went wrong : '{0}'", tbAddress.Text), ee.Message,
                                    MessageBoxButtons.OK, MessageBoxIcon.Error);
                    SearchResult = null;
                }
            }
            else
            {
                MessageBox.Show(String.Format("'{0}' is not a valid, please make sure you have city state and zip", tbAddress.Text), "Opps .. ",
                                MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
예제 #2
0
        private void setting_click(object sender, RibbonControlEventArgs e)
        {
            SettingForm f = new SettingForm();

            if (f.ShowDialog() == DialogResult.OK)
            {
                this.StateForm = null; // invalidate state
            }
        }
예제 #3
0
        private void getCompResult(bool searchResultChanged)
        {
            closed = false;
            String zpid = searchResult.getZpid();

            if (zpid != null)
            {
                try
                {
                    if (SearchResult != null)
                    {
                        compResult     = new GetDeepCompSearch().search(searchResult.getZpid(), SettingForm.GetZWID());
                        addressChanged = false;
                    }
                    this.Hide();
                }
                catch (Exception ee)
                {
                    MessageBox.Show(String.Format("Something went wrong : '{0}'", tbAddress.Text), ee.Message,
                                    MessageBoxButtons.OK, MessageBoxIcon.Error);
                    SearchResult = null;
                }
            }
            else
            {
                MessageBox.Show(String.Format("'{0}' is not a valid, please make sure you have city state and zip", tbAddress.Text), "Opps .. ",
                                MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }