Exemplo n.º 1
0
            protected override void Execute(Csla.Rules.RuleContext context)
            {
                var input = context.InputPropertyValues[PrimaryProperty].ToString();

                if (!string.IsNullOrEmpty(input))
                {
                    context.AddOutValue(PrimaryProperty, input.ToUpper());
                }
            }
Exemplo n.º 2
0
            protected override void Execute(Csla.Rules.RuleContext context)
            {
                var input = (string)context.InputPropertyValues[PrimaryProperty];

                if (string.IsNullOrEmpty(input))
                {
                    context.AddOutValue(_clearProperty, null);
                }
            }
Exemplo n.º 3
0
 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());
   }
 }
Exemplo n.º 4
0
            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);
            }