示例#1
0
        public static void OnDeleting(IIdentifyCardType cardType, IObjectSpace objectSpace)
        {
            if (cardType.allowTodel == false)
            {
                throw new UserFriendlyException(DevExpress.ExpressApp.Utils.CaptionHelper.GetLocalizedText("Exceptions", "SecuredObjectDelAttempt"));
            }

            var identityCards = Get_PersonIdentityCards(cardType, objectSpace);
            if (identityCards != null)
            {
                if (identityCards.Count > 0)
                {
                    throw new UserFriendlyException(DevExpress.ExpressApp.Utils.CaptionHelper.GetLocalizedText("Messages", "RelatedObjectsDelWarning"));
                }
            }
        }
示例#2
0
 public static IList<IPersonIdentityCard> Get_PersonIdentityCards(IIdentifyCardType cardType, IObjectSpace objectSpace)
 {
     var criteria = CriteriaOperator.Parse("[IdentityCardType] = ?", cardType);
     return objectSpace.GetObjects<IPersonIdentityCard>(criteria);
 }
示例#3
0
 public static void AfterConstruction(IIdentifyCardType cardType)
 {
     cardType.allowTodel = true;
 }