예제 #1
0
        public string FTP_Collier(string Address, string parcelNumber, string ownername, string searchType, string orderNumber, string directParcel)
        {
            string strBill = "-", strBalance = "-", strBillDate = "-", strBillPaid = "-", strFBill = "-", strFBalance = "-", strFBillDate = "-", strFBillPaid = "-";
            string TaxYear = "", TaxAmount = "", PaidAmount = "", ReceiptNumber = "", Account_number = "", Millage_Code = "", Millage_rate = "";

            GlobalClass.global_orderNo             = orderNumber;
            HttpContext.Current.Session["orderNo"] = orderNumber;
            GlobalClass.global_parcelNo            = parcelNumber;
            string        StartTime = "", AssessmentTime = "", TaxTime = "", CitytaxTime = "", LastEndTime = "", AssessTakenTime = "", TaxTakentime = "", CityTaxtakentime = "";
            string        TotaltakenTime   = "";
            List <string> strTaxRealestate = new List <string>();
            var           driverService    = PhantomJSDriverService.CreateDefaultService();

            driverService.HideCommandPromptWindow = true;
            using (driver = new PhantomJSDriver())
            {
                string   AlterNateID = "", PropertyAddress = "", owner = "";
                string[] stringSeparators1 = new string[] { "\r\n" };

                List <string> listurl = new List <string>();


                try
                {
                    StartTime = DateTime.Now.ToString("HH:mm:ss");
                    //if (searchType == "titleflex")
                    //{
                    //    gc.TitleFlexSearch(orderNumber, parcelNumber, ownername, Address, "IN", "Hamilton");
                    //    if (GlobalClass.TitleFlex_Search == "Yes")
                    //    {
                    //        return "MultiParcel";
                    //    }
                    //    else
                    //    {
                    //        string strTitleAssess = GlobalClass.TitleFlexAssess;
                    //        parcelNumber = GlobalClass.titleparcel;

                    //        searchType = "parcel";
                    //    }
                    //}

                    if (searchType == "titleflex")
                    {
                        gc.TitleFlexSearch(orderNumber, parcelNumber, "", Address, "FL", "Collier");
                        if ((HttpContext.Current.Session["TitleFlex_Search"] != null && HttpContext.Current.Session["TitleFlex_Search"].ToString() == "Yes"))
                        {
                            driver.Quit();
                            return("MultiParcel");
                        }
                        else if (HttpContext.Current.Session["titleparcel"].ToString() == "")
                        {
                            HttpContext.Current.Session["Nodata_FLCollier"] = "Yes";
                            driver.Quit();
                            return("No Data Found");
                        }
                        parcelNumber = HttpContext.Current.Session["titleparcel"].ToString();
                        searchType   = "parcel";
                    }

                    if (searchType == "address")
                    {
                        driver.Navigate().GoToUrl("http://www.collierappraiser.com/");
                        Thread.Sleep(2000);


                        IWebElement iframeElement = driver.FindElement(By.XPath("/html/frameset/frame"));
                        //now use the switch command
                        driver.SwitchTo().Frame(iframeElement);

                        IWebElement iframeElement1 = driver.FindElement(By.XPath("/html/frameset/frame[2]"));
                        //now use the switch command
                        driver.SwitchTo().Frame(iframeElement1);

                        driver.FindElement(By.XPath("//*[@id='AutoNumber3']/tbody/tr/td[3]/table/tbody/tr[4]/td/a")).Click();
                        Thread.Sleep(10000);
                        driver.SwitchTo().DefaultContent();
                        Thread.Sleep(2000);

                        IWebElement iframeElement2 = driver.FindElement(By.XPath("//*[@id='rbottom']"));
                        //now use the switch command
                        driver.SwitchTo().Frame(iframeElement2);
                        Thread.Sleep(2000);
                        //now use the switch command

                        driver.FindElement(By.XPath("//*[@id='a_searchlink']")).Click();
                        Thread.Sleep(5000);
                        driver.FindElement(By.XPath("//*[@id='ui-id-16']")).Click();
                        Thread.Sleep(5000);
                        driver.FindElement(By.XPath("//*[@id='FullAddress']")).SendKeys(Address);
                        Thread.Sleep(1000);
                        gc.CreatePdf_WOP(orderNumber, "Address search", driver, "FL", "Collier");
                        driver.FindElement(By.XPath("//*[@id='SearchFullAddress']")).Click();
                        Thread.Sleep(6000);
                        gc.CreatePdf_WOP(orderNumber, "Address search Result", driver, "FL", "Collier");


                        try
                        {
                            IWebElement         MultiOwnerTable = driver.FindElement(By.Id("flex1"));
                            IList <IWebElement> MultiOwnerRow   = MultiOwnerTable.FindElements(By.TagName("tr"));
                            IList <IWebElement> MultiOwnerTD;
                            //string AlterNateID = "", PropertyAddress = "", LegalDescriptoin = "", YearBuilt = "";
                            foreach (IWebElement row1 in MultiOwnerRow)
                            {
                                MultiOwnerTD = row1.FindElements(By.TagName("td"));
                                if (MultiOwnerTD.Count != 0 && MultiOwnerTD.Count != 2 && MultiOwnerTD.Count != 1 && !row1.Text.Contains("Parcel No.") && MultiOwnerTD[1].Text.Trim() != "")
                                {
                                    parcelNumber    = MultiOwnerTD[1].Text;
                                    ownername       = MultiOwnerTD[3].Text;
                                    PropertyAddress = MultiOwnerTD[5].Text;
                                    string Multi = PropertyAddress + "~" + ownername;
                                    gc.insert_date(orderNumber, parcelNumber, 488, Multi, 1, DateTime.Now);
                                }
                            }
                            //GlobalClass.multiParcel_MiamiDade = "Yes";
                            HttpContext.Current.Session["multiParcel_Collier"] = "Yes";
                            driver.Quit();
                            return("MultiParcel");
                        }
                        catch { }
                    }
                    if (searchType == "ownername")
                    {
                        driver.Navigate().GoToUrl("http://www.collierappraiser.com/");
                        Thread.Sleep(2000);
                        IWebElement iframeElement = driver.FindElement(By.XPath("/html/frameset/frame"));
                        //now use the switch command
                        driver.SwitchTo().Frame(iframeElement);

                        IWebElement iframeElement1 = driver.FindElement(By.XPath("/html/frameset/frame[2]"));
                        //now use the switch command
                        driver.SwitchTo().Frame(iframeElement1);

                        driver.FindElement(By.XPath("//*[@id='AutoNumber3']/tbody/tr/td[3]/table/tbody/tr[4]/td/a")).Click();
                        Thread.Sleep(10000);
                        driver.SwitchTo().DefaultContent();
                        Thread.Sleep(2000);

                        IWebElement iframeElement2 = driver.FindElement(By.XPath("//*[@id='rbottom']"));
                        //now use the switch command
                        driver.SwitchTo().Frame(iframeElement2);
                        Thread.Sleep(2000);
                        //now use the switch command

                        driver.FindElement(By.XPath("//*[@id='a_searchlink']")).Click();
                        Thread.Sleep(6000);
                        driver.FindElement(By.XPath("//*[@id='ui-id-15']")).Click();
                        Thread.Sleep(6000);
                        driver.FindElement(By.XPath("//*[@id='Name1']")).SendKeys(ownername);
                        Thread.Sleep(1000);
                        gc.CreatePdf_WOP(orderNumber, "Owner search", driver, "FL", "Collier");
                        driver.FindElement(By.XPath("//*[@id='SearchName1']")).Click();
                        Thread.Sleep(6000);

                        gc.CreatePdf_WOP(orderNumber, "Owner search Result", driver, "FL", "Collier");
                        try
                        {
                            IWebElement         MultiOwnerTable = driver.FindElement(By.Id("flex1"));
                            IList <IWebElement> MultiOwnerRow   = MultiOwnerTable.FindElements(By.TagName("tr"));
                            IList <IWebElement> MultiOwnerTD;

                            //string AlterNateID = "", PropertyAddress = "", LegalDescriptoin = "", YearBuilt = "";
                            foreach (IWebElement row1 in MultiOwnerRow)
                            {
                                MultiOwnerTD = row1.FindElements(By.TagName("td"));
                                if (MultiOwnerTD.Count != 0 && MultiOwnerTD.Count != 2 && MultiOwnerTD.Count != 1 && !row1.Text.Contains("Parcel No.") && MultiOwnerTD[1].Text.Trim() != "")
                                {
                                    parcelNumber = MultiOwnerTD[1].Text;

                                    ownername       = MultiOwnerTD[3].Text;
                                    PropertyAddress = MultiOwnerTD[5].Text;


                                    string Multi = PropertyAddress + "~" + ownername;
                                    gc.insert_date(orderNumber, parcelNumber, 488, Multi, 1, DateTime.Now);
                                }
                            }

                            //GlobalClass.multiParcel_MiamiDade = "Yes";
                            HttpContext.Current.Session["multiParcel_Collier"] = "Yes";
                            driver.Quit();
                            return("MultiParcel");
                        }
                        catch { }
                    }

                    if (searchType == "parcel")
                    {
                        driver.Navigate().GoToUrl("http://www.collierappraiser.com/");
                        Thread.Sleep(2000);


                        IWebElement iframeElement = driver.FindElement(By.XPath("/html/frameset/frame"));
                        //now use the switch command
                        driver.SwitchTo().Frame(iframeElement);

                        IWebElement iframeElement1 = driver.FindElement(By.XPath("/html/frameset/frame[2]"));
                        //now use the switch command
                        driver.SwitchTo().Frame(iframeElement1);

                        driver.FindElement(By.XPath("//*[@id='AutoNumber3']/tbody/tr/td[3]/table/tbody/tr[4]/td/a")).Click();
                        Thread.Sleep(10000);
                        driver.SwitchTo().DefaultContent();
                        Thread.Sleep(2000);

                        IWebElement iframeElement2 = driver.FindElement(By.XPath("//*[@id='rbottom']"));
                        //now use the switch command
                        driver.SwitchTo().Frame(iframeElement2);
                        Thread.Sleep(2000);
                        //now use the switch command

                        driver.FindElement(By.XPath("//*[@id='a_searchlink']")).Click();
                        Thread.Sleep(6000);
                        driver.FindElement(By.XPath("//*[@id='ui-id-17']")).Click();
                        Thread.Sleep(6000);
                        driver.FindElement(By.XPath("//*[@id='ParcelID']")).SendKeys(parcelNumber);
                        Thread.Sleep(1000);
                        gc.CreatePdf(orderNumber, parcelNumber, "Parcel Search", driver, "FL", "Collier");
                        driver.FindElement(By.XPath("//*[@id='SearchParcelID']")).Click();
                        Thread.Sleep(6000);
                        gc.CreatePdf(orderNumber, parcelNumber, "Parcel Search Result", driver, "FL", "Collier");
                    }
                    try
                    {
                        IAlert alert = driver.SwitchTo().Alert();
                        if (alert.Text.Contains("No Parcels Found"))
                        {
                            HttpContext.Current.Session["Nodata_FLCollier"] = "Yes";
                            driver.Quit();
                            return("No Data Found");
                        }
                    }
                    catch { }
                    string SiteAdr = "", MapNo = "", Strapno = "", Section = "", Township = "", Range = "", Acres = "", MillageArea = "", Condo = "", UseCode = "", School = "", Other = "", Total = "", YearBuilt = "";

                    gc.CreatePdf(orderNumber, parcelNumber, "Property Deatil", driver, "FL", "Collier");
                    parcelNumber = driver.FindElement(By.XPath("//*[@id='ParcelID']")).Text;
                    ownername    = driver.FindElement(By.XPath("//*[@id='Name1']")).Text;
                    try
                    {
                        ownername = driver.FindElement(By.XPath("//*[@id='Name1']")).Text + " " + driver.FindElement(By.XPath("//*[@id='Name2']")).Text;
                    }
                    catch { }
                    try
                    {
                        SiteAdr = driver.FindElement(By.XPath("//*[@id='FullAddress']")).Text + " " + driver.FindElement(By.XPath("//*[@id='City']")).Text + " " + driver.FindElement(By.XPath("//*[@id='State']")).Text;
                    }
                    catch { }
                    MapNo       = driver.FindElement(By.XPath("//*[@id='MapNumber']")).Text;
                    Strapno     = driver.FindElement(By.XPath("//*[@id='StrapNumber']")).Text;
                    Section     = driver.FindElement(By.XPath("//*[@id='Section']")).Text;
                    Township    = driver.FindElement(By.XPath("//*[@id='Township']")).Text;
                    Range       = driver.FindElement(By.XPath("//*[@id='Range']")).Text;
                    Acres       = driver.FindElement(By.XPath("//*[@id='TotalAcres']")).Text;
                    MillageArea = driver.FindElement(By.XPath("//*[@id='MillageArea']")).Text;
                    Condo       = driver.FindElement(By.XPath("//*[@id='scDescription']")).Text;
                    UseCode     = driver.FindElement(By.XPath("//*[@id='ucDescription']")).Text;
                    School      = driver.FindElement(By.XPath("//*[@id='School']")).Text;
                    Other       = driver.FindElement(By.XPath("//*[@id='Other']")).Text;
                    Total       = driver.FindElement(By.XPath("//*[@id='Total']")).Text;

                    driver.FindElement(By.XPath("//*[@id='ui-id-2']")).Click();
                    Thread.Sleep(4000);
                    gc.CreatePdf(orderNumber, parcelNumber, "Property Summary", driver, "FL", "Collier");
                    try
                    {
                        YearBuilt = driver.FindElement(By.XPath("//*[@id='trBuilding1']/td[2]")).Text;
                    }
                    catch { }
                    string property = ownername + "~" + SiteAdr + "~" + MapNo + "~" + Strapno + "~" + Section + "~" + Township + "~" + Range + "~" + Acres + "~" + MillageArea + "~" + Condo + "~" + UseCode + "~" + School + "~" + Other + "~" + Total + "~" + YearBuilt;

                    gc.insert_date(orderNumber, parcelNumber, 469, property, 1, DateTime.Now);
                    driver.FindElement(By.XPath("//*[@id='ui-id-1']")).Click();
                    Thread.Sleep(4000);

                    string              LandValue = "", ImprovedValue = "", Marketvalue = "", SaveOurHome = "", AssessedValue = "", Homestead = "", SchoolTaxableValue = "", AdditionalHomestead = "", TaxableValue = "";
                    IWebElement         TaxHisTBD = driver.FindElement(By.XPath("//*[@id='PropSum']/table[6]/tbody/tr/td[3]/table/tbody"));
                    IList <IWebElement> TaxHisTRD = TaxHisTBD.FindElements(By.TagName("tr"));
                    IList <IWebElement> TaxHisTDD;

                    foreach (IWebElement row1 in TaxHisTRD)
                    {
                        TaxHisTDD = row1.FindElements(By.TagName("td"));
                        if (!row1.Text.Contains("Certified Tax Roll") && !row1.Text.Contains("(Subject") && row1.Text.Trim() != "" && TaxHisTDD.Count != 1)
                        {
                            LandValue     = TaxHisTDD[0].Text + "~" + LandValue;
                            ImprovedValue = TaxHisTDD[1].Text + "~" + ImprovedValue;
                        }
                    }

                    LandValue     = LandValue + "lk";
                    ImprovedValue = ImprovedValue + "lk";

                    LandValue     = LandValue.Replace("~lk", "");
                    ImprovedValue = ImprovedValue.Replace("~lk", "");
                    DBconnection dbconn = new DBconnection();
                    dbconn.ExecuteQuery("update  data_field_master set Data_Fields_Text='" + LandValue + "' where Id = '" + 470 + "'");
                    gc.insert_date(orderNumber, parcelNumber, 470, ImprovedValue, 1, DateTime.Now);
                    AssessmentTime = DateTime.Now.ToString("HH:mm:ss");

                    driver.Navigate().GoToUrl("https://collier.county-taxes.com/public");
                    Thread.Sleep(2000);

                    driver.FindElement(By.XPath("//*[@id='search-controls']/div/form[1]/div[1]/div/input")).SendKeys(parcelNumber);
                    gc.CreatePdf(orderNumber, parcelNumber, "Taxinfo", driver, "FL", "Collier");
                    driver.FindElement(By.XPath("//*[@id='search-controls']/div/form[1]/div[1]/div/span/button")).SendKeys(Keys.Enter);
                    Thread.Sleep(3000);
                    try
                    {
                        IWebElement ITaxSearch    = driver.FindElement(By.LinkText("Full bill history"));
                        string      strITaxSearch = ITaxSearch.GetAttribute("href");
                        driver.Navigate().GoToUrl(strITaxSearch);
                        Thread.Sleep(3000);
                        gc.CreatePdf(orderNumber, parcelNumber, "Full bill history", driver, "FL", "Collier");
                    }
                    catch { }

                    try
                    {
                        IWebElement         ITaxReal    = driver.FindElement(By.XPath("//*[@id='content']/div[1]/table"));
                        IList <IWebElement> ITaxRealRow = ITaxReal.FindElements(By.TagName("tr"));
                        IList <IWebElement> ITaxRealTd;
                        int k = 0;
                        foreach (IWebElement ItaxReal in ITaxRealRow)
                        {
                            ITaxRealTd = ItaxReal.FindElements(By.TagName("td"));
                            if ((k <= 2 && ItaxReal.Text.Contains("Annual Bill")) || ItaxReal.Text.Contains("Pay this bill:"))
                            {
                                string      yearbill      = ITaxRealTd[0].Text;
                                IWebElement ITaxBillCount = ITaxRealTd[0].FindElement(By.TagName("a"));
                                string      strTaxReal    = ITaxBillCount.GetAttribute("href");
                                strTaxRealestate.Add(strTaxReal);
                                try
                                {
                                    IWebElement ITaxBill = ITaxRealTd[3].FindElement(By.TagName("a"));
                                    string      BillTax  = ITaxBill.GetAttribute("href");
                                    gc.downloadfile(BillTax, orderNumber, parcelNumber, "Taxbill.pdf" + yearbill, "FL", "Collier");
                                }
                                catch
                                {
                                    IWebElement ITaxBill = ITaxRealTd[4].FindElement(By.TagName("a"));
                                    string      BillTax  = ITaxBill.GetAttribute("href");
                                    gc.downloadfile(BillTax, orderNumber, parcelNumber, "Taxbill.pdf" + yearbill, "FL", "Collier");
                                }
                                k++;
                            }
                        }

                        //Tax History Details

                        IWebElement         IBillHistorytable = driver.FindElement(By.XPath("//*[@id='content']/div[1]/table"));
                        IList <IWebElement> IBillHistoryRow   = IBillHistorytable.FindElements(By.TagName("tr"));
                        IList <IWebElement> IBillHistoryTD;
                        foreach (IWebElement bill in IBillHistoryRow)
                        {
                            IBillHistoryTD = bill.FindElements(By.TagName("td"));
                            if (IBillHistoryTD.Count != 0)
                            {
                                try
                                {
                                    strBill     = IBillHistoryTD[0].Text.Replace("\r\n", " ").TrimStart().TrimEnd();
                                    strBalance  = IBillHistoryTD[1].Text.Replace("\r\n", " ").TrimStart().TrimEnd();
                                    strBillDate = IBillHistoryTD[2].Text.Replace("\r\n", " ").TrimStart().TrimEnd();
                                    strBillPaid = IBillHistoryTD[3].Text.Replace("\r\n", " ").TrimStart().TrimEnd();
                                }
                                catch
                                {
                                    strBillDate = "";
                                    strBillPaid = "";
                                }
                                if (strBillPaid.Contains("Print (PDF)"))
                                {
                                    strBillPaid = "";
                                }
                                string strTaxHistory = strBill + "~" + strBalance + "~" + strBillDate + "~" + strBillPaid;
                                gc.insert_date(orderNumber, parcelNumber, 471, strTaxHistory, 1, DateTime.Now);
                            }
                        }

                        IWebElement         IBillHistoryfoottable = driver.FindElement(By.XPath("//*[@id='content']/div[1]/table/tfoot"));
                        IList <IWebElement> IBillHistoryfootRow   = IBillHistoryfoottable.FindElements(By.TagName("tr"));
                        IList <IWebElement> IBillHistoryfootTD;
                        foreach (IWebElement bill in IBillHistoryRow)
                        {
                            IBillHistoryfootTD = bill.FindElements(By.TagName("th"));
                            if (IBillHistoryfootTD.Count != 0 && bill.Text.Contains("Total"))
                            {
                                try
                                {
                                    strFBill     = IBillHistoryfootTD[0].Text.Replace("\r\n", " ").TrimStart().TrimEnd();
                                    strFBalance  = IBillHistoryfootTD[1].Text.Replace("\r\n", " ").TrimStart().TrimEnd();
                                    strFBillDate = IBillHistoryfootTD[2].Text.Replace("\r\n", " ").TrimStart().TrimEnd();
                                    strFBillPaid = IBillHistoryfootTD[3].Text.Replace("\r\n", " ").TrimStart().TrimEnd();
                                }
                                catch
                                {
                                    strFBillDate = "";
                                    strFBillPaid = "";
                                }
                                if (strBillPaid.Contains("Print (PDF)"))
                                {
                                    strBillPaid = "";
                                }
                                string strTaxHistory = strFBill + "~" + strFBalance + "~" + strFBillDate + "~" + strFBillPaid;
                                gc.insert_date(orderNumber, parcelNumber, 471, strTaxHistory, 1, DateTime.Now);
                            }
                        }
                        foreach (string real in strTaxRealestate)
                        {
                            driver.Navigate().GoToUrl(real);
                            Thread.Sleep(4000);

                            try
                            {
                                TaxYear = driver.FindElement(By.XPath("//*[@id='content']/div[1]/div[8]/div/div[1]")).Text;
                                TaxYear = WebDriverTest.After(TaxYear, "Real Estate").Trim();
                                string   s     = TaxYear;
                                string[] words = TaxYear.Split(' ');
                                TaxYear = words[0];
                            }
                            catch
                            {
                                TaxYear = driver.FindElement(By.XPath("//*[@id='content']/div[1]/div[7]/div/div[1]")).Text;
                                TaxYear = WebDriverTest.After(TaxYear, "Real Estate").Trim();
                                string   s     = TaxYear;
                                string[] words = TaxYear.Split(' ');
                                TaxYear = words[0];
                            }

                            gc.CreatePdf(orderNumber, parcelNumber, "Tax details" + TaxYear, driver, "FL", "Collier");
                            IWebElement multitableElement3;
                            try
                            {
                                multitableElement3 = driver.FindElement(By.XPath("//*[@id='content']/div[1]/div[8]/div/table[2]/tbody"));
                            }
                            catch
                            {
                                multitableElement3 = driver.FindElement(By.XPath("//*[@id='content']/div[1]/div[7]/div/table[2]/tbody"));
                            }
                            IList <IWebElement> multitableRow3 = multitableElement3.FindElements(By.TagName("tr"));

                            IList <IWebElement> multirowTD3;
                            foreach (IWebElement row in multitableRow3)
                            {
                                multirowTD3 = row.FindElements(By.TagName("td"));
                                if (multirowTD3.Count != 1 && multirowTD3[1].Text.Trim() != "")
                                {
                                    string tax_distri = TaxYear + "~" + multirowTD3[0].Text.Trim() + "~" + "Ad Valorem" + "~" + multirowTD3[1].Text.Trim() + "~" + multirowTD3[2].Text.Trim() + "~" + multirowTD3[3].Text.Trim() + "~" + multirowTD3[4].Text.Trim() + "~" + "" + "~" + multirowTD3[5].Text.Trim();
                                    gc.insert_date(orderNumber, parcelNumber, 472, tax_distri, 1, DateTime.Now);
                                }
                            }

                            //total advalorem
                            IWebElement multitableElement31;
                            try
                            {
                                multitableElement31 = driver.FindElement(By.XPath("//*[@id='content']/div[1]/div[8]/div/table[2]/tfoot"));
                            }
                            catch
                            {
                                multitableElement31 = driver.FindElement(By.XPath("//*[@id='content']/div[1]/div[7]/div/table[2]/tfoot"));
                            }
                            IList <IWebElement> multitableRow31 = multitableElement31.FindElements(By.TagName("tr"));

                            IList <IWebElement> multirowTD31;
                            foreach (IWebElement row in multitableRow31)
                            {
                                multirowTD31 = row.FindElements(By.TagName("td"));
                                if (multirowTD31.Count != 1)
                                {
                                    string tax_distri1 = TaxYear + "~" + "Total:" + "~" + "Ad Valorem" + "~" + multirowTD31[0].Text.Trim() + "~" + "" + "~" + "" + "~" + "" + "~" + "" + "~" + multirowTD31[1].Text.Trim();
                                    gc.insert_date(orderNumber, parcelNumber, 472, tax_distri1, 1, DateTime.Now);
                                }
                            }
                            //  Non - Ad Valorem
                            try
                            {
                                IWebElement multitableElement32;
                                try
                                {
                                    multitableElement32 = driver.FindElement(By.XPath("//*[@id='content']/div[1]/div[8]/div/table[3]/tbody"));
                                }
                                catch
                                {
                                    multitableElement32 = driver.FindElement(By.XPath("//*[@id='content']/div[1]/div[7]/div/table[3]/tbody"));
                                }
                                IList <IWebElement> multitableRow32 = multitableElement32.FindElements(By.TagName("tr"));
                                IList <IWebElement> multirowTD32;
                                foreach (IWebElement row in multitableRow32)
                                {
                                    multirowTD32 = row.FindElements(By.TagName("td"));
                                    if (multirowTD32.Count != 1 && multirowTD32[0].Text.Trim() != "")
                                    {
                                        string tax_distri2 = TaxYear + "~" + multirowTD32[0].Text.Trim() + "~" + "Non-Ad Valorem " + "~" + "" + "~" + "" + "~" + "" + "~" + "" + "~" + multirowTD32[1].Text.Trim() + "~" + multirowTD32[2].Text.Trim();
                                        gc.insert_date(orderNumber, parcelNumber, 472, tax_distri2, 1, DateTime.Now);
                                    }
                                }
                                //total non-advalorem

                                IWebElement multitableElement33;
                                try
                                {
                                    multitableElement33 = driver.FindElement(By.XPath("//*[@id='content']/div[1]/div[8]/div/table[3]/tfoot"));
                                }
                                catch
                                {
                                    multitableElement33 = driver.FindElement(By.XPath("//*[@id='content']/div[1]/div[7]/div/table[3]/tfoot"));
                                }
                                IList <IWebElement> multitableRow33 = multitableElement33.FindElements(By.TagName("tr"));
                                IList <IWebElement> multirowTD33;
                                foreach (IWebElement row in multitableRow33)
                                {
                                    multirowTD33 = row.FindElements(By.TagName("td"));
                                    if (multirowTD33.Count != 0)
                                    {
                                        string tax_distri1 = TaxYear + "~" + "Total:" + "~" + "Non-Ad Valorem " + "~" + "" + "~" + "" + "~" + "" + "~" + "" + "~" + "" + "~" + multirowTD33[0].Text.Trim();
                                        gc.insert_date(orderNumber, parcelNumber, 472, tax_distri1, 1, DateTime.Now);
                                    }
                                }
                            }
                            catch { }
                            //  Taxing_authority~Tax_type~Millage~Assessed~Exemption~Taxable~Rate~Tax
                            //Tax info
                            try
                            {
                                TaxAmount  = driver.FindElement(By.XPath("//*[@id='content']/div[1]/div[7]/div/p")).Text.Replace("Combined taxes and assessments:", "");
                                PaidAmount = driver.FindElement(By.XPath("//*[@id='content']/div[1]/div[7]/div/div[6]/div/div[1]/div/div")).Text;
                                PaidAmount = PaidAmount.Replace("\r\n", "&");
                                PaidAmount = WebDriverTest.Before(PaidAmount, "&");
                                PaidAmount = WebDriverTest.After(PaidAmount, "$").Trim();

                                ReceiptNumber = driver.FindElement(By.XPath("//*[@id='content']/div[1]/div[7]/div/div[6]/div/div[1]/div/div/div")).Text.Replace("Receipt", "");
                                IWebElement         tbmulti = driver.FindElement(By.XPath("//*[@id='content']/div[1]/div[7]/div/table[1]/tbody"));
                                IList <IWebElement> TRmulti = tbmulti.FindElements(By.TagName("tr"));
                                IList <IWebElement> TDmulti;
                                foreach (IWebElement row in TRmulti)
                                {
                                    TDmulti = row.FindElements(By.TagName("td"));
                                    if (TDmulti.Count != 0)
                                    {
                                        Account_number = TDmulti[0].Text;
                                        string Escro_Code = TDmulti[2].Text;
                                        Millage_Code = TDmulti[3].Text;

                                        string tax_info1 = Account_number + "~" + Millage_Code + "~" + Escro_Code + "~" + TaxYear + "~" + TaxAmount + "~" + PaidAmount + "~" + ReceiptNumber + "~" + "Doug Belden, Tax Collector P.O. Box 30012 Tampa, Florida 33630-3012";

                                        gc.insert_date(orderNumber, parcelNumber, 473, tax_info1, 1, DateTime.Now);
                                    }
                                }
                            }
                            catch
                            {
                                TaxAmount = driver.FindElement(By.XPath("//*[@id='content']/div[1]/div[8]/div/p")).Text.Replace("Combined taxes and assessments:", "");

                                PaidAmount = driver.FindElement(By.XPath("//*[@id='content']/div[1]/div[8]/div/div[3]")).Text;
                                if (PaidAmount.Contains("Pay this bill"))
                                {
                                    PaidAmount    = "";
                                    ReceiptNumber = "";
                                }
                                else
                                {
                                    PaidAmount = PaidAmount.Replace("\r\n", "&");
                                    var PaidAmount1 = PaidAmount.Split('&');
                                    PaidAmount    = PaidAmount1[0];
                                    PaidAmount    = WebDriverTest.After(PaidAmount, "$").Trim();
                                    ReceiptNumber = PaidAmount1[1];
                                }

                                IWebElement         tbmulti = driver.FindElement(By.XPath("//*[@id='content']/div[1]/div[8]/div/table[1]/tbody"));
                                IList <IWebElement> TRmulti = tbmulti.FindElements(By.TagName("tr"));

                                IList <IWebElement> TDmulti;
                                foreach (IWebElement row in TRmulti)
                                {
                                    TDmulti = row.FindElements(By.TagName("td"));
                                    if (TDmulti.Count != 0)
                                    {
                                        Account_number = TDmulti[0].Text;
                                        string Escro_Code = TDmulti[2].Text;
                                        Millage_Code = TDmulti[3].Text;
                                        string tax_info1 = Account_number + "~" + Millage_Code + "~" + Escro_Code + "~" + TaxYear + "~" + TaxAmount + "~" + PaidAmount + "~" + ReceiptNumber + "~" + "Doug Belden, Tax Collector P.O. Box 30012 Tampa, Florida 33630-3012";
                                        gc.insert_date(orderNumber, parcelNumber, 473, tax_info1, 1, DateTime.Now);
                                    }
                                }
                            }
                            string IfPaidBy = "", PlesePay = "", DueDate = "", deli = "";
                            try
                            {
                                IWebElement         multitableElement26 = driver.FindElement(By.XPath("//*[@id='content']/div[1]/div[8]/div/table[4]/tbody"));
                                IList <IWebElement> multitableRow26     = multitableElement26.FindElements(By.TagName("tr"));

                                IList <IWebElement> multirowTD26;
                                foreach (IWebElement row in multitableRow26)
                                {
                                    multirowTD26 = row.FindElements(By.TagName("td"));
                                    int iRowsCount = multirowTD26.Count;
                                    for (int n = 0; n < iRowsCount; n++)
                                    {
                                        if ((!multirowTD26[n].Text.Contains("Face Amt")) && (!multirowTD26[n].Text.Contains("Certificate")))
                                        {
                                            IfPaidBy = multirowTD26[n].Text.Replace("\r\n", "~");
                                            var IfpaySplit = IfPaidBy.Split('~');
                                            IfPaidBy = IfpaySplit[0];
                                            PlesePay = IfpaySplit[1];
                                            if (PlesePay == "$0.00")
                                            {
                                                deli = "paid";
                                            }
                                            else
                                            {
                                                deli = "deliquent";
                                            }
                                            DueDate = TaxYear + "~" + deli + "~" + IfPaidBy + "~" + PlesePay;
                                            gc.insert_date(orderNumber, parcelNumber, 474, DueDate, 1, DateTime.Now);
                                        }
                                    }
                                }
                            }
                            //If_paid_by~Please_Pay
                            catch
                            {
                                IWebElement         multitableElement26 = driver.FindElement(By.XPath("//*[@id='content']/div[1]/div[7]/div/table[4]/tbody"));
                                IList <IWebElement> multitableRow26     = multitableElement26.FindElements(By.TagName("tr"));

                                IList <IWebElement> multirowTD26;
                                foreach (IWebElement row in multitableRow26)
                                {
                                    multirowTD26 = row.FindElements(By.TagName("td"));
                                    int iRowsCount = multirowTD26.Count;
                                    for (int n = 0; n < iRowsCount; n++)
                                    {
                                        if ((!multirowTD26[n].Text.Contains("Face Amt")) && (!multirowTD26[n].Text.Contains("Certificate")))
                                        {
                                            IfPaidBy = multirowTD26[n].Text.Replace("\r\n", "~");
                                            var IfpaySplit = IfPaidBy.Split('~');
                                            IfPaidBy = IfpaySplit[0];
                                            PlesePay = IfpaySplit[1];
                                            if (PlesePay == "$0.00")
                                            {
                                                deli = "paid";
                                            }
                                            else
                                            {
                                                deli = "deliquent";
                                            }
                                            DueDate = TaxYear + "~" + deli + "~" + IfPaidBy + "~" + PlesePay;
                                            gc.insert_date(orderNumber, parcelNumber, 474, DueDate, 1, DateTime.Now);
                                        }
                                    }
                                }
                            }

                            //*[@id="content"]/div[1]/div[3]/div[1]/ul/li[1]/a
                            driver.FindElement(By.XPath("//*[@id='content']/div[1]/div[3]/div[1]/ul/li[1]/a")).Click();
                            Thread.Sleep(5000);
                            gc.CreatePdf(orderNumber, parcelNumber, "parcel details" + TaxYear, driver, "FL", "Collier");
                        }
                    }
                    catch { }
                    TaxTime     = DateTime.Now.ToString("HH:mm:ss");
                    LastEndTime = DateTime.Now.ToString("HH:mm:ss");
                    gc.insert_TakenTime(orderNumber, "FL", "Collier", StartTime, AssessmentTime, TaxTime, CitytaxTime, LastEndTime);

                    driver.Quit();
                    gc.mergpdf(orderNumber, "FL", "Collier");
                    //gc.MMREM_Template(orderNumber, parcelNumber, "", driver, "FL", "Collier", "138", "4");
                    return("Data Inserted Successfully");
                }
                catch (Exception ex)
                {
                    driver.Quit();
                    GlobalClass.LogError(ex, orderNumber);
                    throw ex;
                }
            }
        }
예제 #2
0
        public string FTP_Orange_Ca(string Address, string unitnumber, string ownernm, string parcelNumber, string searchType, string orderNumber, string directParcel)
        {
            GlobalClass.global_orderNo             = orderNumber;
            HttpContext.Current.Session["orderNo"] = orderNumber;
            GlobalClass.global_parcelNo            = parcelNumber;
            int    b = 1;
            string StartTime = "", AssessmentTime = "", TaxTime = "", CitytaxTime = "", LastEndTime = "";
            int    i = 0, j = 0, k = 0, a = 1;
            var    driverService = PhantomJSDriverService.CreateDefaultService();

            driverService.HideCommandPromptWindow = true;
            // driver = new ChromeDriver();
            //driver = new PhantomJSDriver();
            using (driver = new PhantomJSDriver())
            {
                try
                {
                    StartTime = DateTime.Now.ToString("HH:mm:ss");

                    driver.Navigate().GoToUrl("http://tax.ocgov.com/tcweb/search_page.asp");
                    if (searchType == "titleflex")
                    {
                        gc.TitleFlexSearch(orderNumber, "", ownernm, Address, "CA", "Orange");
                        if ((HttpContext.Current.Session["TitleFlex_Search"] != null && HttpContext.Current.Session["TitleFlex_Search"].ToString() == "Yes"))
                        {
                            driver.Quit();
                            return("MultiParcel");
                        }
                        else if (HttpContext.Current.Session["titleparcel"].ToString() == "")
                        {
                            HttpContext.Current.Session["Zero_Orange"] = "Zero";
                            driver.Quit();
                            return("No Data Found");
                        }
                        parcelNumber = HttpContext.Current.Session["titleparcel"].ToString();
                        searchType   = "parcel";
                    }
                    if (searchType == "address")
                    {//*[@id="col2"]/div[2]/table/tbody/tr[2]/td/div/table/tbody/tr[6]/td/table/tbody/tr[10]/td[2]/input
                        driver.FindElement(By.Name("streetname")).SendKeys(Address);
                        gc.CreatePdf_WOP(orderNumber, "AddressSearch", driver, "CA", "Orange");
                        driver.FindElement(By.Name("s_address")).SendKeys(Keys.Enter);
                        Thread.Sleep(3000);
                        try
                        {
                            string Nodata = driver.FindElement(By.XPath("//*[@id='col2']/div[2]/table/tbody/tr[2]/td/div/table/tbody/tr[1]/td/strong/font/text()[1]")).Text;
                            if (Nodata.Contains("No address was found"))
                            {
                                HttpContext.Current.Session["Zero_Orange"] = "Zero";
                                driver.Quit();
                                return("No Data Found");
                            }
                        }
                        catch { }
                        gc.CreatePdf_WOP(orderNumber, "AddressSearchResult", driver, "CA", "Orange");
                        try
                        {//*[@id="col2"]/div[2]/table/tbody/tr[3]/td/table/tbody/tr[6]/td/table/tbody/tr[3]/td[1]
                            string Pay_review_result = driver.FindElement(By.XPath("//*[@id='col2']/div[2]/table/tbody/tr[3]/td/table/tbody/tr[6]/td/table/tbody/tr[3]/td[1]")).Text;
                            if (Pay_review_result.Contains("Search Results: 1-1 of 1 records"))
                            {
                                driver.FindElement(By.XPath("//*[@id='col2']/div[2]/table/tbody/tr[3]/td/table/tbody/tr[7]/td/table/tbody/tr[2]/td[2]/a")).SendKeys(Keys.Enter);
                                Thread.Sleep(3000);
                            }
                            multicount = gc.Between(Pay_review_result, "of ", " records");
                        }
                        catch { }
                        try
                        {
                            if (Pay_review_result.Trim() != "Search Results: 1-1 of 1 records" && Convert.ToInt32(multicount) <= 20)
                            {
                                IWebElement         MProperty_addrs = driver.FindElement(By.XPath("//*[@id='col2']/div[2]/table/tbody/tr[3]/td/table/tbody/tr[7]/td/table/tbody"));
                                IList <IWebElement> Mproperty       = MProperty_addrs.FindElements(By.TagName("tr"));
                                IList <IWebElement> Mpropertyid;
                                foreach (IWebElement Mpropertyrow in Mproperty)
                                {
                                    Mpropertyid = Mpropertyrow.FindElements(By.TagName("td"));
                                    if (Mpropertyid.Count != 0 && !Mpropertyrow.Text.Contains("Property or Business Address") && Mpropertyid[0].Text.Contains(Address.ToUpper()))
                                    {
                                        if (Mcount < 20)
                                        {
                                            Address     = Mpropertyid[0].Text;
                                            parcelno    = Mpropertyid[1].Text;
                                            Parcelclick = Mpropertyid[1].FindElement(By.TagName("a"));
                                            Parcelhref  = Parcelclick.GetAttribute("href");
                                            gc.insert_date(orderNumber, parcelno, 553, Address, 1, DateTime.Now);
                                        }
                                        Mcount++;
                                    }
                                }
                            }
                            if (Mcount == 1)
                            {
                                driver.Navigate().GoToUrl(Parcelhref);
                                Thread.Sleep(2000);
                            }
                            if (Mcount > 20 || Convert.ToInt32(multicount) > 20)
                            {
                                HttpContext.Current.Session["multiParcel_Orange_Multicount"] = "Maximum";
                                driver.Quit();
                                return("Maximum");
                            }
                            if (Mcount > 1 && Mcount < 20)
                            {
                                HttpContext.Current.Session["multiparcel_Orange"] = "Yes";
                                driver.Quit();
                                return("MultiParcel");
                            }
                            gc.CreatePdf_WOP(orderNumber, "MultiAddressSearch", driver, "CA", "Orange");
                        }
                        catch { }
                    }
                    if (searchType == "parcel")
                    {
                        if ((HttpContext.Current.Session["titleparcel"] != null))
                        {
                            parcelNumber = HttpContext.Current.Session["titleparcel"].ToString();
                        }
                        driver.FindElement(By.Name("t_parcel_no")).SendKeys(parcelNumber);
                        gc.CreatePdf(orderNumber, parcelNumber, "Parcelsearch", driver, "CA", "Orange");
                        driver.FindElement(By.Name("s_parcel")).SendKeys(Keys.Enter);
                        Thread.Sleep(3000);
                    }
                    string Parcel = driver.FindElement(By.XPath("//*[@id='col2']/div[2]/table/tbody/tr[3]/td/table/tbody/tr[2]/td/table/tbody/tr[3]/td[1]")).Text;
                    Parcel = GlobalClass.After(Parcel, "Parcel Number :").Trim();
                    gc.CreatePdf(orderNumber, Parcel, "property details", driver, "CA", "Orange");
                    IList <IWebElement> tables = driver.FindElements(By.XPath("//*[@id='col2']/div[2]/table/tbody/tr[3]/td/table/tbody/tr[2]/td/table/tbody/tr"));
                    int count = tables.Count;
                    foreach (IWebElement tab in tables)
                    {
                        if (tab.Text.Contains("Current Year and Unpaid Non-Delinquent Tax Bills"))
                        {
                            IList <IWebElement> ITaxRealRowQ = tab.FindElements(By.TagName("tr"));
                            IList <IWebElement> ITaxRealTdQ;
                            foreach (IWebElement ItaxReal in ITaxRealRowQ)
                            {
                                ITaxRealTdQ = ItaxReal.FindElements(By.TagName("td"));
                                if (!ItaxReal.Text.Contains("Current Year and Unpaid Non-Delinquent Tax Bills") && !ItaxReal.Text.Contains("Parcel Number") && ITaxRealTdQ[0].Text.Trim() != "")
                                {
                                    IWebElement ITaxBillCount = ITaxRealTdQ[0].FindElement(By.TagName("a"));
                                    string      strTaxReal    = ITaxBillCount.GetAttribute("href");
                                    strTaxRealestate.Add(strTaxReal);
                                }
                            }
                        }
                    }
                    IList <IWebElement> tables1 = driver.FindElements(By.XPath("//*[@id='col2']/div[2]/table/tbody/tr[3]/td/table/tbody/tr[2]/td/table/tbody/tr"));
                    int count1 = tables.Count;
                    foreach (IWebElement tab in tables1)
                    {
                        if (tab.Text.Contains("Previous Year Tax Payment Information"))
                        {
                            IList <IWebElement> ITaxRealRowQ1 = tab.FindElements(By.TagName("tr"));
                            IList <IWebElement> ITaxRealTdQ1;
                            foreach (IWebElement ItaxReal1 in ITaxRealRowQ1)
                            {
                                ITaxRealTdQ1 = ItaxReal1.FindElements(By.TagName("td"));
                                if (ITaxRealTdQ1.Count == 4)
                                {
                                    try
                                    {
                                        IWebElement ITaxBillCount = ITaxRealTdQ1[0].FindElement(By.TagName("a"));
                                        string      strTaxReal    = ITaxBillCount.GetAttribute("href");
                                        strTaxRealestate.Add(strTaxReal);
                                    }
                                    catch { }
                                }
                            }
                        }
                    }
                    IList <IWebElement> tables2 = driver.FindElements(By.XPath("//*[@id='col2']/div[2]/table/tbody/tr[3]/td/table/tbody/tr[2]/td/table/tbody/tr"));
                    int count2 = tables.Count;
                    foreach (IWebElement tab in tables2)
                    {
                        if (tab.Text.Contains("Parcel Number Tax Default No."))
                        {
                            IList <IWebElement> ITaxRealRowQ2 = tab.FindElements(By.TagName("tr"));
                            IList <IWebElement> ITaxRealTdQ2;
                            foreach (IWebElement ItaxReal1 in ITaxRealRowQ2)
                            {
                                ITaxRealTdQ2 = ItaxReal1.FindElements(By.TagName("td"));
                                if (ITaxRealTdQ2.Count == 4 && !ItaxReal1.Text.Contains("Tax Default No") && ITaxRealTdQ2[0].Text.Trim() != "" && ITaxRealTdQ2[1].Text.Trim() != "")
                                {
                                    IWebElement ITaxBillCount = ITaxRealTdQ2[1].FindElement(By.TagName("a"));
                                    string      strTaxReal    = ITaxBillCount.GetAttribute("href");
                                    strTaxRealestate1.Add(strTaxReal);
                                }
                            }
                        }
                    }
                    //deliquent tax
                    foreach (string real1 in strTaxRealestate1)
                    {
                        driver.Navigate().GoToUrl(real1);
                        Thread.Sleep(4000);
                        gc.CreatePdf(orderNumber, Parcel, "Deliquent tax", driver, "CA", "Orange");
                        string tax_no = "", deli_year = "", status = "";
                        tax_no    = driver.FindElement(By.XPath("//*[@id='col2']/div[2]/table/tbody/tr[3]/td/table/tbody/tr[2]/td/table/tbody/tr[2]/td[2]")).Text;
                        deli_year = driver.FindElement(By.XPath("//*[@id='col2']/div[2]/table/tbody/tr[3]/td/table/tbody/tr[2]/td/table/tbody/tr[3]/td[2] ")).Text;
                        status    = driver.FindElement(By.XPath("//*[@id='col2']/div[2]/table/tbody/tr[3]/td/table/tbody/tr[2]/td/table/tbody/tr[4]/td[2] ")).Text;

                        IWebElement         multitableElement11 = driver.FindElement(By.XPath("//*[@id='col2']/div[2]/table/tbody/tr[4]/td/form/table/tbody"));
                        IList <IWebElement> multitableRow11 = multitableElement11.FindElements(By.TagName("tr"));
                        IList <IWebElement> multirowTD11;
                        //   Tax Default No.(TDN)~First Year of Delinquency~Tax Status~TDN Parcels~Roll Year~Taxes~Basic Penalties~Cost~Additional Penalties~Total
                        foreach (IWebElement row in multitableRow11)
                        {
                            try
                            {
                                multirowTD11 = row.FindElements(By.TagName("td"));
                                if (multirowTD11[0].Text.Trim() != "" && !row.Text.Contains("TDN Parcels"))
                                {
                                    if (multirowTD11.Count == 7)
                                    {
                                        string tax_deli1 = tax_no + "~" + deli_year + "~" + status + "~" + multirowTD11[0].Text + "~" + multirowTD11[1].Text + "~" + multirowTD11[2].Text + "~" + multirowTD11[3].Text + "~" + multirowTD11[4].Text + "~" + multirowTD11[5].Text + "~" + multirowTD11[6].Text;
                                        gc.insert_date(orderNumber, Parcel, 565, tax_deli1, 1, DateTime.Now);
                                    }
                                    if (multirowTD11.Count == 4)
                                    {
                                        string tax_deli1 = tax_no + "~" + deli_year + "~" + status + "~" + multirowTD11[0].Text + "~" + "" + "~" + "" + "~" + "" + "~" + "" + "~" + "" + "~" + multirowTD11[3].Text;
                                        gc.insert_date(orderNumber, Parcel, 565, tax_deli1, 1, DateTime.Now);
                                    }
                                    if (multirowTD11.Count == 6)
                                    {
                                        string tax_deli1 = tax_no + "~" + deli_year + "~" + status + "~" + multirowTD11[0].Text + "~" + "" + "~" + "" + "~" + "" + "~" + "" + "~" + "" + "~" + multirowTD11[5].Text;
                                        gc.insert_date(orderNumber, Parcel, 565, tax_deli1, 1, DateTime.Now);
                                    }
                                }
                            }
                            catch { }
                        }
                    }
                    string address = "", taxrate = "", rolltype = "", parcelnumber = "", fiscal = "", fiscal_year = "";
                    //property,assessment,taxinfo
                    int c = 1;
                    foreach (string real in strTaxRealestate)
                    {
                        driver.Navigate().GoToUrl(real);
                        Thread.Sleep(4000);
                        gc.CreatePdf(orderNumber, Parcel, "taxinfo details" + c, driver, "CA", "Orange");
                        c++;
                        try
                        {
                            try
                            {
                                fiscal = driver.FindElement(By.XPath("//*[@id='col2']/div[2]/table/tbody/tr[1]/td")).Text;
                                if (fiscal == "Property Tax Information")
                                {
                                }
                                else
                                {
                                    fiscal_year = GlobalClass.After(fiscal, "FISCAL YEAR").Trim();
                                }
                            }
                            catch { }
                            try
                            {
                                rolltype = driver.FindElement(By.XPath("//*[@id='col2']/div[2]/table/tbody/tr[3]/td/table/tbody/tr[5]/td[2]")).Text;
                            }
                            catch
                            {
                                rolltype = "";
                            }
                            if (rolltype == "Secured")
                            {
                                if (a == 1)
                                {
                                    try
                                    {
                                        IWebElement         multitableElement1 = driver.FindElement(By.XPath("//*[@id='col2']/div[2]/table/tbody/tr[3]/td/table/tbody"));
                                        IList <IWebElement> multitableRow1     = multitableElement1.FindElements(By.TagName("tr"));
                                        IList <IWebElement> multirowTD1;

                                        foreach (IWebElement row in multitableRow1)
                                        {
                                            multirowTD1 = row.FindElements(By.TagName("td"));
                                            if (multirowTD1[0].Text.Trim() != "")
                                            {
                                                if (i == 0)
                                                {
                                                    parcelnumber = multirowTD1[1].Text;
                                                    parcelnumber = GlobalClass.Before(parcelnumber, "View Original Bill").Trim();
                                                }
                                                if (i == 1)
                                                {
                                                    address = multirowTD1[1].Text;
                                                }
                                                if (i == 2)
                                                {
                                                    taxrate = multirowTD1[1].Text;
                                                }
                                                if (i == 3)
                                                {
                                                    rolltype = multirowTD1[1].Text;
                                                }
                                                i++;
                                            }
                                        }
                                    }
                                    catch { }
                                    //property
                                    gc.insert_date(orderNumber, Parcel, 548, address + "~" + taxrate, 1, DateTime.Now);
                                    //Assessment
                                    string              Land_Value = "", Mineral_Rights = "", Improvement_Value = "", Personal_Property = "", Others = "", Total_Assessed_Value = "", Homeowner_Exemption = "", Net_Assessed_Value = "";
                                    IWebElement         multitableElement = driver.FindElement(By.XPath("//*[@id='col2']/div[2]/table/tbody/tr[7]/td/table/tbody"));
                                    IList <IWebElement> multitableRow     = multitableElement.FindElements(By.TagName("tr"));
                                    IList <IWebElement> multirowTD;
                                    foreach (IWebElement row in multitableRow)
                                    {
                                        multirowTD = row.FindElements(By.TagName("td"));
                                        if (multirowTD.Count == 4)
                                        {
                                            if ((multirowTD[2].Text.Trim() != "") && !row.Text.Contains("Assessed Values and Exemptions") && !row.Text.Contains("Description") && multirowTD.Count == 4 && !row.Text.Contains("Total Due and Payable"))
                                            {
                                                if (k == 0)
                                                {
                                                    Land_Value = multirowTD[2].Text;
                                                }
                                                if (k == 1)
                                                {
                                                    Mineral_Rights = multirowTD[2].Text;
                                                }
                                                if (k == 2)
                                                {
                                                    Improvement_Value = multirowTD[2].Text;
                                                }
                                                if (k == 3)
                                                {
                                                    Personal_Property = multirowTD[2].Text;
                                                }
                                                if (k == 4)
                                                {
                                                    Others = multirowTD[2].Text;
                                                }
                                                if (k == 5)
                                                {
                                                    Total_Assessed_Value = multirowTD[2].Text;
                                                }
                                                if (k == 6)
                                                {
                                                    Homeowner_Exemption = multirowTD[2].Text;
                                                }
                                                if (k == 7)
                                                {
                                                    Net_Assessed_Value = multirowTD[2].Text;
                                                }
                                                k++;
                                            }
                                        }
                                    }
                                    string assessment_details = Land_Value + "~" + Mineral_Rights + "~" + Improvement_Value + "~" + Personal_Property + "~" + Others + "~" + Total_Assessed_Value + "~" + Homeowner_Exemption + "~" + Net_Assessed_Value;
                                    gc.insert_date(orderNumber, Parcel, 549, assessment_details, 1, DateTime.Now);
                                }
                                a++;
                            }
                            else
                            {
                                try
                                {
                                    IWebElement         multitableElement = driver.FindElement(By.XPath("//*[@id='col2']/div[2]/table/tbody"));
                                    IList <IWebElement> multitableRow     = multitableElement.FindElements(By.TagName("tr"));
                                    IList <IWebElement> multirowTD;
                                    j = 0;
                                    foreach (IWebElement row in multitableRow)
                                    {
                                        multirowTD = row.FindElements(By.TagName("td"));
                                        if (multirowTD[0].Text.Trim() != "" && !row.Text.Contains("Current Year and Unpaid Non-Delinquent Tax Bills") && multirowTD.Count == 2)
                                        {
                                            if (j == 0)
                                            {
                                                parcelnumber = multirowTD[1].Text;
                                                parcelnumber = GlobalClass.Before(parcelnumber, "View Bill").Trim();
                                            }
                                            if (j == 1)
                                            {
                                                address = multirowTD[1].Text;
                                            }
                                            if (j == 2)
                                            {
                                                taxrate = multirowTD[1].Text;
                                            }
                                            if (j == 3)
                                            {
                                                rolltype = multirowTD[1].Text;
                                                if (rolltype.Contains("("))
                                                {
                                                    rolltype = GlobalClass.Before(rolltype, "(").Trim();
                                                }
                                            }
                                            j++;
                                        }
                                    }
                                }
                                catch { }
                            }
                            IWebElement tbmulti;
                            //Parcel Number~Tax Year~Tax Type~Installment Type~Due Date~Tax Status~Amount Due~Remarks~Total Due Amount~Total Amt Paid~Paid Date~Paid Amount
                            string InstallmentType = "", Due_Date = "", Tax_Status = "", Amount_Due = "", Remarks = "", Total_Due_Amount = "", Total_Amt_Paid = "", Paid_Amount = "", Paid_Date = "";
                            string taxinfo = "", taxinfo1 = "", taxinfo2 = "";
                            try
                            {
                                tbmulti = driver.FindElement(By.XPath("//*[@id='col2']/div[2]/table/tbody/tr[4]/td/table/tbody"));
                            }
                            catch
                            {
                                tbmulti = driver.FindElement(By.XPath("//*[@id='col2']/div[2]/table/tbody/tr[9]/td/table/tbody"));
                            }
                            IList <IWebElement> TRmulti = tbmulti.FindElements(By.TagName("tr"));
                            IList <IWebElement> TDmulti;
                            int l = 0;
                            foreach (IWebElement row in TRmulti)
                            {
                                TDmulti = row.FindElements(By.TagName("td"));
                                if (!row.Text.Contains("Installments") && !row.Text.Contains("Total Due and Payable"))
                                {
                                    if (TDmulti.Count == 6)
                                    {
                                        if (l == 0)
                                        {
                                            InstallmentType = TDmulti[1].Text;
                                            Due_Date        = TDmulti[2].Text;
                                            Tax_Status      = TDmulti[3].Text;
                                            Amount_Due      = TDmulti[4].Text;
                                            Remarks         = TDmulti[5].Text;
                                            taxinfo         = parcelnumber + "~" + fiscal_year + "~" + rolltype + "~" + InstallmentType + "~" + Due_Date + "~" + Tax_Status + "~" + Amount_Due + "~" + Remarks + "~" + "" + "~" + "";
                                        }
                                        if (l == 1)
                                        {
                                            InstallmentType = TDmulti[1].Text;
                                            Due_Date        = TDmulti[2].Text;
                                            Tax_Status      = TDmulti[3].Text;
                                            Amount_Due      = TDmulti[4].Text;
                                            Remarks         = TDmulti[5].Text;
                                            taxinfo1        = parcelnumber + "~" + fiscal_year + "~" + rolltype + "~" + InstallmentType + "~" + Due_Date + "~" + Tax_Status + "~" + Amount_Due + "~" + Remarks;
                                        }
                                        l++;
                                    }
                                }
                                if (row.Text.Contains("Total Due and Payable"))
                                {
                                    Total_Due_Amount = TDmulti[3].Text;
                                    taxinfo2         = taxinfo1 + "~" + Total_Due_Amount;
                                }
                            }
                            string      taxinfoNew = "";
                            IWebElement tbmulti1;
                            try
                            {
                                tbmulti1 = driver.FindElement(By.XPath("//*[@id='col2']/div[2]/table/tbody/tr[6]/td/table/tbody"));
                            }
                            catch
                            {
                                tbmulti1 = driver.FindElement(By.XPath("//*[@id='col2']/div[2]/table/tbody/tr[12]/td/table/tbody"));
                            }
                            IList <IWebElement> TRmulti1 = tbmulti1.FindElements(By.TagName("tr"));
                            IList <IWebElement> TDmulti1;
                            int m = 0;
                            foreach (IWebElement row in TRmulti1)
                            {
                                TDmulti1 = row.FindElements(By.TagName("td"));
                                if (!row.Text.Contains("Payment Summary") && !row.Text.Contains("Installments"))
                                {
                                    if (TDmulti1.Count == 6)
                                    {
                                        if (m == 0)
                                        {
                                            Paid_Date   = TDmulti1[2].Text;
                                            Paid_Amount = TDmulti1[4].Text;
                                            taxinfo     = taxinfo + "~" + Paid_Date + "~" + Paid_Amount + "~" + "Orange County Tax Collector, P.O.Box 1438 Santa Ana, CA 92702-1438";
                                            gc.insert_date(orderNumber, Parcel, 556, taxinfo, 1, DateTime.Now);
                                        }//ATTN: Orange County Tax Collector P.O.Box 1438 Santa Ana, CA 92702-1438
                                        if (m == 1)
                                        {
                                            Paid_Date   = TDmulti1[2].Text;
                                            Paid_Amount = TDmulti1[4].Text;
                                            taxinfoNew  = Paid_Date + "~" + Paid_Amount;
                                        }
                                        m++;
                                    }
                                }
                                if (row.Text.Contains("Total Amt Paid") && TDmulti1.Count == 5)
                                {
                                    string total_amount_due = TDmulti1[3].Text;
                                    taxinfo2 = taxinfo2 + "~" + total_amount_due + "~" + taxinfoNew + "~" + "";
                                    gc.insert_date(orderNumber, Parcel, 556, taxinfo2, 1, DateTime.Now);
                                }
                            }
                        }
                        catch { }
                    }
                    //download bill
                    try
                    {
                        foreach (string real2 in strTaxRealestate)
                        {
                            var           chDriver = new ChromeDriver();
                            WebDriverWait waittime = new WebDriverWait(chDriver, TimeSpan.FromSeconds(5));
                            chDriver.Navigate().GoToUrl(real2);
                            Thread.Sleep(4000);
                            try
                            {
                                IWebElement Itaxstmt = chDriver.FindElement(By.LinkText("View Original Bill"));
                                string      stmt1    = Itaxstmt.GetAttribute("href");
                                Itaxstmt.Click();
                            }
                            catch
                            {
                                IWebElement Itaxstmt = chDriver.FindElement(By.LinkText("View Bill"));
                                string      stmt1    = Itaxstmt.GetAttribute("href");
                                Itaxstmt.Click();
                            }
                            chDriver.SwitchTo().Window(chDriver.WindowHandles.Last());
                            string currentURL = chDriver.Url;
                            gc.downloadfile(currentURL, orderNumber, Parcel, "Billdown" + b, "CA", "Orange");
                            b++;
                            chDriver.Quit();
                        }
                    }
                    catch
                    { }
                    TaxTime     = DateTime.Now.ToString("HH:mm:ss");
                    LastEndTime = DateTime.Now.ToString("HH:mm:ss");
                    gc.insert_TakenTime(orderNumber, "CA", "Orange", StartTime, AssessmentTime, TaxTime, CitytaxTime, LastEndTime);
                    driver.Quit();
                    gc.mergpdf(orderNumber, "CA", "Orange");
                    return("Data Inserted Successfully");
                }
                catch (Exception ex)
                {
                    driver.Quit();
                    GlobalClass.LogError(ex, orderNumber);
                    throw ex;
                }
            }
        }
