public void DeleteRelatedEntityAnswer <TCache>(CSAttributeGroup attributeGroup) where TCache : IBqlTable { var entityAttribute = GetRelatedEntityAttribute <TCache>( attributeGroup.AttributeID, attributeGroup.EntityClassID); if (entityAttribute != null) { CSAttributeGroupList <IBqlTable, TCache> .DeleteAttributesForGroup(graph, entityAttribute); } }
/// <summary> /// Deletes answers related to the primary attribute group. Should be used on RowDeleting event. /// </summary> public void DeleteAnswersIfRequired <TPrimaryCache>(Events.RowDeleting <CSAttributeGroup> args) where TPrimaryCache : IBqlTable { var attributeGroup = args.Row; if (attributeGroup.IsActive == true) { throw new PXSetPropertyException(CrMessages.AttributeCannotDeleteActive); } if (IsDeleteConfirmed()) { CSAttributeGroupList <IBqlTable, TPrimaryCache> .DeleteAttributesForGroup(graph, attributeGroup); } else { args.Cancel = true; } }
protected virtual void CSAttributeGroup_RowDeleting(PXCache sender, PXRowDeletingEventArgs e) { var attributeGroup = (CSAttributeGroup)e.Row; if (attributeGroup == null) { return; } if (attributeGroup.IsActive == true) { throw new PXSetPropertyException(CR.Messages.AttributeCannotDeleteActive); } if (Mapping.Ask("Warning", CR.Messages.AttributeDeleteWarning, MessageButtons.OKCancel) != WebDialogResult.OK) { e.Cancel = true; return; } CSAttributeGroupList <CSAttributeGroup, CSAttributeGroup> .DeleteAttributesForGroup(this, attributeGroup); }