예제 #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());
                }
            }
예제 #2
0
            protected override void Execute(Csla.Rules.RuleContext context)
            {
                var input = (string)context.InputPropertyValues[PrimaryProperty];

                if (string.IsNullOrEmpty(input))
                {
                    context.AddOutValue(_clearProperty, null);
                }
            }
예제 #3
0
파일: Root.cs 프로젝트: zuiwanting/csla
 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());
   }
 }
예제 #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);
            }