private void AddButton_Click(object sender, System.EventArgs e) { var customerToAdd = new Customer { Firstname = FirstnameTextBox.Text, Lastname = LastnameTextBox.Text }; var addResponse = ResponsibleProcessor.Process("Adding Customer", () => CustomerLogic.Add(customerToAdd), true, true); if (addResponse.Success) { SearchCustomers(); } }
private void SearchCustomers() { var filterResponse = ResponsibleProcessor.Process("Loading Customers", () => CustomerLogic.Filter(SearchTextBox.Text), true); CustomersDataGridView.DataSource = filterResponse.Value; }