private void btnCustSave_Click(object sender, RoutedEventArgs e) { PO.Customer customer = (sender as Button).DataContext as PO.Customer; if (customer is PO.Customer) { bl.EditCustomer(PO.Tools.BOCustomer(customer)); } }
private void lvCusts_MouseDoubleClick(object sender, MouseButtonEventArgs e) { PO.Customer customer = (sender as ListView).SelectedItem as PO.Customer; custOrders.Clear(); custOrders = new ObservableCollection <Order>(); foreach (var item in bl.GetOrders(order => order.Customer.CustomerID == customer.CustomerID)) { custOrders.Add(PO.Tools.POOrder(item)); } lvCustSales.DataContext = custOrders; grdCustInfo.DataContext = customer; }