コード例 #1
0
        private void FindButton_Click(object sender, EventArgs e)
        {
            using (CustomerFindWin FindForm = new CustomerFindWin())
            {
                DialogResult result = FindForm.ShowDialog();

                if (result == DialogResult.OK)
                {
                    try
                    {
                        var custList = Customers.Retrieve();
                        DetailDataGridView.DataSource = custList.FindCustomers(FindForm.NameToFind);
                    }
                    catch (ArgumentOutOfRangeException)
                    {
                        MessageBox.Show("No text was entered for the find.");
                    }
                }
            }
        }
コード例 #2
0
		private void FindButton_Click(object sender, EventArgs e)
		{
			using (CustomerFindWin FindForm = new CustomerFindWin())
			{
				DialogResult result = FindForm.ShowDialog();

				if (result == DialogResult.OK )
				{
					try 
					{
                        var custList = Customers.Retrieve();
						DetailDataGridView.DataSource = custList.FindCustomers(FindForm.NameToFind);
					}
					catch (ArgumentOutOfRangeException)
					{
						MessageBox.Show("No text was entered for the find.");
					}
				}
			}
		}