private void ListRequestedProduct_MouseDoubleClick(object sender, MouseButtonEventArgs e) { if (ListRequestedProduct.Items.Count > 0 && ListRequestedProduct.SelectedItem != null) { ProductSearched search = new ProductSearched((ProductsSet)ListRequestedProduct.SelectedItem); search.ShowDialog(); if (search.Cancel) { _dataDC.SaveChanges(); } } }
private void lvProductSearched_MouseDoubleClick(object sender, MouseButtonEventArgs e) { if (lvProductSearched.Items.Count > 0 && lvProductSearched.SelectedItem != null) { ProductSearched search = new ProductSearched((ProductsSet)lvProductSearched.SelectedItem); search.ShowDialog(); if (!search.Cancel) { _dataDC.SaveChanges(); } } }
private void btAddSearch_Click(object sender, RoutedEventArgs e) { ProductsSet newProduct = new ProductsSet(); newProduct.Proveedor_ID = _client.Id; newProduct.Enbusca = true.ToString(); newProduct.Enventa = false.ToString(); ProductSearched search = new ProductSearched(newProduct); search._new = true; search.ShowDialog(); if (search._new && !search.Cancel) { lps.Add(newProduct); _dataDC.ProductsSet.AddObject(newProduct); _dataDC.SaveChanges(); lvProductSearched.ItemsSource = lps.Where(S => S.Enbusca == true.ToString() && S.Proveedor_ID == _client.Id).ToList(); } }