//closes the window without making modifications private void btnCancel_Click(object sender, RoutedEventArgs e) { WindowEditCu customer = new WindowEditCu(); customer.Show(); this.Close(); }
//goes to the edit customer window, when a customer is double clicked in a data grid private void dgridCustomers_MouseDoubleClick(object sender, MouseButtonEventArgs e) { if (dgridCustomers.SelectedIndex != -1) { var currCust = dgridCustomers.SelectedItem as Customer; //stores the current customer's number for easy access in the edit window inst.CurrentCustomer = currCust.CustomerNo; WindowEditCu edit = new WindowEditCu(); edit.Show(); this.Close(); } }