private void xamDataGrid_RecordsDeleting(object sender, Infragistics.Windows.DataPresenter.Events.RecordsDeletingEventArgs e) { bool success; foreach (DataRecord record in e.Records) { if (record.DataItem.GetType() == typeof(PlateTypeItem)) { PlateTypeItem pti = (PlateTypeItem)record.DataItem; foreach (MaskContainer mc in pti.MaskList) { success = wgDB.DeleteMask(mc.MaskID); if (!success) { break; } } success = wgDB.DeletePlateType(pti.PlateType.PlateTypeID); if (!success) { break; } } else if (record.DataItem.GetType() == typeof(MaskContainer)) { MaskContainer mc = (MaskContainer)record.DataItem; success = wgDB.DeleteMask(mc.MaskID); if (!success) { break; } } } }
private void xamDataGrid_RecordsDeleting(object sender, Infragistics.Windows.DataPresenter.Events.RecordsDeletingEventArgs e) { bool success; foreach (DataRecord record in e.Records) { if (record.DataItem.GetType() == typeof(MethodItem)) { MethodItem mi = (MethodItem)record.DataItem; foreach (IndicatorItem ii in mi.Indicators) { success = wgDB.DeleteIndicator(ii.IndicatorID); if (!success) { break; } } foreach (CompoundPlateItem cpi in mi.CompoundPlates) { success = wgDB.DeleteCompoundPlate(cpi.CompoundPlateID); if (!success) { break; } } success = wgDB.DeleteMethod(mi.MethodID); if (!success) { break; } } else if (record.DataItem.GetType() == typeof(IndicatorItem)) { IndicatorItem ii = (IndicatorItem)record.DataItem; success = wgDB.DeleteIndicator(ii.IndicatorID); if (!success) { break; } } else if (record.DataItem.GetType() == typeof(CompoundPlateItem)) { CompoundPlateItem cpi = (CompoundPlateItem)record.DataItem; success = wgDB.DeleteCompoundPlate(cpi.CompoundPlateID); if (!success) { break; } } } }
private void xamDataGrid_RecordsDeleting(object sender, Infragistics.Windows.DataPresenter.Events.RecordsDeletingEventArgs e) { foreach (DataRecord record in e.Records) { PlateTypeContainer pc = (PlateTypeContainer)record.DataItem; bool success = wgDB.DeletePlateType(pc.PlateTypeID); if (!success) { break; } } }
private void XamDataGridCategories_RecordsDeleting(object sender, Infragistics.Windows.DataPresenter.Events.RecordsDeletingEventArgs e) { int index = ((Infragistics.Windows.DataPresenter.DataPresenterBase)e.Source).ActiveRecord.Index; record = (DataRecord)xamDataGridCategories.Records[index]; }