Beispiel #1
0
        public static ProviderAccount addNonMFA_Account(Providers providers)
        {
            Console.WriteLine(" Add Non_MFA_Account:  ");
            Console.WriteLine("Enter your provider userName : "******"DBmet1.site16441.1";//

            providers.getProvider()[0].getLoginForm().getRow()[0].getField()[0].setValue(userName);
            Console.WriteLine("Enter provider password : "******"site16441.1";//

            providers.getProvider()[0].getLoginForm().getRow()[1].getField()[0].setValue(password);
            ProviderAccount providerAccount = AddProviderAccountNew.addProviderAccount(providers);
            string          refMsg;
            ProviderAccount pAcnt;

            do
            {
                pAcnt  = AddProviderAccountNew.getProviderAccount(providerAccount.providerAccount.id);
                refMsg = pAcnt.providerAccount.refreshInfo.status;
                Console.WriteLine("status" + refMsg + ", additionalStatus " + providerAccount.providerAccount.refreshInfo.additionalStatus);
                if (refMsg == "FAILED")
                {
                    Console.WriteLine("login failed please try again" + refMsg);
                    break;
                }
            } while (refMsg != "SUCCESS");
            if (refMsg == "SUCCESS")
            {
                Console.WriteLine("Account added successfully");
            }
            return(pAcnt);
        }
Beispiel #2
0
        public static void addMFA_Account(Providers providers)
        {
            Console.WriteLine(" Add MFA_Account:  ");
            Console.WriteLine("Enter your provider userName : "******"Enter provider password : "******"refresh status" + refMsg);
                if (refMsg == "FAILED")
                {
                    Console.WriteLine("login failed please try again" + refMsg);
                    break;
                }
            } while (providerAccount.providerAccount.getLoginForm() == null);
            //while (refMsg != "FAILED")
            //{
            //    refMsg = providerAccount.providerAccount.refreshInfo.status;
            //    Console.WriteLine("refresh status" + refMsg);
            //    if (refMsg == "FAILED")
            //    {
            //        Console.WriteLine("login failed please try again" + refMsg);
            //        break;
            //    }
            //     providerAccount = AddProviderAccountNew.getProviderAccount(providerAccount.providerAccount.id);
            //}
            if (refMsg != "FAILED")
            {
                Console.WriteLine("received form:" + providerAccount.providerAccount.getLoginForm());
                providerAccount.providerAccount.getLoginForm().getRow()[0].getField()[0].setValue("123456");
                Console.WriteLine("putting mfa token");
                providerAccount = doChallenge(providerAccount.providerAccount.getLoginForm(), providerAccount.providerAccount.id);
            }
            while (providerAccount.providerAccount.getLoginForm() == null && refMsg != "FAILED" && refMsg != "SUCCESS" && refMsg != "PARTIAL_SUCCESS")
            {
                refMsg = providerAccount.providerAccount.refreshInfo.status;
                Console.WriteLine("refresh status" + refMsg);
                if (refMsg == "FAILED")
                {
                    Console.WriteLine("login failed please try again" + refMsg);
                    break;
                }
                providerAccount = AddProviderAccountNew.getProviderAccount(providerAccount.providerAccount.id);
            }
            if (refMsg != "FAILED" && refMsg != "SUCCESS" && refMsg != "PARTIAL_SUCCESS")
            {
                Console.WriteLine("received form:" + providerAccount.providerAccount.getLoginForm());
                providerAccount.providerAccount.getLoginForm().getRow()[0].getField()[0].setValue("Texas");
                providerAccount.providerAccount.getLoginForm().getRow()[1].getField()[0].setValue("w3schools");
                Console.WriteLine("putting mfa Q&A");
                providerAccount = doChallenge(providerAccount.providerAccount.getLoginForm(), providerAccount.providerAccount.id);
                refMsg          = providerAccount.providerAccount.refreshInfo.status;
            }
            while (refMsg != "SUCCESS" && refMsg != "PARTIAL_SUCCESS")
            {
                Console.WriteLine("refresh status" + refMsg + ",additional_Status " + providerAccount.providerAccount.refreshInfo.additionalStatus);
                if (refMsg == "FAILED")
                {
                    Console.WriteLine("login failed please try again" + refMsg);
                    break;
                }
                providerAccount = AddProviderAccountNew.getProviderAccount(providerAccount.providerAccount.id);
                refMsg          = providerAccount.providerAccount.refreshInfo.status;
            }
            if (refMsg == "SUCCESS")
            {
                Console.WriteLine("acount aded successfully");
            }
            if (refMsg == "PARTIAL_SUCCESS")
            {
                Console.WriteLine("acount aded partially");
            }
            // Fetch the accounts if you need !
        }
Beispiel #3
0
        public static void ProcessInput(int keyValue)
        {
            if (keyValue > 12)
            {
                Console.WriteLine("Enter One Valid Number");
                readValue();
            }
            else
            {
                switch (keyValue)
                {
                case 1:
                    Console.WriteLine("Enter the name of the  Provider you want to search : ");
                    String searchString = Console.ReadLine();
                    //String searchString = "Dag";
                    ProviderApp.searchProvider(searchString);
                    LoginApp.readValue();
                    break;

                case 2:
                    //AddSiteAccount.addSiteAccount();
                    AddProviderAccount.AddAccount(1);
                    break;

                case 3:
                    AddProviderAccount.AddAccount(2);
                    break;

                case 4:
                    AddProviderAccountNew.AddAccount(1);
                    break;

                case 5:
                    AddProviderAccountNew.AddAccount(2);
                    break;

                case 6:
                    AccountApp.accountApp(1);
                    break;

                case 7:
                    HoldingApp.holdingApp(1);
                    break;

                case 8:
                    TransactionApp.transactionApp();
                    break;

                case 9:
                    AssetSummaryApp.assetSummaryApp();
                    break;

                case 10:
                    HoldingApp.holdingApp(2);
                    break;

                case 11:
                    AccountApp.accountApp(2);
                    break;

                case 0:


                    Environment.Exit(0);
                    break;
                }
            }
        }