Example #1
0
        public static VoucherID NewID()
        {
            var rndm = new Random();
            var ret  = new VoucherID();

            var count = rndm.Next(5, 8);

            for (int i = 1; i <= count; i++)
            {
                var num = rndm.Next(0, 9);
                ret._id += num.ToString();
            }

            return(ret);
        }
Example #2
0
        public static bool TryParse(string src, out VoucherID result)
        {
            var ret = new VoucherID();

            if (src.Length >= 5 && src.Length <= 8)
            {
                ret._id = src;
                result  = ret;

                return(true);
            }

            result = Empty;

            return(false);
        }
Example #3
0
 public static bool IsEmpty(VoucherID id)
 {
     return(id._id.Length == 0);
 }