Exemple #1
0
 private static bool IsDateValid(SingleItem sender, Csla.Validation.RuleArgs e)
 {
     if (sender.ReadProperty <SmartDate>(DateCreatedProperty) < new SmartDate(new DateTime(2000, 1, 1)))
     {
         e.Description = "Date cannot be in the last century!";
         return(false);
     }
     return(true);
 }
Exemple #2
0
 private static bool StartDateGTEndDate <T>(T target, Csla.Validation.RuleArgs e) where T : Project
 {
     if (target.ReadProperty(StartedProperty) > target.ReadProperty(EndedProperty))
     {
         e.Description = "Start date can't be after end date";
         return(false);
     }
     else
     {
         return(true);
     }
 }