Exemplo n.º 1
0
        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();
            }
        }
Exemplo n.º 2
0
        private void SearchCustomers()
        {
            var filterResponse = ResponsibleProcessor.Process("Loading Customers", () => CustomerLogic.Filter(SearchTextBox.Text), true);

            CustomersDataGridView.DataSource = filterResponse.Value;
        }