12345678910111213141516171819 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel.DataAnnotations;
- using System.Text;
- namespace CZFW.Framework.Attributes
- {
- public class GreaterThanZeroAttribute : ValidationAttribute
- {
- public override bool IsValid(object value)
- {
- int? x = value as int?;
- if (x == null) return false;
- if (x <= 0) return false;
- return true;
- }
- }
- }
|