static void Main(string[] args)
        {
            try
            {
                bool useSTS = true;

//				X509Certificate2 MOCESCert = GetMOCESCertificate();
//				X509Certificate2 VOCESCert = GetVOCESCertificate();
                X509Certificate2 MOCESCert = GetSTSMOCESCertificate();
                X509Certificate2 VOCESCert = GetSTSVOCESCertificate();

                DGWSCard10Type card;

                if (useSTS)
                {
                    DGWSCard101Type idCard = GetIDCardVersion101();
                    idCard.Sign(MOCESCert);
//					DGWSCard101Type idCard = GetSystemIDCardVersion101();
//					idCard.Sign(VOCESCert);

                    XElement x = IDP.CallIdp(idCard, "SEI", "http://pan.certifikat.dk/sts/services/SecurityTokenService");

                    card = new DGWSCard101Type(x);
                }
                else
                {
//					card = GetIDCardVersion101();
//					card = GetIDCardVersion11();
                    card = GetSystemIDCardVersion101();
//					card.Sign(MOCESCert);
                    card.Sign(VOCESCert);
                }

                MortalityRegistrationService service = new MortalityRegistrationService();
                service.SetPolicy(new DGWSPolicy(card, VOCESCert));
//				service.SetPolicy(new DGWSPolicy(card, MOCESCert));
                MortalityReasonType mort = Helper.CreateTestDocument_Part1And2();
//				MortalityReasonType mort = Helper.CreateTestDocument_Part1();
                String s = service.Report(mort);
                System.Diagnostics.Debug.WriteLine(s);
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.ToString());
            }
        }
示例#2
0
        static void Main(string[] args)
        {
            Consumer customer = new Consumer();

            IDP ID = new IDP();

            Console.WriteLine("Enter the user type");
            Console.WriteLine("customer");
            Console.WriteLine("driver");
            user_Id = Console.ReadLine();
            if (user_Id == "customer")
            {
                customer.Login();
                customer.Place_order();
            }
            else if (user_Id == "driver")
            {
                ID.Login();
                ID.Accept_order();
            }


            Console.ReadKey();
        }