Пример #1
0
        private void buttonPresiseSearch_Click(object sender, EventArgs e)
        {
            if (textBoxSearch.Text.Equals(""))
            {
                MessageBox.Show("检索关键词为空");
                return;
            }
            try
            {
                switch (comboBoxOption.SelectedIndex)
                {
                case 0:
                    ShowSupplierData(SupplierDataAccess.SelectSupplierById(textBoxSearch.Text));
                    break;

                case 1:
                    ShowSupplierData(SupplierDataAccess.SelectSupplierByExactUsername(textBoxSearch.Text));
                    break;

                case 2:
                    ShowSupplierData(SupplierDataAccess.SelectSupplierByExactRealName(textBoxSearch.Text));
                    break;

                case 3:
                    ShowSupplierData(SupplierDataAccess.SelectSupplierByExactPhoneNumber(textBoxSearch.Text));
                    break;

                case 4:
                    ShowSupplierData(SupplierDataAccess.SelectSupplierByExactEmailAddress(textBoxSearch.Text));
                    break;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }