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); }
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); }
public static bool IsEmpty(VoucherID id) { return(id._id.Length == 0); }