コード例 #1
0
        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;
                    }
                }
            }
        }
コード例 #2
0
 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;
         }
     }
 }