Пример #1
0
        public void DeleteItem(BusinessObject objT)
        {
            if (objT is T == false)
            {
                return;
            }

            foreach (String strChildName in Binding.Config.Children.Keys)
            {
                if (Binding.DataManager.DataObjectsList[strChildName].Config.DisplayOnly)
                {
                    continue;
                }

                String strFK          = Binding.DataManager.DataObjectsList[strChildName].Config.ChildField;
                String strFKTableName = Binding.DataManager.DataObjectsList[strChildName].TableName;
                Guid   iID            = ABCHelper.DataConverter.ConvertToGuid(ABCBusinessEntities.ABCDynamicInvoker.GetValue(objT, DataStructureProvider.GetPrimaryKeyColumn(this.TableName)));
                if (iID != Guid.Empty)
                {
                    BusinessObjectController ctrller = BusinessControllerFactory.GetBusinessController(strFKTableName);
                    if (ctrller != null)
                    {
                        ctrller.DeleteObjectsByFK(strFK, iID);
                    }
                }
            }
            Controller.DeleteObject(objT);
        }