public void regenerateDepositNumber1ForCaseId1960()
        {
            /////////// Query to DB and validations between UI and DB ///////////
            DataRowCollection rows = null;

            rows = ExecuteQueryOnDBWithString(Properties.Resources.regenerateDepositNumber1ForCaseId1960);
            TestsLogger.Log("Deposit # 1 regenerated for case 1960");
        }
        public void regenerateDeposit1ForCaseId1378()
        {
            DataTable results = new DataTable();

            using (SqlConnection conn = new SqlConnection(ConfigurationManager.AppSettings.Get("DBConnectionString")))
                using (SqlCommand command = new SqlCommand(Properties.Resources.regenerateDepositNumber1ForCaseId1960, conn))
                    using (SqlDataAdapter dataAdapter = new SqlDataAdapter(command))
                        dataAdapter.Fill(results);
            TestsLogger.Log("Deposit # 1 regenerated for case 1378");
        }
        public void deleteAllTransactionsCase1960()
        {
            /////////// Query to DB and validations between UI and DB ///////////
            DataRowCollection        rows1      = null;
            Dictionary <string, int> parameters = new Dictionary <string, int>();

            parameters.Clear();
            rows1 = ExecuteQueryOnDBWithString(Properties.Resources.deleteAllTransactionsForCase1960);
            TestsLogger.Log("All Transactions For Case 1960 were Deleted");
        }
        public void createDepositWithAssetLinksForCaseId1960()
        {
            DataTable results = new DataTable();

            using (SqlConnection conn = new SqlConnection(ConfigurationManager.AppSettings.Get("DBConnectionString")))
                using (SqlCommand command = new SqlCommand(Properties.Resources.createDepositWithAllLinksForCaseId1960, conn))
                    using (SqlDataAdapter dataAdapter = new SqlDataAdapter(command))
                        dataAdapter.Fill(results);
            TestsLogger.Log("Deposit #9999 created for case 1960");
        }
        public void regenerateAsset2ForCase2391()
        {
            DataTable results = new DataTable();

            using (SqlConnection conn = new SqlConnection(ConfigurationManager.AppSettings.Get("DBConnectionString")))
                using (SqlCommand command = new SqlCommand(Properties.Resources.regenerateAsset2ForCase2391, conn))
                    using (SqlDataAdapter dataAdapter = new SqlDataAdapter(command))
                        dataAdapter.Fill(results);
            TestsLogger.Log("Asset 2 Regenerated for case 2391");
        }
        public void ResetMissingTaxIdForTesting()
        {
            DataTable results = new DataTable();

            using (SqlConnection conn = new SqlConnection(ConfigurationManager.AppSettings.Get("DBConnectionString")))
                using (SqlCommand command = new SqlCommand(Properties.Resources.ResetMissingTaxIdForTesting, conn))
                    using (SqlDataAdapter dataAdapter = new SqlDataAdapter(command))
                        dataAdapter.Fill(results);
            TestsLogger.Log("ResetMissingTaxIdForTesting Successfully executed!!");
        }
        public void deleteTestReports()
        {
            DataTable results = new DataTable();

            using (SqlConnection conn = new SqlConnection(ConfigurationManager.AppSettings.Get("DBConnectionString")))
                using (SqlCommand command = new SqlCommand(Properties.Resources.deleteTestReports, conn))
                    using (SqlDataAdapter dataAdapter = new SqlDataAdapter(command))
                        dataAdapter.Fill(results);
            TestsLogger.Log("Test Reports Deleted");
        }
        public void deleteAllAssets()
        {
            DataTable results = new DataTable();

            using (SqlConnection conn = new SqlConnection(ConfigurationManager.AppSettings.Get("DBConnectionString")))
                using (SqlCommand command = new SqlCommand(Properties.Resources.deleteAllAssetsFromCase2374, conn))
                    using (SqlDataAdapter dataAdapter = new SqlDataAdapter(command))
                        dataAdapter.Fill(results);
            TestsLogger.Log("All Assets for Case 2374 were deleted!!!!");
        }
        public void deleteDepositForSpecificCase()
        {
            /////////// Query to DB and validations between UI and DB ///////////
            DataRowCollection           rows       = null;
            Dictionary <string, string> parameters = new Dictionary <string, string>();

            parameters.Clear();
            parameters.Add("depositName", "My New Deposit");
            rows = ExecuteQueryOnDBWithString(Properties.Resources.deleteDepositByCaseIdAndDepositName, parameters);
            TestsLogger.Log("Deposit deleted for case 1960");
        }
        public void deleteLastGeneratedTransactionCase1378()
        {
            /////////// Query to DB and validations between UI and DB ///////////
            DataRowCollection        rows1      = null;
            DataRowCollection        rows2      = null;
            Dictionary <string, int> parameters = new Dictionary <string, int>();

            parameters.Clear();
            rows1 = ExecuteQueryOnDBWithString(Properties.Resources.getLastGeneratedTransacionIdForCase1378);
            parameters.Add("transactionIdFrank", Convert.ToInt32(rows1[0].ItemArray[0].ToString()));
            rows2 = ExecuteQueryOnDBWithInt(Properties.Resources.deleteDepositAndLinksForTransactionId, parameters);
            TestsLogger.Log("Last Generated Transaction For Case 1378 Deleted");
        }
        public void saveCaseIdFromSpecificTab(string tabName)
        {
            WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(20));

            pleaseWaitSignDissapear();
            Thread.Sleep(1000);
            IWebElement assetsTab    = null;
            string      href         = "";
            string      caseIdString = "";
            int         caseIdInt    = 0;

            if (tabName == "Assets")
            {
                assetsTab = wait.Until(ExpectedConditions.ElementExists(By.XPath("//div/a[@id='navItem-Assets']")));
                href      = assetsTab.GetAttribute("href").ToString();
                string str = href.Substring(href.IndexOf("general/") + 8);
                caseIdString = str.Replace("/asset", "");
                caseIdInt    = Convert.ToInt32(caseIdString);
            }
            else if (tabName == "Banking")
            {
                assetsTab = wait.Until(ExpectedConditions.ElementExists(By.XPath("//div/a[@id='navItem-Banking']")));
                href      = assetsTab.GetAttribute("href").ToString();
                string str = href.Substring(href.IndexOf("general/") + 8);
                caseIdString = str.Replace("/banking", "");
                caseIdInt    = Convert.ToInt32(caseIdString);
            }
            else
            {
                assetsTab = wait.Until(ExpectedConditions.ElementExists(By.XPath("//div/a[@id='navItem-Claims']")));
                href      = assetsTab.GetAttribute("href").ToString();
                string str = href.Substring(href.IndexOf("general/") + 8);
                caseIdString = str.Replace("/", "");
                caseIdInt    = Convert.ToInt32(caseIdString);
            }
            ScenarioContext.Current.Add("caseId", caseIdInt);
            TestsLogger.Log(caseIdString);
            pleaseWaitSignDissapear();
        }