protected override void Execute(Csla.Rules.RuleContext context) { var input = context.InputPropertyValues[PrimaryProperty].ToString(); if (!string.IsNullOrEmpty(input)) { context.AddOutValue(PrimaryProperty, input.ToUpper()); } }
protected override void Execute(Csla.Rules.RuleContext context) { var input = (string)context.InputPropertyValues[PrimaryProperty]; if (string.IsNullOrEmpty(input)) { context.AddOutValue(_clearProperty, null); } }
protected override void Execute(Csla.Rules.RuleContext context) { var sender = (Root)context.Target; using (sender.BypassPropertyChecks) { var value = (string)context.InputPropertyValues[PrimaryProperty]; if (!string.IsNullOrEmpty(value)) context.AddOutValue(PrimaryProperty, value.ToUpper()); } }
protected override void Execute(Csla.Rules.RuleContext context) { var birthDateProperty = context.InputPropertyValues.Single(p => p.Key.Name == "BirthDateProperty"); var status = "Unknown Date of Birth"; if (birthDateProperty.Value != null) { var birthDate = (DateTime)birthDateProperty.Value; if (birthDate.CompareTo(DateTime.Today) == 0) { status = "Happy Birthday"; } else { status = "It's not your birthday"; } } context.AddOutValue(PrimaryProperty, status); }