Esempio n. 1
0
        private void searchButton_Click(object sender, EventArgs e)
        {
            int customerId = SqlUpdater.findCustomer(searchBar.Text);

            if (customerId != 0)
            {
                customerDetails   = SqlUpdater.getCustomerDetails(customerId);
                nameLabel.Text    = customerDetails["customerName"];
                phoneLabel.Text   = customerDetails["phone"];
                addressLabel.Text = customerDetails["address"];
                cityLabel.Text    = customerDetails["city"];
                zipLabel.Text     = customerDetails["zip"];
                countryLabel.Text = customerDetails["country"];
                if (customerDetails["active"] == "true")
                {
                    activeLabel.Text = "Active";
                }
                else
                {
                    activeLabel.Text = "Inactive";
                }
            }
            else
            {
                MessageBox.Show("Unable to find customer");
            }
        }
Esempio n. 2
0
        private void searchButton_Click(object sender, EventArgs e)
        {
            int customerId = SqlUpdater.findCustomer(searchBar.Text);

            if (customerId != 0)
            {
                cForm = SqlUpdater.getCustomerDetails(customerId);
                customerNameBox.Text    = cForm["customerName"];
                customerPhoneBox.Text   = cForm["phone"];
                customerCityBox.Text    = cForm["city"];
                customerAddessBox.Text  = cForm["address"];
                customerZipBox.Text     = cForm["zip"];
                customerCountryBox.Text = cForm["country"];
                if (cForm["active"] == "true")
                {
                    activeYes.Checked = true;
                }

                else
                {
                    activeNo.Checked = true;
                }
            }
            else
            {
                MessageBox.Show("Unable to find customer");
            }
        }