Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            var doc = new BaseDocument("UT-2045-BG", "OtheDocument");

            doc.WriteToConsel();

            var pas = new Passport("6554332322");

            //pas.WriteToConsole();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            BaseDocument document1 = new BaseDocument("Document", "1242141", new DateTimeOffset(new DateTime(2019, 5, 5)));
            Passport     passport  = new Passport("1242141", new DateTimeOffset(new DateTime(2019, 5, 5)))
            {
                Country    = "Russia",
                PersonName = "Vladimir"
            };

            document1.WriteToConsole();
            passport.WriteToConsole();
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            var documents = new BaseDocument[]
            {
                new BaseDocument("Some document", "0000", DateTimeOffset.UtcNow.AddYears(-1)),
                new Passport("1234", DateTimeOffset.UtcNow.AddYears(-20), "Russia", "Ivan"),
                new BaseDocument("Some document", "1111", DateTimeOffset.UtcNow.AddYears(-2)),
                new Passport("8545", DateTimeOffset.UtcNow.AddYears(-25), "Russia", "Oleg")
            };

            foreach (var document in documents)
            {
                if (document is Passport passport)
                {
                    passport.ChangeIssueDate(DateTimeOffset.UtcNow);
                }
                document.WriteToConsole();
            }
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            var documents = new BaseDocument[3];

            documents[0] = new BaseDocument("Расписка", "АБ-1234", DateTimeOffset.Parse("2010-11-12"));
            documents[1] = new Passport("2341 123456", DateTimeOffset.Parse("2017-01-20"), "Russia", "Constantine Sotskov");
            documents[2] = new BaseDocument("Доверенность", "АС-1234", DateTimeOffset.Parse("2016-05-09"));

            foreach (var document in documents)
            {
                if (document is Passport passport)
                {
                    passport.ChangeIssueDate(DateTimeOffset.Now);
                }

                document.WriteToConsole();
            }

            Console.ReadKey();
        }