예제 #3
0
        public string FTP_MarinCA(string address, string parcelNumber, string searchType, string orderNumber, string ownername, string directParcel)
        {
            GlobalClass.global_orderNo             = orderNumber;
            HttpContext.Current.Session["orderNo"] = orderNumber;

            GlobalClass.global_parcelNo = parcelNumber;
            List <string> taxinformation = new List <string>();
            string        StartTime = "", AssessmentTime = "", TaxTime = "", CitytaxTime = "", LastEndTime = "";
            var           driverService = PhantomJSDriverService.CreateDefaultService();

            driverService.HideCommandPromptWindow = true;
            using (driver = new PhantomJSDriver())
            {
                //driver = new ChromeDriver();
                StartTime = DateTime.Now.ToString("HH:mm:ss");
                string Taxauthority = "";
                try

                {
                    if (searchType == "titleflex")
                    {
                        gc.TitleFlexSearch(orderNumber, "", ownername, address, "CA", "Marin");
                        if (HttpContext.Current.Session["TitleFlex_Search"] != null && HttpContext.Current.Session["TitleFlex_Search"].ToString() == "Yes")
                        {
                            driver.Quit();
                            return("MultiParcel");
                        }
                        else if (HttpContext.Current.Session["titleparcel"].ToString() == "")
                        {
                            HttpContext.Current.Session["Nodata_MarinCA"] = "Yes";
                            driver.Quit();
                            return("No Data Found");
                        }
                        parcelNumber = HttpContext.Current.Session["titleparcel"].ToString();
                        searchType   = "parcel";
                    }


                    //Tax Authority
                    try
                    {
                        string Taxauthority1 = "";
                        driver.Navigate().GoToUrl("https://www.marincounty.org/depts/df/property-tax-information");
                        Taxauthority1 = driver.FindElement(By.XPath("//*[@id='main-content']/div[4]/p[5]")).Text.Trim();
                        Taxauthority  = gc.Between(Taxauthority1, "Mail:", "Office:").Trim();
                        gc.CreatePdf(orderNumber, parcelNumber, "Tax Authority PDF", driver, "CA", "Marin");
                    }
                    catch { }


                    driver.Navigate().GoToUrl("https://www.marincounty.org/depts/ar/divisions/assessor/search-assessor-records");
                    try
                    {
                        try
                        {
                            IWebElement         IPropertySearch1 = driver.FindElement(By.XPath("//*[@id='main-content']/div[2]/div[10]/input[1]"));
                            IJavaScriptExecutor js1 = driver as IJavaScriptExecutor;
                            js1.ExecuteScript("arguments[0].click();", IPropertySearch1);
                        }
                        catch { }
                        try
                        {
                            driver.FindElement(By.XPath("//*[@id='main-content']/div[2]/div[10]/input[1]")).Click();
                        }
                        catch { }


                        if (searchType == "parcel")
                        {
                            driver.FindElement(By.Id("PP")).Clear();
                            IWebElement         text = driver.FindElement(By.Id("PP"));
                            IJavaScriptExecutor js   = (IJavaScriptExecutor)driver;
                            js.ExecuteScript("document.getElementById('PP').value='" + parcelNumber + "'");
                            driver.FindElement(By.XPath("//*[@id='P']/div[2]/div/div/input[1]")).SendKeys(Keys.Enter);
                            Thread.Sleep(2000);
                            gc.CreatePdf(orderNumber, parcelNumber, "Enter The Address After", driver, "CA", "Marin");

                            try
                            {
                                int                 count = 0;
                                string              Multiparcelnumber = "", Singlerowclick = "";
                                IWebElement         Multiaddresstable1add = driver.FindElement(By.XPath("//*[@id='app-ext']/div[1]/div[1]/table/tbody"));
                                IList <IWebElement> multiaddressrows      = Multiaddresstable1add.FindElements(By.TagName("tr"));
                                IList <IWebElement> Multiaddressid;
                                foreach (IWebElement Multiaddress in multiaddressrows)
                                {
                                    Multiaddressid = Multiaddress.FindElements(By.TagName("td"));
                                    if (Multiaddressid.Count == 4 && !Multiaddress.Text.Contains("Parcel#") && Multiparcelnumber != Multiaddressid[0].Text)
                                    {
                                        Multiparcelnumber = Multiaddressid[0].Text;
                                        IWebElement Singleclick = Multiaddressid[0].FindElement(By.TagName("a"));
                                        Singlerowclick = Singleclick.GetAttribute("href");
                                        string Ownername          = Multiaddressid[1].Text;
                                        string multiaddressresult = Multiparcelnumber + "~" + Ownername;
                                        gc.insert_date(orderNumber, Multiparcelnumber, 1201, multiaddressresult, 1, DateTime.Now);
                                        count++;
                                    }
                                }

                                if (count < 2)
                                {
                                    driver.Navigate().GoToUrl(Singlerowclick);
                                }
                                if (count > 1 && count < 26)
                                {
                                    HttpContext.Current.Session["multiparcel_Marin"] = "Yes";
                                    driver.Quit();
                                    return("MultiParcel");
                                }
                                if (count > 25)
                                {
                                    HttpContext.Current.Session["multiparcel_Marin_Maximum"] = "Maximum";
                                    driver.Quit();
                                    return("Maximum");
                                }
                            }
                            catch { }
                            try
                            {
                                //No Data Found
                                string nodata = driver.FindElement(By.XPath("//*[@id='main-content']/div[2]/h3")).Text;
                                if (nodata.Contains("No records were found."))
                                {
                                    HttpContext.Current.Session["Nodata_MarinCA"] = "Yes";
                                    driver.Quit();
                                    return("No Data Found");
                                }
                            }
                            catch { }
                        }
                    }
                    catch
                    {
                    }

                    //Property Details
                    string ParcelNumber = "", OwnerName = "", UseCode = "", UseCodeDefinition = "", ConstructionYear = "", TaxRateArea = "", AssessmentCity = "", TotalAssessedValueforTaxRollYear = "", TotalAssessedValueforTaxRollYear1 = "", Land = "", Improvements = "", TotalAssessedvalue = "", Homeowner = "", NetAssessedValueforTaxRollYear = "", NetAssessedValueforTaxRollYear1 = "", TotalAssessedvalue1 = "", LessTotalExemptions = "", NetAssessedvalue = "";
                    //IWebElement propertyinfo0 = driver.FindElement(By.XPath("//*[@id='app-ext']/div[2]/div[2]/div[2]/table/tbody"));
                    //IList<IWebElement> propertyinfo0TR = propertyinfo0.FindElements(By.TagName("tr"));
                    //IList<IWebElement> propertyinfo0TD;


                    IList <IWebElement> propertyinfo0TR0 = driver.FindElements(By.TagName("table"));// table list of Payment History Table

                    foreach (IWebElement Taxinfor00 in propertyinfo0TR0)
                    {
                        if (Taxinfor00.Text.Contains("Parcel Number") /*&& tab.Text.Contains("Land Value:")&& tab.Text.Contains("Levy Name")*/)
                        {
                            IList <IWebElement> ITaxRealRowQ0 = Taxinfor00.FindElements(By.TagName("tr"));
                            IList <IWebElement> ITaxRealTdQ0;
                            foreach (IWebElement ItaxReal0 in ITaxRealRowQ0)
                            {
                                ITaxRealTdQ0 = ItaxReal0.FindElements(By.TagName("td"));
                                if (ITaxRealTdQ0.Count == 3 && !ItaxReal0.Text.Contains("Parcel Number"))
                                {
                                    ParcelNumber = ITaxRealTdQ0[0].Text;
                                }
                            }
                        }

                        if (Taxinfor00.Text.Contains("Owner Name") /*&& tab.Text.Contains("Land Value:")&& tab.Text.Contains("Levy Name")*/)
                        {
                            IList <IWebElement> ITaxRealRowQ1 = Taxinfor00.FindElements(By.TagName("tr"));
                            IList <IWebElement> ITaxRealTdQ1;
                            foreach (IWebElement ItaxReal1 in ITaxRealRowQ1)
                            {
                                ITaxRealTdQ1 = ItaxReal1.FindElements(By.TagName("td"));
                                if (ITaxRealTdQ1.Count == 1 && !ItaxReal1.Text.Contains("Owner Name"))
                                {
                                    OwnerName += ITaxRealTdQ1[0].Text + " ";
                                }
                            }
                        }

                        if (Taxinfor00.Text.Contains("Land") && !Taxinfor00.Text.Contains("Land Sq. Ft.") /* && tab.Text.Contains("Levy Name")*/)
                        {
                            IList <IWebElement> ITaxRealRowQ2 = Taxinfor00.FindElements(By.TagName("tr"));
                            IList <IWebElement> ITaxRealTdQ2;
                            foreach (IWebElement ItaxReal2 in ITaxRealRowQ2)
                            {
                                ITaxRealTdQ2 = ItaxReal2.FindElements(By.TagName("td"));
                                if (ITaxRealTdQ2.Count == 2 && ItaxReal2.Text.Contains("Land"))
                                {
                                    Land = ITaxRealTdQ2[1].Text;
                                    //Improvements = ITaxRealTdQ2[0].Text;
                                    //TotalAssessedvalue = ITaxRealTdQ2[0].Text;
                                }
                                if (ITaxRealTdQ2.Count == 2 && ItaxReal2.Text.Contains("Improvements"))
                                {
                                    //Land = ITaxRealTdQ2[0].Text;
                                    Improvements = ITaxRealTdQ2[1].Text;
                                    //TotalAssessedvalue = ITaxRealTdQ2[0].Text;
                                }
                                if (ITaxRealTdQ2.Count == 2 && ItaxReal2.Text.Contains("Total Assessed Value"))
                                {
                                    //Land = ITaxRealTdQ2[0].Text;
                                    //Improvements = ITaxRealTdQ2[0].Text;
                                    TotalAssessedvalue = ITaxRealTdQ2[1].Text;
                                }
                            }
                        }
                        if (Taxinfor00.Text.Contains("Total Exemptions") && !Taxinfor00.Text.Contains("Less Total Exemptions") /*&& tab.Text.Contains("Land Value:")&& tab.Text.Contains("Levy Name")*/)
                        {
                            IList <IWebElement> ITaxRealRowQ3 = Taxinfor00.FindElements(By.TagName("tr"));
                            IList <IWebElement> ITaxRealTdQ3;
                            foreach (IWebElement ItaxReal3 in ITaxRealRowQ3)
                            {
                                ITaxRealTdQ3 = ItaxReal3.FindElements(By.TagName("td"));
                                if (ITaxRealTdQ3.Count == 2 && ItaxReal3.Text.Contains("Total Exemptions"))
                                {
                                    Homeowner = ITaxRealTdQ3[1].Text;
                                }
                            }
                        }
                        if (Taxinfor00.Text.Contains("Total Assessed Value") && !Taxinfor00.Text.Contains("Land") /*&& tab.Text.Contains("Levy Name")*/)
                        {
                            IList <IWebElement> ITaxRealRowQ4 = Taxinfor00.FindElements(By.TagName("tr"));
                            IList <IWebElement> ITaxRealTdQ4;
                            foreach (IWebElement ItaxReal4 in ITaxRealRowQ4)
                            {
                                ITaxRealTdQ4 = ItaxReal4.FindElements(By.TagName("td"));
                                if (ITaxRealTdQ4.Count == 2 && ItaxReal4.Text.Contains("Total Assessed Value"))
                                {
                                    TotalAssessedvalue1 = ITaxRealTdQ4[1].Text;
                                }
                                if (ITaxRealTdQ4.Count == 2 && ItaxReal4.Text.Contains("Less Total Exemptions"))
                                {
                                    LessTotalExemptions = ITaxRealTdQ4[1].Text;
                                }
                                if (ITaxRealTdQ4.Count == 2 && ItaxReal4.Text.Contains("Net Assessed Value"))
                                {
                                    NetAssessedvalue = ITaxRealTdQ4[1].Text;
                                }
                            }
                        }
                        if (Taxinfor00.Text.Contains("Use Code Definition") /* && tab.Text.Contains("Levy Name")*/)
                        {
                            IList <IWebElement> ITaxRealRowQ5 = Taxinfor00.FindElements(By.TagName("tr"));
                            IList <IWebElement> ITaxRealTdQ5;
                            foreach (IWebElement ItaxReal5 in ITaxRealRowQ5)
                            {
                                ITaxRealTdQ5 = ItaxReal5.FindElements(By.TagName("td"));
                                if (ITaxRealTdQ5.Count == 2 && ITaxRealRowQ5.Count > 6 && ItaxReal5.Text.Contains("Use Code") && !ItaxReal5.Text.Contains("Definition"))
                                {
                                    UseCode = ITaxRealTdQ5[1].Text;
                                }
                                if (ITaxRealTdQ5.Count == 2 && ITaxRealRowQ5.Count > 6 && ItaxReal5.Text.Contains("Use Code Definition"))
                                {
                                    UseCodeDefinition = ITaxRealTdQ5[1].Text;
                                }
                                if (ITaxRealTdQ5.Count == 2 && ITaxRealRowQ5.Count > 6 && ItaxReal5.Text.Contains("Construction Year"))
                                {
                                    ConstructionYear = ITaxRealTdQ5[1].Text;
                                }
                            }
                        }

                        if (Taxinfor00.Text.Contains("Tax Rate Area") /* && tab.Text.Contains("Levy Name")*/)
                        {
                            IList <IWebElement> ITaxRealRowQ6 = Taxinfor00.FindElements(By.TagName("tr"));
                            IList <IWebElement> ITaxRealTdQ6;
                            foreach (IWebElement ItaxReal6 in ITaxRealRowQ6)
                            {
                                ITaxRealTdQ6 = ItaxReal6.FindElements(By.TagName("td"));
                                if (ITaxRealTdQ6.Count == 2 && ItaxReal6.Text.Contains("Tax Rate Area"))
                                {
                                    TaxRateArea = ITaxRealTdQ6[1].Text;
                                }
                                if (ITaxRealTdQ6.Count == 2 && ItaxReal6.Text.Contains("Assessment City"))
                                {
                                    AssessmentCity = ITaxRealTdQ6[1].Text;
                                }
                            }
                        }
                    }
                    try
                    {
                        TotalAssessedValueforTaxRollYear1 = driver.FindElement(By.XPath("//*[@id='main-content']/div[2]/div[12]/div[1]/span")).Text.Trim();
                        TotalAssessedValueforTaxRollYear  = GlobalClass.After(TotalAssessedValueforTaxRollYear1, "Total Assessed Value for Tax Roll Year:").Trim();
                    }
                    catch { }
                    try
                    {
                        NetAssessedValueforTaxRollYear1 = driver.FindElement(By.XPath("//*[@id='main-content']/div[2]/div[16]/div[1]/span")).Text.Trim();
                        NetAssessedValueforTaxRollYear  = GlobalClass.After(NetAssessedValueforTaxRollYear1, "Net Assessed Value for Tax Roll Year:").Trim();
                    }
                    catch { }
                    //Property Details
                    string PropertyDetails = ParcelNumber.Trim() + "~" + OwnerName.Trim() + "~" + UseCode.Trim() + "~" + UseCodeDefinition.Trim() + "~" + ConstructionYear.Trim() + "~" + TaxRateArea.Trim() + "~" + AssessmentCity.Trim();
                    gc.insert_date(orderNumber, parcelNumber, 1213, PropertyDetails, 1, DateTime.Now);

                    //Assessment Details
                    string AssessmentDetails             = TotalAssessedValueforTaxRollYear.Trim() + "~" + Land.Trim() + "~" + Improvements.Trim() + "~" + TotalAssessedvalue.Trim() + "~" + Homeowner.Trim() + "~" + NetAssessedValueforTaxRollYear.Trim() + "~" + TotalAssessedvalue1.Trim() + "~" + LessTotalExemptions.Trim() + "~" + NetAssessedvalue.Trim() + "~" + Taxauthority.Trim();
                    gc.insert_date(orderNumber, parcelNumber, 1215, AssessmentDetails, 1, DateTime.Now);

                    AssessmentTime = DateTime.Now.ToString("HH:mm:ss");


                    //Property Tax Bills Details
                    //Last Three Years All Tax Bills Details Information With Screeshot
                    //Tax Values Assessment Details Table
                    string TaxRollYear = "", LandValue = "", Improvements1 = "", BusinessProperty = "", PersonalProperty = "", TotalValue = "", HomeExemption = "", OtherExemption = "", NetValue = "", Taxassesmentvaluebind = "";
                    string Owner = "", ParcelNumber1 = "", BillNumber = "", BillDate = "", TaxRateArea1 = "", TaxRollYear1 = "", BillType = "";
                    string Overallassessmentdetails = "", Taxassesmentvaluebind1 = "", Taxsummaryassesmentvaluebind2 = "";
                    string Levy = "", Name = "", Ratefund = "", Install1 = "", Install2 = "", Total = "";
                    string DefaultYear = "", BillNumber1 = "", BillDate1 = "", BillType1 = "", TaxesandAssmnts = "", DelinqPenalty = "", DelinqCost = "", RedemptionPenalty = "";
                    string Taxyear = "", Billnumber = "", PaymentOwnername = "", Billtype = "", Installpay1 = "", Installpay2 = "";
                    try
                    {
                        driver.Navigate().GoToUrl("http://apps.marincounty.org/taxbillonline");

                        try
                        {
                            driver.FindElement(By.XPath("//*[@id='compwa']/div[4]/input[1]")).Click();
                        }
                        catch { }
                        try
                        {
                            driver.FindElement(By.XPath("//*[@id='main-content']/div[2]/div[5]/input[1]")).Click();
                        }
                        catch { }
                        try
                        {
                            IWebElement         IPropertySearch1 = driver.FindElement(By.XPath("//*[@id='compwa']/div[4]/input[1]"));
                            IJavaScriptExecutor js1 = driver as IJavaScriptExecutor;
                            js1.ExecuteScript("arguments[0].click();", IPropertySearch1);
                            Thread.Sleep(5000);
                        }
                        catch { }
                        try
                        {
                            IWebElement         IPropertySearch1 = driver.FindElement(By.XPath("//*[@id='main-content']/div[2]/div[5]/input[1]"));
                            IJavaScriptExecutor js1 = driver as IJavaScriptExecutor;
                            js1.ExecuteScript("arguments[0].click();", IPropertySearch1);
                            Thread.Sleep(5000);
                        }
                        catch { }

                        driver.FindElement(By.Id("PropertyId")).Click();
                        driver.FindElement(By.Id("PropertyId")).Clear();
                        driver.Navigate().GoToUrl("http://apps.marincounty.org/TaxBillOnline/?" + ParcelNumber);
                        driver.FindElement(By.Id("PropertyId")).Clear();
                        IWebElement         text = driver.FindElement(By.Id("PropertyId"));
                        IJavaScriptExecutor js   = (IJavaScriptExecutor)driver;
                        js.ExecuteScript("document.getElementById('PropertyId').value='" + ParcelNumber + "'");
                        driver.FindElement(By.XPath("//*[@id='main-content']/div[2]/form/div[2]/div[2]/div/input[1]")).SendKeys(Keys.Enter);

                        gc.CreatePdf(orderNumber, ParcelNumber, "Property Tax Bill Details PDF", driver, "CA", "Marin");
                        //Delinquent Details
                        string delinquenttax = "", InformationComments = "";
                        try
                        {
                            try
                            {
                                delinquenttax = driver.FindElement(By.XPath("//*[@id='compwa']/div[12]/div[1]/div[1]/span")).Text.Trim();
                            }
                            catch { }
                            if (delinquenttax.Contains("Delinquent Unpaid Tax Bills"))
                            {
                                InformationComments = "For tax amount due, you must call the Collector's Office.";
                                string alertmessage = InformationComments;
                                gc.insert_date(orderNumber, ParcelNumber, 1239, alertmessage, 1, DateTime.Now);
                            }
                        }
                        catch { }
                        IWebElement         Taxbillclick   = driver.FindElement(By.Id("content"));
                        IList <IWebElement> taxpay         = Taxbillclick.FindElements(By.TagName("table"));
                        List <string>       Singlerowclick = new List <string>();
                        foreach (IWebElement taxpament in taxpay)
                        {
                            if (taxpament.Text.Contains("Tax Year") && !taxpament.Text.Contains("To Pay Online") && !taxpament.Text.Contains("Default Nbr") /*&& tab.Text.Contains("Land Value:")&& tab.Text.Contains("Levy Name")*/)
                            {
                                IList <IWebElement> ITaxRealRowQ = taxpament.FindElements(By.TagName("tr"));
                                IList <IWebElement> ITaxRealTdQ;

                                foreach (IWebElement taxpamentHistory in ITaxRealRowQ)
                                {
                                    ITaxRealTdQ = taxpamentHistory.FindElements(By.TagName("td"));

                                    if (ITaxRealTdQ.Count != 0 && ITaxRealTdQ.Count != 3 && ITaxRealTdQ.Count == 6 && taxpamentHistory.Text.Trim() != "")
                                    {
                                        Taxyear          = ITaxRealTdQ[0].Text;
                                        Billnumber       = ITaxRealTdQ[1].Text;
                                        PaymentOwnername = ITaxRealTdQ[2].Text;
                                        Billtype         = ITaxRealTdQ[3].Text;
                                        Installpay1      = ITaxRealTdQ[4].Text;
                                        Installpay2      = ITaxRealTdQ[5].Text;
                                        //Overall Secured Property Tax Charges
                                        string PaymentHistorydetails = Taxyear.Trim() + "~" + Billnumber.Trim() + "~" + PaymentOwnername.Trim() + "~" + Billtype.Trim() + "~" + Installpay1.Trim() + "~" + Installpay2.Trim();
                                        gc.insert_date(orderNumber, ParcelNumber, 1231, PaymentHistorydetails, 1, DateTime.Now);
                                    }
                                }
                                IList <IWebElement> Taxbillclickrows = taxpament.FindElements(By.TagName("a"));
                                foreach (IWebElement propertytaxclick in Taxbillclickrows)
                                {
                                    if (propertytaxclick.Text != "")
                                    {
                                        Singlerowclick.Add(propertytaxclick.GetAttribute("href"));
                                    }
                                }
                            }
                        }
                        int p = 0;
                        foreach (string Properclick in Singlerowclick)
                        {
                            driver.Navigate().GoToUrl(Properclick);
                            try
                            {
                                driver.FindElement(By.XPath("//*[@id='compwa']/div[4]/input[1]")).Click();
                            }
                            catch { }

                            string Billtypedval = "", TaxBillNumber = "";
                            IList <IWebElement> tableList = driver.FindElements(By.TagName("table"));// table list of Payment History Table

                            foreach (IWebElement tab in tableList)
                            {
                                if (tab.Text.Contains("Owner:") /*&& tab.Text.Contains("Land Value:")&& tab.Text.Contains("Levy Name")*/)
                                {
                                    IList <IWebElement> ITaxRealRowQ = tab.FindElements(By.TagName("tr"));
                                    IList <IWebElement> ITaxRealTdQ;
                                    foreach (IWebElement ItaxReal in ITaxRealRowQ)
                                    {
                                        ITaxRealTdQ = ItaxReal.FindElements(By.TagName("td"));
                                        if (ITaxRealTdQ.Count != 0 && ItaxReal.Text.Trim() != "" && ItaxReal.Text.Contains("Tax Roll Year:"))
                                        {
                                            TaxRollYear = ITaxRealTdQ[1].Text;
                                        }
                                        if (ITaxRealTdQ.Count != 0 && ItaxReal.Text.Trim() != "" && ItaxReal.Text.Contains("Bill Type:"))
                                        {
                                            Billtypedval = ITaxRealTdQ[1].Text;
                                        }
                                        if (ITaxRealTdQ.Count != 0 && ITaxRealTdQ.Count != 2 && ItaxReal.Text.Trim() != "" && ItaxReal.Text.Contains("Bill Number:"))
                                        {
                                            TaxBillNumber = ITaxRealTdQ[1].Text;
                                        }
                                        if (ITaxRealTdQ.Count != 0 && ItaxReal.Text.Trim() != "" && tab.Text.Contains("Owner:"))
                                        {
                                            Overallassessmentdetails += ITaxRealTdQ[1].Text + "~";
                                        }
                                    }
                                    //Overall Secured Property Tax Bill Details Table1
                                    string OverallTaxValuesAssessmentDetails = Overallassessmentdetails.TrimEnd('~').Trim();
                                    gc.insert_date(orderNumber, ParcelNumber, 1221, OverallTaxValuesAssessmentDetails, 1, DateTime.Now);
                                }
                            }
                            gc.CreatePdf(orderNumber, ParcelNumber, "Property Tax Bill Details Yearwise PDF" + p, driver, "CA", "Marin");



                            IList <IWebElement> tableList1 = driver.FindElements(By.TagName("table"));// table list of Payment History Table

                            foreach (IWebElement tab1 in tableList1)
                            {
                                if (tab1.Text.Contains("Land Value:") /*&& tab.Text.Contains("Land Value:")&& tab.Text.Contains("Levy Name")*/)
                                {
                                    IList <IWebElement> ITaxRealRowQ1 = tab1.FindElements(By.TagName("tr"));
                                    IList <IWebElement> ITaxRealTdQ1;
                                    foreach (IWebElement ItaxReal1 in ITaxRealRowQ1)
                                    {
                                        ITaxRealTdQ1 = ItaxReal1.FindElements(By.TagName("td"));

                                        if (ITaxRealTdQ1.Count != 0 && ItaxReal1.Text.Trim() != "" && tab1.Text.Contains("Land Value:"))
                                        {
                                            Taxassesmentvaluebind += ITaxRealTdQ1[1].Text + "~";
                                        }
                                    }
                                    //Tax Values Assessment Details Table:
                                    string TaxValuesAssessmentDetails = TaxRollYear.Trim() + "~" + Taxassesmentvaluebind.TrimEnd('~').Trim();
                                    gc.insert_date(orderNumber, ParcelNumber, 1220, TaxValuesAssessmentDetails, 1, DateTime.Now);
                                }
                            }
                            IList <IWebElement> tableList2 = driver.FindElements(By.TagName("table"));// table list of Payment History Table

                            foreach (IWebElement tab2 in tableList2)
                            {
                                if (tab2.Text.Contains("Levy Name Rate/Fund Install 1 Install 2 Total") /*&& tab.Text.Contains("Land Value:")&& tab.Text.Contains("Levy Name")*/)
                                {
                                    IList <IWebElement> ITaxRealRowQ2 = tab2.FindElements(By.TagName("tr"));
                                    IList <IWebElement> ITaxRealTdQ2;
                                    foreach (IWebElement ItaxReal2 in ITaxRealRowQ2)
                                    {
                                        ITaxRealTdQ2 = ItaxReal2.FindElements(By.TagName("td"));

                                        if (ITaxRealTdQ2.Count != 0 && ItaxReal2.Text.Trim() != "" && ITaxRealTdQ2.Count == 6)
                                        {
                                            Levy = ITaxRealTdQ2[0].Text;
                                            Name = ITaxRealTdQ2[1].Text;
                                            if (!Name.Contains("BASIC TAX") && !Name.Contains("Total Tax:") && !Name.Contains("Penalty:") && !Name.Contains("Additional Penalty:") && !Name.Contains("Amount Paid:") && !Name.Contains("Delinquent Date:") && !Name.Contains("Paid Date:") && !Name.Contains("Total Due:"))
                                            {
                                                Name = Name.Remove(0, 1);
                                            }
                                            Ratefund = ITaxRealTdQ2[2].Text;
                                            Install1 = ITaxRealTdQ2[3].Text;
                                            Install2 = ITaxRealTdQ2[4].Text;
                                            Total    = ITaxRealTdQ2[5].Text;
                                            //Overall Secured Property Tax Charges
                                            string OverallTaxValuesAssessmentDetails2 = TaxRollYear + "~" + Billtypedval + "~" + Levy.Trim() + "~" + Name.Trim() + "~" + Ratefund.Trim() + "~" + Install1.Trim() + "~" + Install2.Trim() + "~" + Total.Trim();
                                            gc.insert_date(orderNumber, ParcelNumber, 1230, OverallTaxValuesAssessmentDetails2, 1, DateTime.Now);
                                        }
                                    }
                                }
                            }
                            //Tax Summary of Prior Years Details
                            IList <IWebElement> tableList3 = driver.FindElements(By.TagName("table"));// table list of Payment History Table

                            foreach (IWebElement tab3 in tableList3)
                            {
                                if (tab3.Text.Contains("Default Year") /*&& tab.Text.Contains("Land Value:")&& tab.Text.Contains("Levy Name")*/)
                                {
                                    IList <IWebElement> ITaxRealRowQ3 = tab3.FindElements(By.TagName("tr"));
                                    IList <IWebElement> ITaxRealTdQ3;
                                    foreach (IWebElement ItaxReal3 in ITaxRealRowQ3)
                                    {
                                        ITaxRealTdQ3 = ItaxReal3.FindElements(By.TagName("td"));

                                        if (ITaxRealTdQ3.Count != 0 && ItaxReal3.Text.Trim() != "" && ITaxRealTdQ3.Count == 8)
                                        {
                                            DefaultYear       = ITaxRealTdQ3[0].Text;
                                            BillNumber1       = ITaxRealTdQ3[1].Text;
                                            BillDate1         = ITaxRealTdQ3[2].Text;
                                            BillType1         = ITaxRealTdQ3[3].Text;
                                            TaxesandAssmnts   = ITaxRealTdQ3[4].Text;
                                            DelinqPenalty     = ITaxRealTdQ3[5].Text;
                                            DelinqCost        = ITaxRealTdQ3[6].Text;
                                            RedemptionPenalty = ITaxRealTdQ3[7].Text;

                                            //Tax Summary Prior Year Detaisl
                                            string Taxsummaryofprioryeardetails = DefaultYear.Trim() + "~" + BillNumber1.Trim() + "~" + BillDate1.Trim() + "~" + BillType1.Trim() + "~" + TaxesandAssmnts.Trim() + "~" + DelinqPenalty.Trim() + "~" + DelinqCost.Trim() + "~" + RedemptionPenalty.Trim();
                                            gc.insert_date(orderNumber, ParcelNumber, 1227, Taxsummaryofprioryeardetails, 1, DateTime.Now);
                                        }
                                    }
                                }
                            }

                            //Delinquent Tax Details
                            IList <IWebElement> tableList4 = driver.FindElements(By.TagName("table"));
                            foreach (IWebElement tab4 in tableList4)
                            {
                                if (tableList4.Count != 2 && tab4.Text.Contains("Owner:") && !tab4.Text.Contains("Delinquent Details") && !tab4.Text.Contains("Bill"))
                                {
                                    IList <IWebElement> ITaxRealRowQ4 = tab4.FindElements(By.TagName("tr"));
                                    IList <IWebElement> ITaxRealTdQ4;
                                    foreach (IWebElement ItaxReal4 in ITaxRealRowQ4)
                                    {
                                        ITaxRealTdQ4 = ItaxReal4.FindElements(By.TagName("td"));

                                        if (ITaxRealTdQ4.Count != 0 && ItaxReal4.Text.Trim() != "" && ITaxRealTdQ4.Count == 2 /*&& !ItaxReal4.Text.Contains("Default")*/)
                                        {
                                            string Totaldelinquent = ITaxRealTdQ4[0].Text + "~" + ITaxRealTdQ4[1].Text;

                                            gc.insert_date(orderNumber, ParcelNumber, 1350, Totaldelinquent, 1, DateTime.Now);
                                        }
                                    }
                                }
                            }
                            IList <IWebElement> tableList5 = driver.FindElements(By.TagName("table"));
                            foreach (IWebElement tab5 in tableList5)
                            {
                                if (!tab5.Text.Contains("Payment Due") && tab5.Text.Contains("Description"))
                                {
                                    IList <IWebElement> ITaxRealRowQ5 = tab5.FindElements(By.TagName("tr"));
                                    IList <IWebElement> ITaxRealTdQ5;
                                    foreach (IWebElement ItaxReal5 in ITaxRealRowQ5)
                                    {
                                        ITaxRealTdQ5 = ItaxReal5.FindElements(By.TagName("td"));

                                        if (ITaxRealTdQ5.Count != 0 && ItaxReal5.Text.Trim() != "" && ITaxRealTdQ5.Count == 2)
                                        {
                                            string Totaldelinquent = ITaxRealTdQ5[0].Text + "~" + ITaxRealTdQ5[1].Text;

                                            gc.insert_date(orderNumber, ParcelNumber, 1350, Totaldelinquent, 1, DateTime.Now);
                                        }
                                    }
                                }
                            }
                            TaxRollYear = ""; LandValue = ""; Improvements1 = ""; BusinessProperty = ""; PersonalProperty = ""; TotalValue = ""; HomeExemption = ""; OtherExemption = ""; NetValue = ""; Taxassesmentvaluebind = "";
                            Owner       = ""; ParcelNumber1 = ""; BillNumber = ""; BillDate = ""; TaxRateArea1 = ""; TaxRollYear1 = ""; BillType = "";
                            Overallassessmentdetails = ""; Taxassesmentvaluebind1 = "";
                            Levy        = ""; Name = ""; Ratefund = ""; Install1 = ""; Install2 = ""; Total = "";
                            DefaultYear = ""; BillNumber1 = ""; BillDate1 = ""; BillType1 = ""; TaxesandAssmnts = ""; DelinqPenalty = ""; DelinqCost = ""; RedemptionPenalty = "";

                            p++;
                        }
                    }
                    catch { }

                    TaxTime     = DateTime.Now.ToString("HH:mm:ss");
                    LastEndTime = DateTime.Now.ToString("HH:mm:ss");
                    gc.insert_TakenTime(orderNumber, "CA", "Marin", StartTime, AssessmentTime, TaxTime, CitytaxTime, LastEndTime);

                    driver.Quit();
                    GlobalClass.titleparcel = "";
                    gc.mergpdf(orderNumber, "CA", "Marin");
                    return("Data Inserted Successfully");
                }
                catch (Exception ex)
                {
                    driver.Quit();
                    throw ex;
                }
            }
        }
        public string FTP_Charlotte(string houseno, string housetype, string sname, string direction, string unitno, string ownername, string parcelNumber, string searchType, string orderNumber, string directParcel)
        {
            string      StartTime = "", AssessmentTime = "", TaxTime = "", CitytaxTime = "", LastEndTime = "", AssessTakenTime = "", TaxTakentime = "", CityTaxtakentime = "";
            string      TotaltakenTime = "";
            GlobalClass gc             = new GlobalClass();

            GlobalClass.global_orderNo             = orderNumber;
            HttpContext.Current.Session["orderNo"] = orderNumber;
            GlobalClass.global_parcelNo            = parcelNumber;
            string owner = "", folio_parcel_no = "-", Legal_desc = "", property_use = "", Tax_district = "", Year_built = "", Neighbourhood = "", subdivision = "", situs_address = "", pin = "";

            var driverService = PhantomJSDriverService.CreateDefaultService();

            driverService.HideCommandPromptWindow = true;
            //driver = new PhantomJSDriver();
            //driver = new ChromeDriver();
            using (driver = new PhantomJSDriver())
            {
                try
                {
                    StartTime = DateTime.Now.ToString("HH:mm:ss");
                    driver.Navigate().GoToUrl("https://www.ccappraiser.com/rp_real_search.asp");

                    Thread.Sleep(4000);
                    if (searchType == "titleflex")
                    {
                        string titleaddress = houseno + " " + sname + " " + housetype + " " + unitno;
                        gc.TitleFlexSearch(orderNumber, "", "", titleaddress, "FL", "Charlotte");
                        if ((HttpContext.Current.Session["TitleFlex_Search"] != null && HttpContext.Current.Session["TitleFlex_Search"].ToString() == "Yes"))
                        {
                            driver.Quit();
                            return("MultiParcel");
                        }
                        else if (HttpContext.Current.Session["titleparcel"].ToString() == "")
                        {
                            HttpContext.Current.Session["Charlotte_Zero"] = "Zero";
                            driver.Quit();
                            return("No Data Found");
                        }
                        parcelNumber = HttpContext.Current.Session["titleparcel"].ToString();
                        searchType   = "parcel";
                    }

                    if (searchType == "address")
                    {
                        driver.FindElement(By.Id("PropertyAddressNumber")).SendKeys(houseno);
                        driver.FindElement(By.Id("PropertyAddressStreetName")).SendKeys(sname);
                        gc.CreatePdf_WOP(orderNumber, "Address Search", driver, "FL", "Charlotte");
                        driver.FindElement(By.Id("Button3")).SendKeys(Keys.Enter);
                        Thread.Sleep(5000);
                        gc.CreatePdf_WOP(orderNumber, "Address Search result", driver, "FL", "Charlotte");

                        int trCount = driver.FindElements(By.XPath("/html/body/table/tbody/tr[2]/td/table/tbody/tr")).Count;
                        try
                        {
                            string NOdata = driver.FindElement(By.XPath("/html/body/p[1]")).Text;
                            if (NOdata.Contains("Sorry, your selection"))
                            {
                                HttpContext.Current.Session["Charlotte_Zero"] = "Zero";
                                driver.Quit();
                                return("No Data Found");
                            }
                        }
                        catch { }
                        if (trCount > 2)
                        {   //multi parcel
                            IWebElement         tbmulti2 = driver.FindElement(By.XPath("/html/body/table/tbody/tr[2]/td/table/tbody"));
                            IList <IWebElement> TRmulti2 = tbmulti2.FindElements(By.TagName("tr"));
                            IList <IWebElement> TDmulti2;
                            int k = 0;
                            foreach (IWebElement row in TRmulti2)
                            {
                                if (k < 25)
                                {
                                    TDmulti2 = row.FindElements(By.TagName("td"));
                                    if (TDmulti2.Count != 0 && TDmulti2[1].Text.Trim() != "")
                                    {
                                        string multi1 = TDmulti2[1].Text + "~" + TDmulti2[2].Text;
                                        gc.insert_date(orderNumber, TDmulti2[0].Text, 687, multi1, 1, DateTime.Now);
                                        //  Owner~address
                                    }
                                    k++;
                                }
                            }
                            HttpContext.Current.Session["multiParcel_Charlotte"] = "Yes";
                            if (TRmulti2.Count > 25)
                            {
                                HttpContext.Current.Session["multiParcel_Charlotte_Multicount"] = "Maximum";
                            }
                            driver.Quit();
                            return("MultiParcel");
                        }
                        else
                        {
                            Thread.Sleep(2000);
                            IWebElement Multisingle = driver.FindElement(By.XPath("/html/body/table/tbody/tr[2]/td[1]")).FindElement(By.TagName("a"));
                            string      Multiclick  = Multisingle.GetAttribute("href");
                            driver.Navigate().GoToUrl(Multiclick);
                            //driver.FindElement(By.XPath("/html/body/table/tbody/tr[2]/td/table/tbody/tr[2]/td[1]/a")).Click();
                            Thread.Sleep(3000);
                        }
                    }
                    if (searchType == "parcel")
                    {
                        driver.FindElement(By.Id("ParcelID_number")).SendKeys(parcelNumber);

                        gc.CreatePdf(orderNumber, parcelNumber, "Parcel Search", driver, "FL", "Charlotte");
                        driver.FindElement(By.Id("Button3")).SendKeys(Keys.Enter);
                        Thread.Sleep(5000);
                        gc.CreatePdf(orderNumber, parcelNumber, "Parcel Search result", driver, "FL", "Charlotte");
                        try
                        {
                            driver.FindElement(By.XPath("/html/body/table/tbody/tr[2]/td[1]/a")).Click();
                            Thread.Sleep(3000);
                        }
                        catch { }
                    }

                    if (searchType == "ownername")
                    {
                        string   lastname = "", firstname = "";
                        string   s     = ownername;
                        string[] words = s.Split(' ');
                        if (words.Count() == 1)
                        {
                            lastname = words[0];
                            driver.FindElement(By.Id("owner")).SendKeys(lastname);
                        }
                        else
                        {
                            lastname  = words[0];
                            firstname = words[1];

                            driver.FindElement(By.Id("owner")).SendKeys(lastname + " " + firstname);
                        }

                        gc.CreatePdf_WOP(orderNumber, "Owner Search", driver, "FL", "Charlotte");
                        driver.FindElement(By.Id("Button3")).SendKeys(Keys.Enter);
                        Thread.Sleep(3000);
                        gc.CreatePdf_WOP(orderNumber, "owner Search result", driver, "FL", "Charlotte");
                        int trCount = driver.FindElements(By.XPath("/html/body/table/tbody/tr[2]/td/table/tbody/tr")).Count;

                        if (trCount > 2)
                        {   //multi parcel
                            IWebElement         tbmulti2 = driver.FindElement(By.XPath("/html/body/table/tbody/tr[2]/td/table/tbody"));
                            IList <IWebElement> TRmulti2 = tbmulti2.FindElements(By.TagName("tr"));
                            IList <IWebElement> TDmulti2;
                            int k = 0;
                            foreach (IWebElement row in TRmulti2)
                            {
                                if (k < 25)
                                {
                                    TDmulti2 = row.FindElements(By.TagName("td"));
                                    if (TDmulti2.Count != 0 && TDmulti2[1].Text.Trim() != "")
                                    {
                                        string multi1 = TDmulti2[1].Text + "~" + TDmulti2[2].Text;
                                        gc.insert_date(orderNumber, TDmulti2[0].Text, 687, multi1, 1, DateTime.Now);
                                        //  Owner~address
                                    }
                                    k++;
                                }
                            }
                            HttpContext.Current.Session["multiParcel_Charlotte"] = "Yes";
                            if (TRmulti2.Count > 25)
                            {
                                HttpContext.Current.Session["multiParcel_Charlotte_Multicount"] = "Maximum";
                            }
                            driver.Quit();
                            return("MultiParcel");
                        }
                        else
                        {
                            try
                            {
                                Thread.Sleep(2000);
                                // /html/body/table/tbody/tr[2]/td[1]/a
                                driver.FindElement(By.XPath("/html/body/table/tbody/tr[2]/td[1]/a")).Click();
                                Thread.Sleep(3000);
                            }
                            catch { }
                        }
                    }

                    try
                    {
                        IWebElement INodata = driver.FindElement(By.XPath("/html/body/p[1]"));
                        if (INodata.Text.Contains("Sorry, your selection returned"))
                        {
                            HttpContext.Current.Session["Charlotte_Zero"] = "Zero";
                            driver.Quit();
                            return("No Data Found");
                        }
                    }
                    catch { }
                    //property details


                    //Parcel ID~Old Parcel ID Number~Owner Name~Owner Address~Property Address~Business Name~Year Built~Map Number~Current Use~Future Land Use (Comp.Plan)~Property Zip Code~Section-Township-Range~Taxing District~Market Area / Neighborhood / Subneighborhood~SOH Base Year~Short Legal~Legal Description
                    string parcel_no = "", OldParcelID = "", OwnerAddress = "", PropertyAddress = "", BusinessName = "", YearBuilt = "", MapNumber = "", CurrentUse = "", FutureLandUse = "", PropertyZipCode = "", section = "", TaxingDistrict = "", MarketArea = "", SOHBaseYear = "", legal1 = "", legal2 = "";

                    string bulkpropertytext = "", property_details = "";
                    // driver.FindElement(By.Id("Year1")).Click();
                    //Thread.Sleep(2000);

                    bulkpropertytext = driver.FindElement(By.XPath("/html/body/main/section/div/h1")).Text.Replace("\r\n", "");
                    parcel_no        = gc.Between(bulkpropertytext, "Information for", "for the").Trim();
                    gc.CreatePdf(orderNumber, parcel_no, "Property details last", driver, "FL", "Charlotte");
                    string   Ownersplit = driver.FindElement(By.XPath("/html/body/main/section/div/div[2]/div/div[1]/div[1]")).Text;
                    string[] Ownerarray = Ownersplit.Split('\r');
                    owner = Ownerarray[0];
                    string MilingAddress    = Ownerarray[1] + " " + Ownerarray[2];
                    string propertyaddress1 = driver.FindElement(By.XPath("/html/body/main/section/div/div[2]/div/div[2]/div[1]/div[2]")).Text;
                    string propertyaddress2 = driver.FindElement(By.XPath("/html/body/main/section/div/div[2]/div/div[2]/div[2]/div[2]")).Text;
                    PropertyAddress = propertyaddress1 + " " + propertyaddress2;
                    BusinessName    = driver.FindElement(By.XPath("/html/body/main/section/div/div[2]/div/div[2]/div[3]/div[2]")).Text;
                    MapNumber       = driver.FindElement(By.XPath("/html/body/main/section/div/div[3]/div/div[1]/div/div[6]/div[2]")).Text;
                    CurrentUse      = driver.FindElement(By.XPath("/html/body/main/section/div/div[3]/div/div[1]/div/div[2]/div[2]")).Text;
                    // string SectionTownship =
                    //PropertyZipCode = gc.Between(bulkpropertytext, "Property Zip Code:", "Business Name:").Trim();
                    section        = driver.FindElement(By.XPath("/html/body/main/section/div/div[3]/div/div[1]/div/div[7]/div[2]")).Text;
                    TaxingDistrict = driver.FindElement(By.XPath("/html/body/main/section/div/div[3]/div/div[1]/div/div[1]/div[2]")).Text;
                    // MarketArea = gc.Between(bulkpropertytext, "Market Area/Neighborhood/Subneighborhood:", "Waterfront:").Trim();
                    // SOHBaseYear = GlobalClass.After(bulkpropertytext, "SOH Base Year:").Trim();
                    try
                    {
                        YearBuilt = driver.FindElement(By.XPath("/html/body/main/section/div/div[11]/div/table/tbody/tr[2]/td[5]")).Text;
                    }
                    catch { }

                    try
                    {
                        legal1 = driver.FindElement(By.XPath("/html/body/main/section/div/div[13]/div[2]")).Text;
                        legal2 = GlobalClass.After(legal1, "Long Legal:");
                    }
                    catch
                    {
                    }
                    //Old Parcel ID Number~Owner Name & Address~Property Address~Business Name~Year Built~Map Number~Current Use~Future Land Use (Comp.Plan)~Property Zip Code~Section-Township-Range~Taxing District~Market Area / Neighborhood / Subneighborhood~SOH Base Year~Short Legal~Legal Description

                    property_details = owner + "~" + PropertyAddress + "~" + MilingAddress + "~" + BusinessName + "~" + YearBuilt + "~" + MapNumber + "~" + CurrentUse + "~" + section + "~" + TaxingDistrict + "~" + legal2;
                    gc.insert_date(orderNumber, parcel_no, 680, property_details, 1, DateTime.Now);


                    //Assessment details

                    //2017 Value Summary Details Table:
                    //2017 Value Summary~Land~Land Improvements~Building~Damage~Total
                    IWebElement         tbmulti216 = driver.FindElement(By.XPath("/html/body/main/section/div/div[5]/div/table/tbody"));
                    IList <IWebElement> TRmulti216 = tbmulti216.FindElements(By.TagName("tr"));
                    IList <IWebElement> TDmulti216;

                    foreach (IWebElement row in TRmulti216)
                    {
                        TDmulti216 = row.FindElements(By.TagName("td"));
                        if (TDmulti216.Count == 6 && !row.Text.Contains("Building"))
                        {
                            string multi1 = TDmulti216[0].Text + "~" + TDmulti216[1].Text + "~" + TDmulti216[2].Text + "~" + TDmulti216[3].Text + "~" + TDmulti216[4].Text + "~" + TDmulti216[5].Text;
                            gc.insert_date(orderNumber, parcel_no, 681, multi1, 1, DateTime.Now);
                        }
                    }

                    //2017 Certified Tax Roll Values Details Table:
                    //2017 Certified Tax Roll Values~Non-School~School
                    string current = driver.CurrentWindowHandle;
                    driver.FindElement(By.Id("Year1")).Click();
                    Thread.Sleep(2000);
                    driver.SwitchTo().Window(driver.WindowHandles.Last());
                    IWebElement         tbmulti226 = driver.FindElement(By.XPath("/html/body/main/section/div/div[2]/div/table/tbody"));
                    IList <IWebElement> TRmulti226 = tbmulti226.FindElements(By.TagName("tr"));
                    IList <IWebElement> TDmulti226;

                    foreach (IWebElement row in TRmulti226)
                    {
                        TDmulti226 = row.FindElements(By.TagName("td"));
                        if (TDmulti226.Count != 0 && !row.Text.Contains("School"))
                        {
                            string multi1 = TDmulti226[0].Text + "~" + TDmulti226[1].Text + "~" + TDmulti226[2].Text + "~" + TDmulti226[3].Text + "~" + TDmulti226[4].Text;
                            gc.insert_date(orderNumber, parcel_no, 682, multi1, 1, DateTime.Now);
                        }
                    }
                    gc.CreatePdf(orderNumber, parcel_no, "Property details current", driver, "FL", "Charlotte");
                    driver.Close();
                    driver.SwitchTo().Window(current);
                    AssessmentTime = DateTime.Now.ToString("HH:mm:ss");

                    driver.Navigate().GoToUrl("https://charlotte.county-taxes.com/public");
                    Thread.Sleep(5000);
                    IWebElement         IParcelClick = driver.FindElement(By.Id("search-text form-control"));
                    IJavaScriptExecutor js           = driver as IJavaScriptExecutor;
                    js.ExecuteScript("arguments[0].setAttribute('value', '" + parcel_no + "')", IParcelClick);

                    gc.CreatePdf(orderNumber, parcel_no, "Taxinfo", driver, "FL", "Charlotte");
                    IWebElement IParcelNoClick = driver.FindElement(By.XPath("//*[@id='search-controls']/div/form[1]/div[1]/div/span/button"));
                    js.ExecuteScript("arguments[0].click();", IParcelNoClick);
                    Thread.Sleep(3000);
                    try
                    {
                        IWebElement         ITaxSearch    = driver.FindElement(By.XPath("//*[@id='results']"));
                        IList <IWebElement> ITaxSearchRow = ITaxSearch.FindElements(By.TagName("li"));
                        //IList<IWebElement> ITaxSearchTD;
                        foreach (IWebElement search in ITaxSearchRow)
                        {
                            IWebElement ITaxSearchTD  = search.FindElement(By.TagName("a"));
                            string      strTaxDetails = ITaxSearchTD.GetAttribute("innerHTML");
                            if (strTaxDetails.Contains("Full bill history"))
                            {
                                js.ExecuteScript("arguments[0].click();", ITaxSearchTD);
                            }
                        }
                        //IWebElement ITaxSearch = driver.FindElement(By.PartialLinkText("Full bill history"));
                        //js.ExecuteScript("arguments[0].click();", ITaxSearch);
                        //IWebElement ITaxSearch = driver.FindElement(By.LinkText("Full bill history"));
                        //string strITaxSearch = ITaxSearch.GetAttribute("href");
                        //driver.Navigate().GoToUrl(strITaxSearch);
                        Thread.Sleep(3000);
                        gc.CreatePdf(orderNumber, parcel_no, "Full bill history", driver, "FL", "Charlotte");
                    }
                    catch { }

                    try
                    {
                        IWebElement         ITaxReal    = driver.FindElement(By.XPath("//*[@id='content']/div[1]/table"));
                        IList <IWebElement> ITaxRealRow = ITaxReal.FindElements(By.TagName("tr"));
                        IList <IWebElement> ITaxRealTd;
                        int k = 0;
                        foreach (IWebElement ItaxReal in ITaxRealRow)
                        {
                            ITaxRealTd = ItaxReal.FindElements(By.TagName("td"));
                            if ((k <= 2 && ItaxReal.Text.Contains("Annual Bill")) || ItaxReal.Text.Contains("Pay this bill:"))
                            {
                                string      yearbill      = ITaxRealTd[0].Text;
                                IWebElement ITaxBillCount = ITaxRealTd[0].FindElement(By.TagName("a"));
                                string      strTaxReal    = ITaxBillCount.GetAttribute("href");
                                strTaxRealestate.Add(strTaxReal);
                                try
                                {
                                    IWebElement ITaxBill = ITaxRealTd[3].FindElement(By.TagName("a"));
                                    string      BillTax  = ITaxBill.GetAttribute("href");
                                    gc.downloadfile(BillTax, orderNumber, parcel_no, "Taxbill.pdf" + yearbill, "FL", "Charlotte");
                                }
                                catch
                                {
                                    IWebElement ITaxBill = ITaxRealTd[4].FindElement(By.TagName("a"));
                                    string      BillTax  = ITaxBill.GetAttribute("href");
                                    gc.downloadfile(BillTax, orderNumber, parcel_no, "Taxbill.pdf" + yearbill, "FL", "Charlotte");
                                }
                                k++;
                            }
                        }


                        //Tax History Details

                        IWebElement         IBillHistorytable = driver.FindElement(By.XPath("//*[@id='content']/div[1]/table"));
                        IList <IWebElement> IBillHistoryRow   = IBillHistorytable.FindElements(By.TagName("tr"));
                        IList <IWebElement> IBillHistoryTD;
                        foreach (IWebElement bill in IBillHistoryRow)
                        {
                            IBillHistoryTD = bill.FindElements(By.TagName("td"));
                            if (IBillHistoryTD.Count != 0)
                            {
                                try
                                {
                                    strBill     = IBillHistoryTD[0].Text.Replace("\r\n", " ").TrimStart().TrimEnd();
                                    strBalance  = IBillHistoryTD[1].Text.Replace("\r\n", " ").TrimStart().TrimEnd();
                                    strBillDate = IBillHistoryTD[2].Text.Replace("\r\n", " ").TrimStart().TrimEnd();
                                    strBillPaid = IBillHistoryTD[3].Text.Replace("\r\n", " ").TrimStart().TrimEnd();
                                }
                                catch
                                {
                                    strBillDate = "";
                                    strBillPaid = "";
                                }
                                if (strBillPaid.Contains("Print (PDF)"))
                                {
                                    strBillPaid = "";
                                }
                                string strTaxHistory = strBill + "~" + strBalance + "~" + strBillDate + "~" + strBillPaid;
                                gc.insert_date(orderNumber, parcel_no, 685, strTaxHistory, 1, DateTime.Now);
                            }
                        }
                        IWebElement         IBillHistoryfoottable = driver.FindElement(By.XPath("//*[@id='content']/div[1]/table/tfoot"));
                        IList <IWebElement> IBillHistoryfootRow   = IBillHistoryfoottable.FindElements(By.TagName("tr"));
                        IList <IWebElement> IBillHistoryfootTD;
                        foreach (IWebElement bill in IBillHistoryRow)
                        {
                            IBillHistoryfootTD = bill.FindElements(By.TagName("th"));
                            if (IBillHistoryfootTD.Count != 0 && bill.Text.Contains("Total"))
                            {
                                try
                                {
                                    strFBill     = IBillHistoryfootTD[0].Text.Replace("\r\n", " ").TrimStart().TrimEnd();
                                    strFBalance  = IBillHistoryfootTD[1].Text.Replace("\r\n", " ").TrimStart().TrimEnd();
                                    strFBillDate = IBillHistoryfootTD[2].Text.Replace("\r\n", " ").TrimStart().TrimEnd();
                                    strFBillPaid = IBillHistoryfootTD[3].Text.Replace("\r\n", " ").TrimStart().TrimEnd();
                                }
                                catch
                                {
                                    strFBillDate = "";
                                    strFBillPaid = "";
                                }
                                if (strBillPaid.Contains("Print (PDF)"))
                                {
                                    strBillPaid = "";
                                }
                                string strTaxHistory = strFBill + "~" + strFBalance + "~" + strFBillDate + "~" + strFBillPaid;
                                gc.insert_date(orderNumber, parcel_no, 685, strTaxHistory, 1, DateTime.Now);
                            }
                        }
                    }
                    catch { }
                    foreach (string real in strTaxRealestate)
                    {
                        driver.Navigate().GoToUrl(real);
                        Thread.Sleep(4000);

                        try
                        {
                            TaxYear = driver.FindElement(By.XPath("//*[@id='content']/div[1]/div[8]/div/div[1]")).Text;
                            TaxYear = WebDriverTest.After(TaxYear, "Real Estate").Trim();
                            string   s     = TaxYear;
                            string[] words = TaxYear.Split(' ');
                            TaxYear = words[0];
                        }
                        catch
                        {
                            TaxYear = driver.FindElement(By.XPath("//*[@id='content']/div[1]/div[7]/div/div[1]")).Text;
                            TaxYear = WebDriverTest.After(TaxYear, "Real Estate").Trim();
                            string   s     = TaxYear;
                            string[] words = TaxYear.Split(' ');
                            TaxYear = words[0];
                        }

                        gc.CreatePdf(orderNumber, parcel_no, "Tax details" + TaxYear, driver, "FL", "Charlotte");
                        IWebElement multitableElement3;
                        try
                        {
                            multitableElement3 = driver.FindElement(By.XPath("//*[@id='content']/div[1]/div[8]/div/table[2]/tbody"));
                        }
                        catch
                        {
                            multitableElement3 = driver.FindElement(By.XPath("//*[@id='content']/div[1]/div[7]/div/table[2]/tbody"));
                        }
                        IList <IWebElement> multitableRow3 = multitableElement3.FindElements(By.TagName("tr"));

                        IList <IWebElement> multirowTD3;
                        foreach (IWebElement row in multitableRow3)
                        {
                            multirowTD3 = row.FindElements(By.TagName("td"));
                            if (multirowTD3.Count != 1 && multirowTD3[1].Text.Trim() != "")
                            {
                                string tax_distri = TaxYear + "~" + multirowTD3[0].Text.Trim() + "~" + "Ad Valorem" + "~" + multirowTD3[1].Text.Trim() + "~" + multirowTD3[2].Text.Trim() + "~" + multirowTD3[3].Text.Trim() + "~" + multirowTD3[4].Text.Trim() + "~" + "" + "~" + multirowTD3[5].Text.Trim();
                                gc.insert_date(orderNumber, parcel_no, 683, tax_distri, 1, DateTime.Now);
                            }
                        }

                        //total advalorem
                        IWebElement multitableElement31;
                        try
                        {
                            multitableElement31 = driver.FindElement(By.XPath("//*[@id='content']/div[1]/div[8]/div/table[2]/tfoot"));
                        }
                        catch
                        {
                            multitableElement31 = driver.FindElement(By.XPath("//*[@id='content']/div[1]/div[7]/div/table[2]/tfoot"));
                        }
                        IList <IWebElement> multitableRow31 = multitableElement31.FindElements(By.TagName("tr"));

                        IList <IWebElement> multirowTD31;
                        foreach (IWebElement row in multitableRow31)
                        {
                            multirowTD31 = row.FindElements(By.TagName("td"));
                            if (multirowTD31.Count != 1)
                            {
                                string tax_distri1 = TaxYear + "~" + "Total:" + "~" + "Ad Valorem" + "~" + multirowTD31[0].Text.Trim() + "~" + "" + "~" + "" + "~" + "" + "~" + "" + "~" + multirowTD31[1].Text.Trim();
                                gc.insert_date(orderNumber, parcel_no, 683, tax_distri1, 1, DateTime.Now);
                            }
                        }
                        //  Non - Ad Valorem
                        try
                        {
                            IWebElement multitableElement32;
                            try
                            {
                                multitableElement32 = driver.FindElement(By.XPath("//*[@id='content']/div[1]/div[8]/div/table[3]/tbody"));
                            }
                            catch
                            {
                                multitableElement32 = driver.FindElement(By.XPath("//*[@id='content']/div[1]/div[7]/div/table[3]/tbody"));
                            }
                            IList <IWebElement> multitableRow32 = multitableElement32.FindElements(By.TagName("tr"));
                            IList <IWebElement> multirowTD32;
                            foreach (IWebElement row in multitableRow32)
                            {
                                multirowTD32 = row.FindElements(By.TagName("td"));
                                if (multirowTD32.Count != 1 && multirowTD32[0].Text.Trim() != "")
                                {
                                    string tax_distri2 = TaxYear + "~" + multirowTD32[0].Text.Trim() + "~" + "Non-Ad Valorem " + "~" + "" + "~" + "" + "~" + "" + "~" + "" + "~" + multirowTD32[1].Text.Trim() + "~" + multirowTD32[2].Text.Trim();
                                    gc.insert_date(orderNumber, parcel_no, 683, tax_distri2, 1, DateTime.Now);
                                }
                            }
                            //total non-advalorem

                            IWebElement multitableElement33;
                            try
                            {
                                multitableElement33 = driver.FindElement(By.XPath("//*[@id='content']/div[1]/div[8]/div/table[3]/tfoot"));
                            }
                            catch
                            {
                                multitableElement33 = driver.FindElement(By.XPath("//*[@id='content']/div[1]/div[7]/div/table[3]/tfoot"));
                            }
                            IList <IWebElement> multitableRow33 = multitableElement33.FindElements(By.TagName("tr"));
                            IList <IWebElement> multirowTD33;
                            foreach (IWebElement row in multitableRow33)
                            {
                                multirowTD33 = row.FindElements(By.TagName("td"));
                                if (multirowTD33.Count != 0)
                                {
                                    string tax_distri1 = TaxYear + "~" + "Total:" + "~" + "Non-Ad Valorem " + "~" + "" + "~" + "" + "~" + "" + "~" + "" + "~" + "" + "~" + multirowTD33[0].Text.Trim();
                                    gc.insert_date(orderNumber, parcel_no, 683, tax_distri1, 1, DateTime.Now);
                                }
                            }
                        }
                        catch { }
                        try
                        {
                            TaxAmount = driver.FindElement(By.XPath("//*[@id='content']/div[1]/div[7]/div/p")).Text.Replace("Combined taxes and assessments:", "");
                        }
                        catch { }
                        string IfPaidBy = "", PlesePay = "", DueDate = "", deli = "";
                        try
                        {
                            IWebElement         multitableElement26 = driver.FindElement(By.XPath("//*[@id='content']/div[1]/div[8]/div/table[4]/tbody"));
                            IList <IWebElement> multitableRow26     = multitableElement26.FindElements(By.TagName("tr"));

                            IList <IWebElement> multirowTD26;
                            foreach (IWebElement row in multitableRow26)
                            {
                                multirowTD26 = row.FindElements(By.TagName("td"));
                                int iRowsCount = multirowTD26.Count;
                                for (int n = 0; n < iRowsCount; n++)
                                {
                                    if ((!multirowTD26[n].Text.Contains("Face Amt")) && (!multirowTD26[n].Text.Contains("Certificate")))
                                    {
                                        IfPaidBy = multirowTD26[n].Text.Replace("\r\n", "~");
                                        var IfpaySplit = IfPaidBy.Split('~');
                                        if (Convert.ToInt16(IfpaySplit.Count()) > 1)
                                        {
                                            IfPaidBy = IfpaySplit[0];
                                            PlesePay = IfpaySplit[1];
                                            if (PlesePay == "$0.00")
                                            {
                                                deli = "paid";
                                            }
                                            else
                                            {
                                                deli = "deliquent";
                                            }
                                            DueDate = TaxYear + "~" + deli + "~" + TaxAmount + "~" + IfPaidBy + "~" + PlesePay;
                                            gc.insert_date(orderNumber, parcel_no, 686, DueDate, 1, DateTime.Now);
                                        }
                                    }
                                }
                            }
                        }
                        //If_paid_by~Please_Pay
                        catch
                        {
                        }
                        try
                        {
                            IWebElement         multitableElement26 = driver.FindElement(By.XPath("//*[@id='content']/div[1]/div[7]/div/table[4]/tbody"));
                            IList <IWebElement> multitableRow26     = multitableElement26.FindElements(By.TagName("tr"));

                            IList <IWebElement> multirowTD26;
                            foreach (IWebElement row in multitableRow26)
                            {
                                multirowTD26 = row.FindElements(By.TagName("td"));
                                int iRowsCount = multirowTD26.Count;
                                for (int n = 0; n < iRowsCount; n++)
                                {
                                    if ((!multirowTD26[n].Text.Contains("Face Amt")) && (!multirowTD26[n].Text.Contains("Certificate")))
                                    {
                                        IfPaidBy = multirowTD26[n].Text.Replace("\r\n", "~");
                                        string[] IfpaySplit = IfPaidBy.Split('~');
                                        if (Convert.ToInt16(IfpaySplit.Count()) > 1)
                                        {
                                            IfPaidBy = IfpaySplit[0];
                                            PlesePay = IfpaySplit[1];
                                            if (PlesePay == "$0.00")
                                            {
                                                deli = "paid";
                                            }
                                            else
                                            {
                                                deli = "deliquent";
                                            }
                                            DueDate = TaxYear + "~" + deli + "~" + TaxAmount + "~" + IfPaidBy + "~" + PlesePay;
                                            gc.insert_date(orderNumber, parcel_no, 686, DueDate, 1, DateTime.Now);
                                        }
                                    }
                                }
                            }
                        }
                        catch { }
                        //*[@id="content"]/div[1]/div[3]/div[1]/ul/li[1]/a
                        try
                        {
                            //driver.FindElement(By.XPath("//*[@id='content']/div[1]/div[3]/div[1]/ul/li[1]/a")).Click();
                            //Thread.Sleep(5000);
                            IWebElement         IBasicDetails    = driver.FindElement(By.XPath("//*[@id='content']"));
                            IList <IWebElement> IBasicDetailsRow = IBasicDetails.FindElements(By.TagName("li"));
                            IWebElement         IBasicDetailsTD  = null;
                            foreach (IWebElement basic in IBasicDetailsRow)
                            {
                                string strClick = basic.GetAttribute("innerHTML");
                                if (strClick.Contains("Parcel details"))
                                {
                                    IBasicDetailsTD = basic.FindElement(By.TagName("img"));
                                    js.ExecuteScript("arguments[0].click();", IBasicDetailsTD);
                                    Thread.Sleep(5000);
                                }
                            }
                        }
                        catch { }
                        gc.CreatePdf(orderNumber, parcel_no, "parcel details" + TaxYear, driver, "FL", "Charlotte");
                        string charitable = "";
                        string ownertax = "", situs = "", alternate_key = "", legal = "", total_aces = "", AssessedValue = "", School_AssessedValue = "", homestead_exemption = "", homestead_school = "", additional_homestead = "", advalorem = "", nonadvalorem = "", total_discount = "", noDiscount = "", total_tax = "", paiddate = "";
                        string taxinfodetails1 = driver.FindElement(By.XPath("//*[@id='content']/div[1]/div[3]/div[2]")).Text.Replace("\r\n", "");

                        ownertax       = gc.Between(taxinfodetails1, "Owner", "Situs").Trim();
                        situs          = gc.Between(taxinfodetails1, "Situs", "Account number").Trim();
                        Account_number = gc.Between(taxinfodetails1, "Account number", "Alternate Key").Trim();
                        alternate_key  = gc.Between(taxinfodetails1, "Alternate Key", "Millage code").Trim();
                        Millage_Code   = gc.Between(taxinfodetails1, "Millage code", "Millage rate").Trim();
                        try
                        {
                            Millage_rate = gc.Between(taxinfodetails1, "Millage rate", "Escrow").Trim();
                        }
                        catch
                        {
                            Millage_rate = gc.Between(taxinfodetails1, "Millage rate", "Assessed value").Trim();
                        }
                        try
                        {
                            AssessedValue = gc.Between(taxinfodetails1, "Assessed value", "School assessed value").Trim();
                        }
                        catch { }
                        try
                        {
                            School_AssessedValue = gc.Between(taxinfodetails1, "School assessed value", "Flags").Trim();
                        }
                        catch
                        {
                        }
                        try
                        {
                            School_AssessedValue = gc.Between(taxinfodetails1, "School assessed value", "Exemptions").Trim();
                        }
                        catch
                        {
                            School_AssessedValue = GlobalClass.After(taxinfodetails1, "School assessed value").Trim();
                        }
                        try
                        {
                            homestead_exemption  = gc.Between(taxinfodetails1, "HOMESTEAD EXEMPTION", "HOMESTEAD SCHOOL").Trim();
                            homestead_school     = gc.Between(taxinfodetails1, "HOMESTEAD SCHOOL", "ADDITIONAL HOMESTEAD").Trim();
                            additional_homestead = GlobalClass.After(taxinfodetails1, "ADDITIONAL HOMESTEAD").Trim();
                        }
                        catch { }

                        try
                        {
                            charitable = GlobalClass.After(taxinfodetails1, "CHARITABLE").Trim();
                        }
                        catch { }
                        string taxinfodetails2 = driver.FindElement(By.XPath("//*[@id='content']/div[1]/div[4]")).Text.Replace("\r\n", "");
                        advalorem      = gc.Between(taxinfodetails2, "Ad valorem", "Non-ad valorem").Trim();
                        nonadvalorem   = gc.Between(taxinfodetails2, "Non-ad valorem", "Total Discountable").Trim();
                        total_discount = gc.Between(taxinfodetails2, "Total Discountable", "No Discount").Trim();
                        noDiscount     = gc.Between(taxinfodetails2, "No Discount NAVA", "Total tax").Trim();
                        total_tax      = gc.Between(taxinfodetails2, "Total tax", "Legal description").Trim();
                        legal          = gc.Between(taxinfodetails2, "Legal description", "Location").Trim();
                        total_aces     = GlobalClass.After(taxinfodetails2, "Total acres").Trim();
                        string taxinfodetails3 = driver.FindElement(By.XPath("//*[@id='content']/div[1]/div[3]/div[1]")).Text;
                        if (taxinfodetails3.Contains("Pay this bill"))
                        {
                            PaidAmount = taxinfodetails3.Replace("Pay this bill:", "&");
                            var PaidAmount1 = PaidAmount.Split('&');
                            PaidAmount = PaidAmount1[1];
                            try
                            {
                                paiddate = gc.Between(PaidAmount, "PAID", "$").Trim();
                            }
                            catch
                            {
                                paiddate = "";
                            }
                            PaidAmount = WebDriverTest.After(PaidAmount, "$").Trim();
                            try
                            {
                                ReceiptNumber = PaidAmount1[2].Replace("Receipt", "");
                            }
                            catch { }
                        }
                        else
                        {
                            PaidAmount    = "";
                            ReceiptNumber = "";
                            paiddate      = "";
                        }
                        //         Owner Information~Situs Address~Tax Year~Account number~Alternate Key~Millage code~Millage rate~Legal description~Total acres~Assessed value~School assessed value~HOMESTEAD EXEMPTION~HOMESTEAD SCHOOL~ADDITIONAL HOMESTEAD~Ad valorem~Non - ad valorem~Total Discountable~No Discount NAVA~Total tax~PaidDate~Paid Amount~Receipt #~Tax Authority

                        string tax_info1 = ownertax + "~" + situs + "~" + TaxYear + "~" + Account_number + "~" + alternate_key + "~" + Millage_Code + "~" + Millage_rate + "~" + legal + "~" + total_aces + "~" + AssessedValue + "~" + School_AssessedValue + "~" + homestead_exemption + "~" + homestead_school + "~" + additional_homestead + "~" + charitable + "~" + advalorem + "~" + nonadvalorem + "~" + total_discount + "~" + noDiscount + "~" + total_tax + "~" + paiddate + "~" + PaidAmount + "~" + ReceiptNumber + "~" + "Charlotte County Tax Collector 18500 Murdock Circle Port Charlotte, FL 33948 Phone: (941)743-1350 -or- (941)681-3710";
                        gc.insert_date(orderNumber, parcel_no, 684, tax_info1, 1, DateTime.Now);
                    }

                    TaxTime     = DateTime.Now.ToString("HH:mm:ss");
                    LastEndTime = DateTime.Now.ToString("HH:mm:ss");
                    gc.insert_TakenTime(orderNumber, "FL", "Charlotte", StartTime, AssessmentTime, TaxTime, CitytaxTime, LastEndTime);

                    driver.Quit();
                    gc.mergpdf(orderNumber, "FL", "Charlotte");
                    return("Data Inserted Successfully");
                }
                catch (Exception ex)
                {
                    driver.Quit();
                    throw ex;
                }
            }
        }