Пример #1
0
 protected override void Validate()
 {
     base.Validate();
     if (NotifyType == 0)
     {
         AddBrokenRule(WorkflowBusinessRules.NotifybyRequired);
     }
     if (string.IsNullOrEmpty(MessageBody))
     {
         AddBrokenRule(WorkflowBusinessRules.MessageRequried);
     }
     if (UserID != null && !UserID.Any())
     {
         AddBrokenRule(WorkflowBusinessRules.UserRequired);
     }
     if ((NotifyType == 2 || NotifyType == 3) && MessageBody.Length > 160)
     {
         AddBrokenRule(WorkflowBusinessRules.MaxLength160);
     }
     if ((NotifyType == 1) && MessageBody.Length > 512)
     {
         AddBrokenRule(WorkflowBusinessRules.MaxLength512);
     }
 }