예제 #1
0
 private static string RandomPnrIndividual(NonDate date)
 {
     if (date.Year >= 1900)
     {
         return(Random.Next(0, 499).ToString().PadLeft(3, '0'));
     }
     return(Random.Next(500, 749).ToString().PadLeft(3, '0'));
 }
예제 #2
0
        private Pnr Pnr()
        {
            var date = new NonDate(RandomDate());
            var ssn  = new StringBuilder(date.ToString())
                       .Append(RandomPnrIndividual(date));

            ssn.Append(Ssn.CalculateK1(ssn.ToString()));
            ssn.Append(Ssn.CalculateK2(ssn.ToString()));
            return(new Pnr(ssn.ToString()));
        }