private void DeleteSelectedProduct(object sender, bool promotion) { MyDialog dialog = new MyDialog(); if (dialog.ShowDialog() == false) { if (dialog.ResponseText == "Y") { StandardInclusionResource.GenericProduct p = ((FrameworkElement)sender).DataContext as StandardInclusionResource.GenericProduct; sr.RemoveValidationRule(p, promotion); } } }
private void btnDeleteImage_Click(object sender, RoutedEventArgs e) { MyDialog dialog = new MyDialog(); int supplierid = 0; if (dialog.ShowDialog() == false) { if (dialog.ResponseText == "Y") { StudioMResource.ProductImage pi = ((FrameworkElement)sender).DataContext as StudioMResource.ProductImage; //if ((bool)chkFilter.IsChecked) // supplierid = int.Parse(cmbSupplier.SelectedValue.ToString()); sr.RemoveProductImage(pi.ImageID, supplierid); } } }
private void chkActive_Click(object sender, RoutedEventArgs e) { StandardInclusionResource.GenericProduct p = ((FrameworkElement)sender).DataContext as StandardInclusionResource.GenericProduct; MyDialog dialog = new MyDialog("Do you want to " + (p.Active ? "enable" : "disable") + " this promotion?"); if (dialog.ShowDialog() == false) { if (dialog.ResponseText == "Y") { sr.RemoveValidationRule(p, true, true, p.Active); } else { // revert to previous state p.Active = !p.Active; ((CheckBox)sender).IsChecked = p.Active; } } }