public static void OnDeleting(ISendByOrganization organization, IObjectSpace objectSpace) { var oid = (organization as DevExpress.ExpressApp.DC.DCBaseObject).Oid; CriteriaOperator criteria = new BinaryOperator("SentBy.Oid", oid, BinaryOperatorType.Equal); if (ReferenceEquals(criteria, null)==false)//(criteria != null) { var examination = objectSpace.GetObjects<IExamination>(criteria); if (examination != null) { if (examination.Count>0) { throw new UserFriendlyException(DevExpress.ExpressApp.Utils.CaptionHelper.GetLocalizedText("Messages", "RelatedObjectsDelWarning")); } } } }
public static void AfterConstruction(ISendByOrganization organization) { organization.OrganizationName = String.Empty; organization.Desctiption = String.Empty; }