Esempio n. 1
0
        public void taxTRA()
        {
            //try
            //{
            //    string Nodata = driver.FindElement(By.XPath("//*[@id='ResultDiv']/div")).Text;
            //    if (Nodata.Contains("Sorry,")&& listurldistinct.Count==0)
            //    {
            //        HttpContext.Current.Session["CASanJoaquin_Zero"] = "Zero";
            //        driver.Quit();
            //        Tax++;

            //    }
            //}
            //catch { }
            try
            {
                strtaxTRA = driver.FindElement(By.XPath("//*[@id='ResultDiv']/div[1]/div/div/p")).Text;
                if (strtaxTRA.Contains("TRA : "))
                {
                    string strtaxdetails = driver.FindElement(By.XPath("//*[@id='ResultDiv']/div[1]/div/div/p")).Text;
                    strTRA = WebDriverTest.Between(strtaxdetails, "TRA : ", "\r\nRoll Cat.");
                }
            }
            catch { }
        }
        public string FTP_NMBernalillo(string houseno, string sname, string sttype, string parcelNumber, string searchType, string orderNumber, string ownername, string dierctSearch)
        {
            GlobalClass.global_orderNo             = orderNumber;
            HttpContext.Current.Session["orderNo"] = orderNumber;
            GlobalClass.global_parcelNo            = parcelNumber;

            string StartTime = "", AssessmentTime = "", TaxTime = "", CitytaxTime = "", LastEndTime = "";

            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");
                    if (searchType == "titleflex")
                    {
                        string address = houseno + " " + sname;
                        gc.TitleFlexSearch(orderNumber, parcelNumber, "", address, "NM", "Bernalillo");
                        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_NMBernalillio"] = "Yes";
                            driver.Quit();
                            return("No Data Found");
                        }
                        parcelNumber = HttpContext.Current.Session["titleparcel"].ToString();
                        searchType   = "parcel";
                    }
                    if (searchType == "address")
                    {
                        string result = "";
                        // http://assessor.bernco.gov/public.access/Search/Disclaimer.aspx?FromUrl=../search/commonsearch.aspx?mode=realprop
                        driver.Navigate().GoToUrl("http://assessor.bernco.gov/public.access/Search/Disclaimer.aspx?FromUrl=../search/commonsearch.aspx?mode=realprop");
                        try
                        {
                            driver.FindElement(By.XPath("//*[@id='topmenu']/ul/li[1]/a")).Click();
                            Thread.Sleep(2000);
                        }
                        catch
                        { }
                        driver.FindElement(By.XPath("//*[@id='btAgree']")).SendKeys(Keys.Enter);
                        driver.FindElement(By.Id("inpNo")).SendKeys(houseno);
                        driver.FindElement(By.XPath("//*[@id='inpStreet']")).SendKeys(sname);
                        gc.CreatePdf_WOP(orderNumber, "InputPassed AddressSearch", driver, "NM", "Bernalillo");
                        driver.FindElement(By.Id("inpStreet")).SendKeys(Keys.Enter);
                        Thread.Sleep(6000);
                        try
                        {
                            result = driver.FindElement(By.XPath("//*[@id='ml']")).Text;
                        }

                        catch
                        {
                        }

                        try
                        {
                            srtAddress = driver.FindElement(By.XPath("//*[@id='frmMain']/table/tbody/tr/td/div/div/table[2]/tbody/tr/td/table/tbody/tr[3]/td/center/table[1]/tbody/tr/td[3]")).Text;
                            Address    = Convert.ToInt32(WebDriverTest.Between(srtAddress, "Displaying 1 - ", " of"));


                            if (Address > 15)
                            {
                                HttpContext.Current.Session["multiParcel_NMBernalillo_count"] = "Maximum";
                                driver.Quit();
                                return("Maximum");
                            }
                            if (srtAddress != "" && Address <= 15 && !result.Contains("Return to Search Results"))
                            {
                                IWebElement         IAddressTable = driver.FindElement(By.XPath("//*[@id='searchResults']/tbody"));
                                IList <IWebElement> IAddressrow   = IAddressTable.FindElements(By.TagName("tr"));
                                IList <IWebElement> IAddressTD;
                                foreach (IWebElement Row in IAddressrow)
                                {
                                    IAddressTD = Row.FindElements(By.TagName("td"));
                                    HttpContext.Current.Session["multiparcel_NMBernalillo"] = "Yes";
                                    if (IAddressTD.Count != 0 && !Row.Text.Contains("Parcel ID") && Row.Text != "")
                                    {
                                        string ParcelID = IAddressTD[0].Text;
                                        string Owner    = IAddressTD[1].Text;
                                        string Addres   = IAddressTD[2].Text;
                                        string Property = Owner + "~" + Addres;
                                        gc.insert_date(orderNumber, ParcelID, 98, Property, 1, DateTime.Now);
                                        gc.CreatePdf_WOP(orderNumber, "Mulitparcelgrid", driver, "NM", "Bernalillo");
                                    }
                                }
                                driver.Quit();
                                return("MultiParcel");
                            }
                            else
                            {
                            }
                        }
                        catch { }
                    }

                    if (searchType == "parcel")
                    {
                        driver.Navigate().GoToUrl("http://assessor.bernco.gov/public.access/search/commonsearch.aspx?mode=parid");
                        try
                        {
                            driver.FindElement(By.XPath("//*[@id='topmenu']/ul/li[1]/a")).Click();
                            Thread.Sleep(2000);
                        }
                        catch
                        { }
                        driver.FindElement(By.XPath("//*[@id='btAgree']")).SendKeys(Keys.Enter);
                        driver.FindElement(By.Id("inpSuf")).SendKeys(parcelNumber);
                        gc.CreatePdf(orderNumber, parcelNumber, "InputPassed ParcelSearch", driver, "NM", "Bernalillo");
                        driver.FindElement(By.XPath("//*[@id='btSearch']")).SendKeys(Keys.Enter);
                        Thread.Sleep(6000);
                    }

                    try
                    {
                        IWebElement INodata = driver.FindElement(By.XPath("//*[@id='frmMain']/table/tbody/tr/td/div/div/table[2]"));
                        if (INodata.Text.Contains("search did not find any records"))
                        {
                            HttpContext.Current.Session["Nodata_NMBernalillio"] = "Yes";
                            driver.Quit();
                            return("No Data Found");
                        }
                    }
                    catch { }

                    //Property Details
                    driver.FindElement(By.XPath("//*[@id='sidemenu']/li[1]/a")).SendKeys(Keys.Enter);
                    //Screenshot
                    gc.CreatePdf_WOP(orderNumber, "PropertyDetails", driver, "NM", "Bernalillo");
                    //Profile
                    outparcelno           = driver.FindElement(By.XPath("//*[@id='datalet_header_row']/td/table/tbody/tr[1]/td[1]")).Text;
                    outparcelno           = WebDriverTest.After(outparcelno, ": ");
                    strClassname          = driver.FindElement(By.XPath("/html/body/div/div[3]/section/div/form/div[3]/div/div/table/tbody/tr/td/table/tbody/tr[2]/td/div/div[1]/table[2]/tbody/tr[1]/td[2]")).Text;
                    strTaxdistrcit        = driver.FindElement(By.XPath("/html/body/div/div[3]/section/div/form/div[3]/div/div/table/tbody/tr/td/table/tbody/tr[2]/td/div/div[1]/table[2]/tbody/tr[2]/td[2]")).Text;
                    strTaxyear            = driver.FindElement(By.XPath("/html/body/div/div[3]/section/div/form/div[3]/div/div/table/tbody/tr/td/table/tbody/tr[2]/td/div/div[2]/table[2]/tbody/tr[1]/td[2]")).Text;
                    strOwnername          = driver.FindElement(By.XPath("/html/body/div/div[3]/section/div/form/div[3]/div/div/table/tbody/tr/td/table/tbody/tr[2]/td/div/div[2]/table[2]/tbody/tr[2]/td[2]")).Text;
                    strLocationaddrss     = driver.FindElement(By.XPath("/html/body/div/div[3]/section/div/form/div[3]/div/div/table/tbody/tr/td/table/tbody/tr[2]/td/div/div[4]/table[2]/tbody/tr[1]/td[2]")).Text;
                    strCity               = driver.FindElement(By.XPath("/html/body/div/div[3]/section/div/form/div[3]/div/div/table/tbody/tr/td/table/tbody/tr[2]/td/div/div[4]/table[2]/tbody/tr[2]/td[2]")).Text;
                    strProprtydescription = driver.FindElement(By.XPath("/html/body/div/div[3]/section/div/form/div[3]/div/div/table/tbody/tr/td/table/tbody/tr[2]/td/div/div[4]/table[2]/tbody/tr[5]/td[2]")).Text;
                    strRealproperty       = driver.FindElement(By.XPath("/html/body/div/div[3]/section/div/form/div[3]/div/div/table/tbody/tr/td/table/tbody/tr[2]/td/div/div[6]/table[2]/tbody/tr[1]/td[2]")).Text;
                    strYearBuilt          = driver.FindElement(By.XPath("/html/body/div/div[3]/section/div/form/div[3]/div/div/table/tbody/tr/td/table/tbody/tr[2]/td/div/div[6]/table[2]/tbody/tr[2]/td[2]")).Text;
                    strLotSize            = driver.FindElement(By.XPath("/html/body/div/div[3]/section/div/form/div[3]/div/div/table/tbody/tr/td/table/tbody/tr[2]/td/div/div[6]/table[2]/tbody/tr[3]/td[2]")).Text;
                    strLandUseCode        = driver.FindElement(By.XPath("/html/body/div/div[3]/section/div/form/div[3]/div/div/table/tbody/tr/td/table/tbody/tr[2]/td/div/div[6]/table[2]/tbody/tr[4]/td[2]")).Text;
                    strStyle              = driver.FindElement(By.XPath("/html/body/div/div[3]/section/div/form/div[3]/div/div/table/tbody/tr/td/table/tbody/tr[2]/td/div/div[6]/table[2]/tbody/tr[5]/td[2]")).Text;

                    string property_details = strClassname + "~" + strTaxdistrcit + "~" + strTaxyear + "~" + strOwnername + "~" + strLocationaddrss + "~" + strCity + "~" + strProprtydescription + "~" + strRealproperty + "~" + strYearBuilt + "~" + strLotSize + "~" + strLandUseCode + "~" + strStyle;
                    gc.insert_date(orderNumber, outparcelno, 100, property_details, 1, DateTime.Now);

                    //Assement Details
                    driver.FindElement(By.XPath("//*[@id='sidemenu']/li[2]/a")).SendKeys(Keys.Enter);
                    //Screenshot
                    gc.CreatePdf(orderNumber, outparcelno, "Assessment Details", driver, "NM", "Bernalillo");
                    //Values
                    strValues          = driver.FindElement(By.XPath("/html/body/div/div[3]/section/div/form/div[3]/div/div/table/tbody/tr/td/table/tbody/tr[2]/td/div/div[1]/table[2]/tbody/tr[1]/td[2]")).Text;
                    strFullLandValue   = driver.FindElement(By.XPath("/html/body/div/div[3]/section/div/form/div[3]/div/div/table/tbody/tr/td/table/tbody/tr[2]/td/div/div[1]/table[2]/tbody/tr[2]/td[2]")).Text;
                    strTablevalues     = driver.FindElement(By.XPath("/html/body/div/div[3]/section/div/form/div[3]/div/div/table/tbody/tr/td/table/tbody/tr[2]/td/div/div[1]/table[2]/tbody/tr[3]/td[2]")).Text;
                    strFullImpValue    = driver.FindElement(By.XPath("/html/body/div/div[3]/section/div/form/div[3]/div/div/table/tbody/tr/td/table/tbody/tr[2]/td/div/div[1]/table[2]/tbody/tr[4]/td[2]")).Text;
                    strTotalValue      = driver.FindElement(By.XPath("/html/body/div/div[3]/section/div/form/div[3]/div/div/table/tbody/tr/td/table/tbody/tr[2]/td/div/div[1]/table[2]/tbody/tr[5]/td[2]")).Text;
                    strTaxable         = driver.FindElement(By.XPath("/html/body/div/div[3]/section/div/form/div[3]/div/div/table/tbody/tr/td/table/tbody/tr[2]/td/div/div[1]/table[2]/tbody/tr[7]/td[2]")).Text;
                    strException       = driver.FindElement(By.XPath("/html/body/div/div[3]/section/div/form/div[3]/div/div/table/tbody/tr/td/table/tbody/tr[2]/td/div/div[2]/table[2]/tbody/tr[1]/td[2]")).Text;
                    strVetaranan       = driver.FindElement(By.XPath("/html/body/div/div[3]/section/div/form/div[3]/div/div/table/tbody/tr/td/table/tbody/tr[2]/td/div/div[2]/table[2]/tbody/tr[2]/td[2]")).Text;
                    strOther           = driver.FindElement(By.XPath("/html/body/div/div[3]/section/div/form/div[3]/div/div/table/tbody/tr/td/table/tbody/tr[2]/td/div/div[2]/table[2]/tbody/tr[3]/td[2]")).Text;
                    strNettaxablevalue = driver.FindElement(By.XPath("/html/body/div/div[3]/section/div/form/div[3]/div/div/table/tbody/tr/td/table/tbody/tr[2]/td/div/div[3]/table[2]/tbody/tr[1]/td[2]")).Text;

                    string assement_details = strValues + "~" + strFullLandValue + "~" + strTablevalues + "~" + strFullImpValue + "~" + strTotalValue + "~" + strTaxable + "~" + strException + "~" + strVetaranan + "~" + strOther + "~" + strNettaxablevalue;
                    gc.insert_date(orderNumber, outparcelno, 101, assement_details, 1, DateTime.Now);
                    AssessmentTime = DateTime.Now.ToString("HH:mm:ss");

                    //Tax Status

                    driver.Navigate().GoToUrl("https://www.bernco.gov/treasurer/property-tax-search.aspx");

                    //Screenshot
                    gc.CreatePdf(orderNumber, outparcelno, "Address Search Result", driver, "NM", "Bernalillo");

                    //Tax Authority
                    Tax_Authority = "One Civic Plaza NW Albuquerque, NM 87102";

                    IWebElement LinkSearch = driver.FindElement(By.XPath("//*[@id='_af46712e95534fbaab28f66852f6c7ca_pnl02cd722299cd4618a01367f388ce5d42Content']/p[5]")).FindElement(By.TagName("a"));
                    string      linkhref   = LinkSearch.GetAttribute("href");
                    driver.Navigate().GoToUrl(linkhref);
                    IJavaScriptExecutor js1 = driver as IJavaScriptExecutor;
                    //js1.ExecuteScript("arguments[0].click();", LinkSearch);
                    //Thread.Sleep(7000);

                    //js1.ExecuteScript("document.getElementById('ctl03_TemplateBody_ctl00_PageLayout_ctl00_Placeholder3_ctl00_pageContent_ctl00_Placeholder5_ctl00_ctl00_parcelId').value='" + outparcelno + "'");
                    //gc.CreatePdf(orderNumber, outparcelno, "Parcel Search", driver, "NM", "Bernalillo");

                    Thread.Sleep(3000);
                    gc.CreatePdf(orderNumber, outparcelno, "Parcel Search Result", driver, "NM", "Bernalillo");
                    driver.FindElement(By.Id("ctl03_TemplateBody_ctl00_PageLayout_ctl00_Placeholder3_ctl00_pageContent_ctl00_PlaceHolder2_ctl00_searchByParcel")).Click();
                    Thread.Sleep(3000);
                    driver.FindElement(By.Id("ctl03_TemplateBody_ctl00_PageLayout_ctl00_Placeholder3_ctl00_pageContent_ctl00_Placeholder5_ctl00_ctl00_parcelId")).SendKeys(outparcelno);
                    gc.CreatePdf(orderNumber, outparcelno, "Parcel Click Result", driver, "NM", "Bernalillo");
                    driver.FindElement(By.Id("ctl03_TemplateBody_ctl00_PageLayout_ctl00_Placeholder3_ctl00_pageContent_ctl00_Placeholder5_ctl00_ctl00_submit")).Click();
                    Thread.Sleep(2000);
                    //IWebElement ParcelLinkSearch = driver.FindElement(By.XPath("//*[@id='ctl03_TemplateBody_ctl00_PageLayout_ctl00_Placeholder3_ctl00_pageContent_ctl00_Placeholder5_ctl00_placeHolder_ctl00_resultList_ctl00_ctl04_parcel']"));
                    //js1.ExecuteScript("arguments[0].click();", ParcelLinkSearch);
                    //Thread.Sleep(7000);
                    //gc.CreatePdf(orderNumber, outparcelno, "Parcel Search", driver, "NM", "Bernalillo");

                    ////Current OwnerShip Data
                    //IWebElement IOwnerSubmit = driver.FindElement(By.XPath("/html/body/form/div[6]/div[5]/div[1]/div[1]/div[3]/div[2]/div/table/tbody"));
                    //js1.ExecuteScript("arguments[0].click();", IOwnerSubmit);
                    //gc.CreatePdf(orderNumber, outparcelno, "Current OwnerShip Search", driver, "NM", "Bernalillo");
                    //Thread.Sleep(7000);
                    //outparcelno = driver.FindElement(By.XPath("/html/body/form/div[6]/div[5]/div[1]/div[1]/div[3]/div[2]/div/table/tbody/tr[2]/td/table/tbody/tr[1]/td")).Text;
                    IWebElement ButtonLinkSearch = driver.FindElement(By.Id("ctl03_TemplateBody_ctl00_PageLayout_ctl00_Placeholder3_ctl00_pageContent_ctl00_Placeholder5_ctl00_placeHolder_ctl00_resultList_ctl00_ctl04_parcel"));
                    js1.ExecuteScript("arguments[0].click();", ButtonLinkSearch);
                    Thread.Sleep(9000);
                    string Ownershiptable = driver.FindElement(By.XPath("//*[@id='aspnetForm']/div[6]/div[5]/div[1]/div[1]/div[3]/div[2]/div/table/tbody/tr[2]/td/table/tbody")).Text;
                    if (Ownershiptable.Contains("OWNER 2:"))
                    {
                        Owner1 = driver.FindElement(By.Id("ctl03_TemplateBody_ctl00_PageLayout_ctl00_Placeholder3_ctl00_pageContent_ctl00_Placeholder5_ctl00_placeHolder_ctl00_owner2Row")).Text.Replace("OWNER 2:", "");
                    }
                    else
                    {
                        Owner1 = driver.FindElement(By.Id("ctl03_TemplateBody_ctl00_PageLayout_ctl00_Placeholder3_ctl00_pageContent_ctl00_Placeholder5_ctl00_placeHolder_ctl00_owner1Row")).Text.Replace("OWNER 1:", "");
                    }
                    Location_Address = driver.FindElement(By.XPath("//*[@id='aspnetForm']/div[6]/div[5]/div[1]/div[1]/div[3]/div[2]/div/table/tbody/tr[3]/td/table/tbody/tr/td")).Text;
                    LegalDescription = driver.FindElement(By.XPath("//*[@id='aspnetForm']/div[6]/div[5]/div[1]/div[1]/div[3]/div[2]/div/table/tbody/tr[4]/td/ul/li")).Text;

                    //Notice Of Values
                    IWebElement IValue = driver.FindElement(By.Id("ctl03_TemplateBody_ctl00_PageLayout_ctl00_Placeholder3_ctl00_pageContent_ctl00_PlaceHolder2_ctl00_noticeOfValues"));
                    //js1.ExecuteScript("arguments[0].click();", IValue);
                    IValue.Click();
                    Thread.Sleep(7000);
                    gc.CreatePdf(orderNumber, outparcelno, "Notice of Values Search", driver, "NM", "Bernalillo");

                    //Screenshot

                    //Tax Bill Download
                    IWebElement ITaxbill = driver.FindElement(By.Id("ctl03_TemplateBody_ctl00_PageLayout_ctl00_Placeholder3_ctl00_pageContent_ctl00_PlaceHolder2_ctl00_taxBill"));
                    //js1.ExecuteScript("arguments[0].click();", ITaxbill);
                    ITaxbill.Click();
                    Thread.Sleep(7000);
                    gc.CreatePdf(orderNumber, outparcelno, "Tax Bill Search", driver, "NM", "Bernalillo");
                    //Screenshot
                    try
                    {
                        //Take tax bills amount and store into table
                        IWebElement         tbTaxbill = driver.FindElement(By.XPath("//*[@id='ctl03_TemplateBody_ctl00_PageLayout_ctl00_Placeholder3_ctl00_pageContent_ctl00_Placeholder5_ctl00_placeHolder_ctl00_panel']/div/table[1]/tbody/tr/td[2]/table/tbody"));
                        IList <IWebElement> trTaxbill = tbTaxbill.FindElements(By.TagName("tr"));
                        IList <IWebElement> tdTaxbill;
                        foreach (IWebElement row in trTaxbill)
                        {
                            tdTaxbill = row.FindElements(By.TagName("td"));
                            if (tdTaxbill.Count != 0 && tdTaxbill[0].Text != " ")
                            {
                                Agencies        = GlobalClass.After(tdTaxbill[0].Text, ":");
                                TaxRate         = GlobalClass.After(tdTaxbill[1].Text, ":");
                                NetTaxableValue = GlobalClass.After(tdTaxbill[2].Text, ":");
                                AmountDue       = GlobalClass.After(tdTaxbill[3].Text, ":");

                                if (Agencies == "")
                                {
                                    Agencies        = tdTaxbill[0].Text;
                                    TaxRate         = tdTaxbill[1].Text;
                                    NetTaxableValue = tdTaxbill[2].Text;
                                    AmountDue       = tdTaxbill[3].Text;
                                }


                                strRowData = Agencies + "~" + TaxRate + "~" + NetTaxableValue + "~" + AmountDue;
                                gc.insert_date(orderNumber, outparcelno, 115, strRowData, 1, DateTime.Now);
                            }
                        }
                    }
                    catch
                    { }
                    //OtherTaxDue
                    try
                    {
                        IWebElement         Tbtx = driver.FindElement(By.XPath("//*[@id='ctl03_TemplateBody_ctl00_PageLayout_ctl00_Placeholder3_ctl00_pageContent_ctl00_Placeholder5_ctl00_placeHolder_ctl00_panel']/div/table[2]/tbody"));
                        IList <IWebElement> TRtx = Tbtx.FindElements(By.TagName("tr"));
                        IList <IWebElement> TDtx;

                        foreach (IWebElement row5 in TRtx)
                        {
                            if (!row5.Text.Contains("YEAR"))
                            {
                                TDtx                 = row5.FindElements(By.TagName("td"));
                                OtherTaxDueYear      = driver.FindElement(By.XPath("/html/body/form/div[6]/div[5]/div[1]/div[1]/div[3]/div[2]/div/div/div/div/table[2]/tbody/tr[2]/td[1]")).Text;
                                OtherTaxDueTax       = driver.FindElement(By.XPath("/html/body/form/div[6]/div[5]/div[1]/div[1]/div[3]/div[2]/div/div/div/div/table[2]/tbody/tr[2]/td[2]")).Text;
                                OtherTaxDueInterest  = driver.FindElement(By.XPath("/html/body/form/div[6]/div[5]/div[1]/div[1]/div[3]/div[2]/div/div/div/div/table[2]/tbody/tr[2]/td[3]")).Text;
                                OtherTaxDuePanalty   = driver.FindElement(By.XPath("/html/body/form/div[6]/div[5]/div[1]/div[1]/div[3]/div[2]/div/div/div/div/table[2]/tbody/tr[2]/td[4]")).Text;
                                OtherTaxDueFees      = driver.FindElement(By.XPath("/html/body/form/div[6]/div[5]/div[1]/div[1]/div[3]/div[2]/div/div/div/div/table[2]/tbody/tr[2]/td[5]")).Text;
                                OtherTaxDueAmountDue = driver.FindElement(By.XPath("/html/body/form/div[6]/div[5]/div[1]/div[1]/div[3]/div[2]/div/div/div/div/table[2]/tbody/tr[2]/td[6]")).Text;
                                string thertax = OtherTaxDueYear + "~" + OtherTaxDueTax + "~" + OtherTaxDueInterest + "~" + OtherTaxDuePanalty + "~" + OtherTaxDueFees + "~" + OtherTaxDueAmountDue;
                                gc.insert_date(orderNumber, outparcelno, 118, thertax, 1, DateTime.Now);
                            }
                        }
                    }
                    catch { }

                    //Tax And Payment History
                    IWebElement ITaxpay = driver.FindElement(By.Id("ctl03_TemplateBody_ctl00_PageLayout_ctl00_Placeholder3_ctl00_pageContent_ctl00_PlaceHolder2_ctl00_taxPaymentHistory"));
                    //js1.ExecuteScript("arguments[0].click();", ITaxpay);
                    ITaxpay.Click();
                    Thread.Sleep(9000);
                    gc.CreatePdf(orderNumber, outparcelno, "Parcel Search", driver, "NM", "Bernalillo");

                    IWebElement         Tableinstallment = driver.FindElement(By.XPath("//*[@id='ctl03_TemplateBody_ctl00_PageLayout_ctl00_Placeholder3_ctl00_pageContent_ctl00_Placeholder5_ctl00_placeHolder_ctl00_historyList_ctl00']/tbody"));
                    IList <IWebElement> TRinstallment    = Tableinstallment.FindElements(By.TagName("tr"));
                    IList <IWebElement> TDinstallment;

                    try
                    {
                        foreach (IWebElement row in TRinstallment)
                        {
                            if (!row.Text.Contains("Summary of Taxes Due"))
                            {
                                TDinstallment = row.FindElements(By.TagName("td"));
                                if (TDinstallment.Count != 0)
                                {
                                    try
                                    {
                                        taxYear    = GlobalClass.After(TDinstallment[0].Text, "\r\n");
                                        netTaxable = GlobalClass.After(TDinstallment[1].Text, "\r\n");
                                        tax        = GlobalClass.After(TDinstallment[2].Text, "\r\n");
                                        Interest   = GlobalClass.After(TDinstallment[3].Text, "\r\n");
                                        Penalty    = GlobalClass.After(TDinstallment[4].Text, "\r\n");
                                        Fees       = GlobalClass.After(TDinstallment[5].Text, "\r\n");
                                        Paid       = GlobalClass.After(TDinstallment[6].Text, "\r\n");
                                        AmountDue  = GlobalClass.After(TDinstallment[7].Text, "\r\n");
                                        if (taxYear == "" && netTaxable == "")
                                        {
                                            taxYear    = TDinstallment[0].Text;
                                            netTaxable = TDinstallment[1].Text;
                                            tax        = TDinstallment[2].Text;
                                            Interest   = TDinstallment[3].Text;
                                            Penalty    = TDinstallment[4].Text;
                                            Fees       = TDinstallment[5].Text;
                                            Paid       = TDinstallment[6].Text;
                                            AmountDue  = TDinstallment[7].Text;
                                        }

                                        if (taxYear == "")
                                        {
                                            FirstHalftax       = driver.FindElement(By.XPath("/html/body/form/div[6]/div[5]/div[1]/div[1]/div[3]/div[2]/div[1]/div/div[1]/table/tbody/tr[12]/td[3]")).Text;
                                            FirstHalfInterest  = driver.FindElement(By.XPath("/html/body/form/div[6]/div[5]/div[1]/div[1]/div[3]/div[2]/div[1]/div/div[1]/table/tbody/tr[12]/td[4]")).Text;
                                            FirstHalfPenalty   = driver.FindElement(By.XPath("/html/body/form/div[6]/div[5]/div[1]/div[1]/div[3]/div[2]/div[1]/div/div[1]/table/tbody/tr[12]/td[5]")).Text;
                                            FirstHalfFees      = driver.FindElement(By.XPath("/html/body/form/div[6]/div[5]/div[1]/div[1]/div[3]/div[2]/div[1]/div/div[1]/table/tbody/tr[12]/td[6]")).Text;
                                            FirstHalfPaid      = driver.FindElement(By.XPath("/html/body/form/div[6]/div[5]/div[1]/div[1]/div[3]/div[2]/div[1]/div/div[1]/table/tbody/tr[12]/td[7]")).Text;
                                            FirstHalfAmountDue = driver.FindElement(By.XPath("/html/body/form/div[6]/div[5]/div[1]/div[1]/div[3]/div[2]/div[1]/div/div[1]/table/tbody/tr[12]/td[8]")).Text;

                                            SecondHalftax       = driver.FindElement(By.XPath("/html/body/form/div[6]/div[5]/div[1]/div[1]/div[3]/div[2]/div[1]/div/div[1]/table/tbody/tr[13]/td[3]")).Text;
                                            SecondHalfInterest  = driver.FindElement(By.XPath("/html/body/form/div[6]/div[5]/div[1]/div[1]/div[3]/div[2]/div[1]/div/div[1]/table/tbody/tr[13]/td[4]")).Text;
                                            SecondHalfPenalty   = driver.FindElement(By.XPath("/html/body/form/div[6]/div[5]/div[1]/div[1]/div[3]/div[2]/div[1]/div/div[1]/table/tbody/tr[13]/td[5]")).Text;
                                            SecondHalfFees      = driver.FindElement(By.XPath("/html/body/form/div[6]/div[5]/div[1]/div[1]/div[3]/div[2]/div[1]/div/div[1]/table/tbody/tr[13]/td[6]")).Text;
                                            SecondHalfPaid      = driver.FindElement(By.XPath("/html/body/form/div[6]/div[5]/div[1]/div[1]/div[3]/div[2]/div[1]/div/div[1]/table/tbody/tr[13]/td[7]")).Text;
                                            SecondHalfAmountDue = driver.FindElement(By.XPath("/html/body/form/div[6]/div[5]/div[1]/div[1]/div[3]/div[2]/div[1]/div/div[1]/table/tbody/tr[13]/td[8]")).Text;

                                            TotalHalftax       = driver.FindElement(By.XPath("/html/body/form/div[6]/div[5]/div[1]/div[1]/div[3]/div[2]/div[1]/div/div[1]/table/tbody/tr[14]/td[3]")).Text;
                                            TotalHalfInterest  = driver.FindElement(By.XPath("/html/body/form/div[6]/div[5]/div[1]/div[1]/div[3]/div[2]/div[1]/div/div[1]/table/tbody/tr[14]/td[4]")).Text;
                                            TotalHalfPenalty   = driver.FindElement(By.XPath("/html/body/form/div[6]/div[5]/div[1]/div[1]/div[3]/div[2]/div[1]/div/div[1]/table/tbody/tr[14]/td[5]")).Text;
                                            TotalHalfFees      = driver.FindElement(By.XPath("/html/body/form/div[6]/div[5]/div[1]/div[1]/div[3]/div[2]/div[1]/div/div[1]/table/tbody/tr[14]/td[6]")).Text;
                                            TotalHalfPaid      = driver.FindElement(By.XPath("/html/body/form/div[6]/div[5]/div[1]/div[1]/div[3]/div[2]/div[1]/div/div[1]/table/tbody/tr[14]/td[7]")).Text;
                                            TotalHalfAmountDue = driver.FindElement(By.XPath("/html/body/form/div[6]/div[5]/div[1]/div[1]/div[3]/div[2]/div[1]/div/div[1]/table/tbody/tr[14]/td[8]")).Text;
                                        }
                                        if (taxYear == "" && netTaxable == "")
                                        {
                                            string taxinf = Owner1 + "~" + Location_Address + "~" + LegalDescription + "~" + "2017" + "~" + netTaxable + "~" + tax + "~" + Interest + "~" + Penalty + "~" + Fees + "~" + Paid + "~" + AmountDue + "~" + FirstHalftax + "~" + FirstHalfInterest + "~" + FirstHalfPenalty + "~" + FirstHalfFees + "~" + FirstHalfPaid + "~" + FirstHalfAmountDue + "~" + SecondHalftax + "~" + SecondHalfInterest + "~" + SecondHalfPenalty + "~" + SecondHalfFees + "~" + SecondHalfPaid + "~" + SecondHalfAmountDue + "~" + TotalHalftax + "~" + TotalHalfInterest + "~" + TotalHalfPenalty + "~" + TotalHalfFees + "~" + TotalHalfPaid + "~" + TotalHalfAmountDue + "~" + Tax_Authority + "~";
                                            gc.insert_date(orderNumber, outparcelno, 114, taxinf, 1, DateTime.Now);
                                        }
                                        else
                                        {
                                            string taxinf = Owner1 + "~" + Location_Address + "~" + LegalDescription + "~" + taxYear + "~" + netTaxable + "~" + tax + "~" + Interest + "~" + Penalty + "~" + Fees + "~" + Paid + "~" + AmountDue + "~" + FirstHalftax + "~" + FirstHalfInterest + "~" + FirstHalfPenalty + "~" + FirstHalfFees + "~" + FirstHalfPaid + "~" + FirstHalfAmountDue + "~" + SecondHalftax + "~" + SecondHalfInterest + "~" + SecondHalfPenalty + "~" + SecondHalfFees + "~" + SecondHalfPaid + "~" + SecondHalfAmountDue + "~" + TotalHalftax + "~" + TotalHalfInterest + "~" + TotalHalfPenalty + "~" + TotalHalfFees + "~" + TotalHalfPaid + "~" + TotalHalfAmountDue + "~" + Tax_Authority + "~";
                                            gc.insert_date(orderNumber, outparcelno, 114, taxinf, 1, DateTime.Now);
                                        }
                                    }
                                    catch { }
                                }
                            }
                        }
                    }
                    catch { }

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

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

                    driver.Quit();
                    gc.mergpdf(orderNumber, "NM", "Bernalillo");
                    return("Data Inserted Successfully");
                }
                catch (Exception ex)
                {
                    driver.Quit();
                    GlobalClass.LogError(ex, orderNumber);
                    throw ex;
                }
            }
        }
Esempio n. 3
0
        public string FTP_Dekalb(string address, string parcelNumber, string owner_name, string searchType, string orderNumber, string directParcel)
        {
            GlobalClass.global_orderNo             = orderNumber;
            HttpContext.Current.Session["orderNo"] = orderNumber;
            GlobalClass.global_parcelNo            = parcelNumber;

            string StartTime = "", AssessmentTime = "", TaxTime = "", CitytaxTime = "", LastEndTime = "";

            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("http://taxcommissioner.dekalbcountyga.gov/PropertyAppraisal/realSearch.asp");
                    if (searchType == "address")
                    {
                        driver.FindElement(By.XPath("/html/body/table/tbody/tr[2]/td/form/table[1]/tbody/tr[4]/td[2]/input")).SendKeys(address);
                        gc.CreatePdf_WOP(orderNumber, "InputPassed_Address Search", driver, "GA", "DeKalb");
                        driver.FindElement(By.XPath("/html/body/table/tbody/tr[2]/td/form/table[2]/tbody/tr/td/input")).SendKeys(Keys.Enter);
                        gc.CreatePdf_WOP(orderNumber, "ResultGrid_AddressSearch", driver, "GA", "DeKalb");
                        //multi parcel....
                        try
                        {
                            IWebElement         tableElement = driver.FindElement(By.XPath("/html/body/table[2]"));
                            IList <IWebElement> tableRow     = tableElement.FindElements(By.TagName("tr"));
                            int tablerowcount = tableRow.Count;
                            if (tablerowcount <= 10)
                            {
                                if (tablerowcount > 2)
                                {
                                    IList <IWebElement> rowTD;
                                    HttpContext.Current.Session["multipleParcel_deKalb"] = "Yes";
                                    foreach (IWebElement row in tableRow)
                                    {
                                        rowTD = row.FindElements(By.TagName("td"));
                                        if (rowTD.Count != 0)
                                        {
                                            string multiOwnerData = rowTD[0].Text.Trim() + "~" + rowTD[2].Text.Trim();
                                            gc.insert_date(orderNumber, rowTD[1].Text.Trim(), 21, multiOwnerData, 1, DateTime.Now);
                                        }
                                    }

                                    driver.Quit();
                                    return("MultiParcel");
                                }
                            }
                            else
                            {
                                HttpContext.Current.Session["multipleParcel_deKalb_count"] = "Maximum";
                                driver.Quit();
                                return("Maximum");
                            }
                        }
                        catch
                        {
                        }
                    }

                    if (searchType == "titleflex")
                    {
                        gc.TitleFlexSearch(orderNumber, "", "", address, "GA", "Dekalb");
                        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_GADekalb"] = "Yes";
                            driver.Quit();
                            return("No Data Found");
                        }
                        parcelNumber = HttpContext.Current.Session["titleparcel"].ToString();
                        searchType   = "parcel";
                    }
                    if (searchType == "parcel")
                    {
                        if (GlobalClass.titleparcel != "")
                        {
                            parcelNumber = GlobalClass.titleparcel;
                        }
                        if (parcelNumber.Contains("-"))
                        {
                            parcelNumber = parcelNumber.Replace("-", "");
                        }
                        driver.FindElement(By.Id("rePID")).SendKeys(parcelNumber);
                        driver.FindElement(By.XPath("/html/body/table/tbody/tr[2]/td/form/table[2]/tbody/tr/td/input")).SendKeys(Keys.Enter);
                        gc.CreatePdf(orderNumber, parcelNumber, "Parcel search", driver, "GA", "DeKalb");
                    }
                    if (searchType == "ownername")
                    {
                        driver.FindElement(By.XPath("/html/body/table/tbody/tr[2]/td/form/table[1]/tbody/tr[6]/td[2]/input")).SendKeys(owner_name);
                        driver.FindElement(By.XPath("/html/body/table/tbody/tr[2]/td/form/table[2]/tbody/tr/td/input")).SendKeys(Keys.Enter);
                        gc.CreatePdf_WOP(orderNumber, "Owner Search", driver, "GA", "DeKalb");
                        //multi parcel....
                        try
                        {
                            IWebElement         tableElement = driver.FindElement(By.XPath("/html/body/table[2]"));
                            IList <IWebElement> tableRow     = tableElement.FindElements(By.TagName("tr"));
                            int tablerowcount = tableRow.Count;
                            if (tablerowcount <= 10)
                            {
                                if (tablerowcount > 2)
                                {
                                    IList <IWebElement> rowTD;
                                    HttpContext.Current.Session["multipleParcel_deKalb"] = "Yes";
                                    foreach (IWebElement row in tableRow)
                                    {
                                        rowTD = row.FindElements(By.TagName("td"));
                                        if (rowTD.Count != 0)
                                        {
                                            string multiOwnerData = rowTD[0].Text.Trim() + "~" + rowTD[1].Text.Trim();
                                            gc.insert_date(orderNumber, rowTD[2].Text.Trim(), 21, multiOwnerData, 1, DateTime.Now);
                                        }
                                    }
                                    driver.Quit();
                                    return("MultiParcel");
                                }
                            }
                            else
                            {
                                HttpContext.Current.Session["multipleParcel_deKalb_count"] = "Maximum";
                                driver.Quit();
                                return("Maximum");
                            }
                        }
                        catch
                        {
                        }
                    }

                    Thread.Sleep(2000);
                    //Property details....
                    if (searchType != "parcel")
                    {
                        try
                        {
                            driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr/td[1]/a")).SendKeys(Keys.Enter);
                        }
                        catch { }
                    }
                    Thread.Sleep(2000);
                    try
                    {
                        IWebElement INodata = driver.FindElement(By.XPath("/html/body/table"));
                        if (INodata.Text.Contains("entered was not found"))
                        {
                            HttpContext.Current.Session["Nodata_GADekalb"] = "Yes";
                            driver.Quit();
                            return("No Data Found");
                        }
                    }
                    catch { }
                    gc.CreatePdf(orderNumber, parcelNumber, "Parcel search Result", driver, "GA", "DeKalb");
                    string parcel_number = "-", owner_Name = "-", property_address = "-", year_built = "-", taxing_district = "-", deed_acreage = "-", property_class = "-";

                    parcel_number = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr/td/table[1]/tbody/tr[1]/td[2]/a/font/b")).Text;
                    parcelNumber  = parcel_number;
                    owner_Name    = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr/td/table[2]/tbody/tr[3]/td[2]")).Text;
                    if (driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr/td/table[2]/tbody/tr[4]/td[2]")).Text.Trim() != "")
                    {
                        owner_Name = owner_Name + " &" + driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr/td/table[2]/tbody/tr[4]/td[2]")).Text;
                    }

                    property_address = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr/td/table[2]/tbody/tr[8]/td[2]/a")).Text.Trim();
                    year_built       = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr/td/table[5]/tbody/tr[2]/td[2]")).Text.Trim();
                    if (year_built == "")
                    {
                        year_built = "-";
                    }
                    taxing_district = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr/td/table[2]/tbody/tr[2]/td[2]")).Text.Trim();
                    if (taxing_district == "")
                    {
                        taxing_district = "-";
                    }
                    deed_acreage = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr/td/table[2]/tbody/tr[6]/td[5]")).Text.Trim();
                    if (deed_acreage == "")
                    {
                        deed_acreage = "-";
                    }
                    property_class = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr/td/table[2]/tbody/tr[8]/td[5]")).Text.Trim();
                    if (property_class == "")
                    {
                        property_class = "-";
                    }

                    string insertProprty = owner_Name + "~" + property_address + "~" + year_built + "~" + taxing_district + "~" + deed_acreage + "~" + property_class;
                    gc.insert_date(orderNumber, parcel_number, 20, insertProprty, 1, DateTime.Now);

                    //Assessment details....
                    try
                    {
                        IWebElement         tableAss    = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr/td/table[6]/tbody"));
                        IList <IWebElement> tableRowAss = tableAss.FindElements(By.TagName("tr"));
                        IList <IWebElement> rowTDAss;
                        int idx = 0;
                        foreach (IWebElement row in tableRowAss)
                        {
                            rowTDAss = row.FindElements(By.TagName("td"));

                            if (rowTDAss.Count != 0)
                            {
                                if (idx != 0 && idx != 1 && idx == 2)
                                {
                                    string assessData = rowTDAss[0].Text.Trim() + "~" + rowTDAss[1].Text.Trim() + "~" + rowTDAss[2].Text.Trim() + "~" + rowTDAss[3].Text.Trim() + "~" + rowTDAss[4].Text.Trim() + "~" + rowTDAss[5].Text.Trim();
                                    gc.insert_date(orderNumber, parcel_number, 29, assessData, 1, DateTime.Now);
                                }
                            }

                            idx++;
                        }
                    }
                    catch
                    {
                    }

                    try
                    {
                        try
                        {
                            tableAss1 = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr/td/table[5]/tbody"));
                            if (!tableAss1.Text.Contains("Current Appraised & Assessment Value"))
                            {
                                tableAss1 = null;
                            }
                        }
                        catch { }
                        try
                        {
                            tableAss1 = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr/td/table[6]/tbody"));
                            if (!tableAss1.Text.Contains("Current Appraised & Assessment Value"))
                            {
                                tableAss1 = null;
                            }
                        }
                        catch { }

                        IList <IWebElement> tableRowAss1 = tableAss1.FindElements(By.TagName("tr"));
                        IList <IWebElement> rowTDAss1;
                        int idx1 = 0;
                        foreach (IWebElement row in tableRowAss1)
                        {
                            rowTDAss1 = row.FindElements(By.TagName("td"));

                            if (rowTDAss1.Count != 0)
                            {
                                if (idx1 != 0 && idx1 != 1 && idx1 == 2)
                                {
                                    string assessData = rowTDAss1[0].Text.Trim() + "~" + rowTDAss1[1].Text.Trim() + "~" + rowTDAss1[2].Text.Trim() + "~" + rowTDAss1[3].Text.Trim() + "~" + rowTDAss1[4].Text.Trim() + "~" + rowTDAss1[5].Text.Trim();
                                    gc.insert_date(orderNumber, parcel_number, 29, assessData, 1, DateTime.Now);
                                }
                            }
                            idx1++;
                        }
                    }
                    catch
                    {
                    }


                    gc.CreatePdf(orderNumber, parcelNumber, "Property Detail and assessment detail", driver, "GA", "DeKalb");
                    AssessmentTime = DateTime.Now.ToString("HH:mm:ss");
                    //Tax details......
                    driver.Navigate().GoToUrl("https://taxcommissioner.dekalbcountyga.gov/TaxCommissioner/TCSearch.asp");
                    driver.FindElement(By.Id("Parcel")).SendKeys(parcelNumber);
                    gc.CreatePdf(orderNumber, parcelNumber, "tax detail search", driver, "GA", "DeKalb");
                    driver.FindElement(By.Name("Submit")).Click();
                    //driver.FindElement(By.XPath("/html/body/form/table/tbody/tr/td/div/table[3]/tbody/tr/td[1]/input")).SendKeys(Keys.Enter);
                    Thread.Sleep(3000);
                    gc.CreatePdf(orderNumber, parcelNumber, "tax detail search result", driver, "GA", "DeKalb");

                    IWebElement Taxinfotable  = driver.FindElement(By.XPath("//*[@id='printable']/table/tbody/tr/td/table/tbody/tr/td[1]/table/tbody/tr[1]/td/table/tbody"));
                    string      pin_Number    = driver.FindElement(By.XPath("//*[@id='printable']/table/tbody/tr/td/table/tbody/tr/td[1]/table/tbody/tr[1]/td/table/tbody/tr[3]/td[2]")).Text.Trim().Replace("Pin Number", "");
                    string      property_Type = gc.Between(Taxinfotable.Text, "Property Type", "Tax District").Trim();
                    string      tax_District  = GlobalClass.After(Taxinfotable.Text, "Tax District").Trim();
                    //IWebElement Taxinfotable1 = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr/td/table/tbody/tr/td[2]/table/tbody/tr[1]/td/table[1]/tbody"));

                    string tax_Year    = driver.FindElement(By.XPath("//*[@id='printable']/table/tbody/tr/td/table/tbody/tr/td[2]/table/tbody/tr[1]/td/table[1]/tbody/tr[2]/td[2]")).Text.Replace("Taxable Year", "").Trim();
                    string milage_Rate = driver.FindElement(By.XPath("//*[@id='printable']/table/tbody/tr/td/table/tbody/tr/td[2]/table/tbody/tr[1]/td/table[1]/tbody/tr[3]/td[2]")).Text.Replace("Millage Rate", "").Trim();
                    string tax_Type    = "DeKalb County";

                    string firstinstallmentamount = "", SecondInstallmentAmt = "", taxes_Billed = "", taxes_Paid = "", taxes_Due = ""; string total_Billed = "-", total_Paid = "-", total_Due = "-", firstPaymentDate = "-", firstPaymentAmount = "-", lastPaymentDate = "-", lastPaymentAmount = "-", cityTaxType = "-", cityTaxesBilled = "-", cityTaxesPaid = "-", cityTaxesDue = "-", cityFirstPaymentDate = "-", cityFirstPaymentAmount = "-", cityLastPaymentDate = "-", cityLastAmount = "-", taxingAuthority = "-", countyExemptionType = "", countyTaxExemptionAmount = "", cityExemptionType = "-", CityExemptionAmount = "-", taxExemptionType = "-", valueExemptionAmount = "-";

                    IWebElement         tableTaxinfo = driver.FindElement(By.XPath("//*[@id='printable']/table/tbody/tr/td/table/tbody/tr/td[2]/table/tbody/tr[1]/td/table[1]/tbody"));
                    IList <IWebElement> TRTaxinfo    = tableTaxinfo.FindElements(By.TagName("tr"));
                    IList <IWebElement> TDTaxinfo;
                    foreach (IWebElement row1 in TRTaxinfo)
                    {
                        TDTaxinfo = row1.FindElements(By.TagName("td"));
                        if (TDTaxinfo.Count != 0)
                        {
                            if (row1.Text.Contains("1 st Installment Amount"))
                            {
                                firstinstallmentamount = TDTaxinfo[1].Text.Trim();
                            }
                            if (row1.Text.Contains("2 nd Installment Amount"))
                            {
                                SecondInstallmentAmt = TDTaxinfo[1].Text.Trim();
                            }
                            if (row1.Text.Contains("DeKalb County Taxes Billed"))
                            {
                                taxes_Billed = TDTaxinfo[1].Text.Trim();
                            }
                            if (row1.Text.Contains("DeKalb County Taxes Paid"))
                            {
                                taxes_Paid = TDTaxinfo[1].Text.Trim();
                            }
                            if (row1.Text.Contains("DeKalb County Taxes Due"))
                            {
                                taxes_Due = TDTaxinfo[1].Text.Trim();
                            }
                            if (row1.Text.Contains("Total Taxes Billed"))
                            {
                                total_Billed = TDTaxinfo[1].Text.Trim();
                            }
                            if (row1.Text.Contains("Total Taxes Paid"))
                            {
                                total_Paid = TDTaxinfo[1].Text.Trim();
                            }
                            if (row1.Text.Contains("Total Taxes Due"))
                            {
                                total_Due = TDTaxinfo[1].Text.Trim();
                            }
                            if (row1.Text.Contains("Atlanta Taxes Billed"))
                            {
                                cityTaxesBilled = TDTaxinfo[1].Text.Trim();
                            }
                            if (row1.Text.Contains("Atlanta Taxes Paid"))
                            {
                                cityTaxesPaid = TDTaxinfo[1].Text.Trim();
                            }
                            if (row1.Text.Contains("Atlanta Taxes Due"))
                            {
                                cityTaxesDue = TDTaxinfo[1].Text.Trim();
                            }
                        }
                    }

                    try
                    {
                        IWebElement         citytableTaxinfo = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr[2]/td/table/tbody/tr/td[2]/table/tbody/tr[1]/td/table[1]/tbody/tr[16]/td/table"));
                        IList <IWebElement> cityTRTaxinfo    = citytableTaxinfo.FindElements(By.TagName("tr"));
                        IList <IWebElement> cityTDTaxinfo;
                        int cityTRTaxinfocount = cityTRTaxinfo.Count;

                        if (cityTRTaxinfocount == 5)
                        {
                            firstPaymentDate   = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr[2]/td/table/tbody/tr/td[2]/table/tbody/tr[1]/td/table[1]/tbody/tr[16]/td/table/tbody/tr[2]/td[2]")).Text.Trim();
                            firstPaymentAmount = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr[2]/td/table/tbody/tr/td[2]/table/tbody/tr[1]/td/table[1]/tbody/tr[16]/td/table/tbody/tr3]/td[2]")).Text.Trim();
                            lastPaymentDate    = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr[2]/td/table/tbody/tr/td[2]/table/tbody/tr[1]/td/table[1]/tbody/tr[16]/td/table/tbody/tr[4]/td[2]")).Text.Trim();
                            lastPaymentAmount  = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr[2]/td/table/tbody/tr/td[2]/table/tbody/tr[1]/td/table[1]/tbody/tr[16]/td/table/tbody/tr[5]/td[2]")).Text.Trim();
                        }
                        else if (cityTRTaxinfocount == 10)
                        {
                            firstPaymentDate   = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr[2]/td/table/tbody/tr/td[2]/table/tbody/tr[1]/td/table[1]/tbody/tr[16]/td/table/tbody/tr[2]/td[2]")).Text.Trim();
                            firstPaymentAmount = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr[2]/td/table/tbody/tr/td[2]/table/tbody/tr[1]/td/table[1]/tbody/tr[16]/td/table/tbody/tr[3]/td[2]")).Text.Trim();
                            lastPaymentDate    = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr[2]/td/table/tbody/tr/td[2]/table/tbody/tr[1]/td/table[1]/tbody/tr[16]/td/table/tbody/tr[4]/td[2]")).Text.Trim();
                            lastPaymentAmount  = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr[2]/td/table/tbody/tr/td[2]/table/tbody/tr[1]/td/table[1]/tbody/tr[16]/td/table/tbody/tr[5]/td[2]")).Text.Trim();

                            cityFirstPaymentDate   = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr[2]/td/table/tbody/tr/td[2]/table/tbody/tr[1]/td/table[1]/tbody/tr[16]/td/table/tbody/tr[7]/td[2]")).Text.Trim();
                            cityFirstPaymentAmount = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr[2]/td/table/tbody/tr/td[2]/table/tbody/tr[1]/td/table[1]/tbody/tr[16]/td/table/tbody/tr[8]/td[2]")).Text.Trim();
                            cityLastPaymentDate    = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr[2]/td/table/tbody/tr/td[2]/table/tbody/tr[1]/td/table[1]/tbody/tr[16]/td/table/tbody/tr[9]/td[2]")).Text.Trim();
                            cityLastAmount         = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr[2]/td/table/tbody/tr/td[2]/table/tbody/tr[1]/td/table[1]/tbody/tr[16]/td/table/tbody/tr[10]/td[2]")).Text.Trim();
                        }
                    }

                    catch
                    {
                    }

                    try
                    {
                        IWebElement         citytableTaxinfo = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr[2]/td/table/tbody/tr/td[2]/table/tbody/tr[1]/td/table[1]/tbody/tr[13]/td/table"));
                        IList <IWebElement> cityTRTaxinfo    = citytableTaxinfo.FindElements(By.TagName("tr"));
                        IList <IWebElement> cityTDTaxinfo;
                        int cityTRTaxinfocount = cityTRTaxinfo.Count;

                        if (cityTRTaxinfocount == 5)

                        {
                            firstPaymentDate   = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr[2]/td/table/tbody/tr/td[2]/table/tbody/tr[1]/td/table[1]/tbody/tr[13]/td/table/tbody/tr[2]/td[2]")).Text.Trim();
                            firstPaymentAmount = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr[2]/td/table/tbody/tr/td[2]/table/tbody/tr[1]/td/table[1]/tbody/tr[13]/td/table/tbody/tr[3]/td[2]")).Text.Trim();
                            lastPaymentDate    = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr[2]/td/table/tbody/tr/td[2]/table/tbody/tr[1]/td/table[1]/tbody/tr[13]/td/table/tbody/tr[4]/td[2]")).Text.Trim();
                            lastPaymentAmount  = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr[2]/td/table/tbody/tr/td[2]/table/tbody/tr[1]/td/table[1]/tbody/tr[13]/td/table/tbody/tr[5]/td[2]")).Text.Trim();
                        }

                        else if (cityTRTaxinfocount == 10)
                        {
                            firstPaymentDate   = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr[2]/td/table/tbody/tr/td[2]/table/tbody/tr[1]/td/table[1]/tbody/tr[13]/td/table/tbody/tr[2]/td[2]")).Text.Trim();
                            firstPaymentAmount = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr[2]/td/table/tbody/tr/td[2]/table/tbody/tr[1]/td/table[1]/tbody/tr[13]/td/table/tbody/tr[3]/td[2]")).Text.Trim();
                            lastPaymentDate    = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr[2]/td/table/tbody/tr/td[2]/table/tbody/tr[1]/td/table[1]/tbody/tr[13]/td/table/tbody/tr[4]/td[2]")).Text.Trim();
                            lastPaymentAmount  = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr[2]/td/table/tbody/tr/td[2]/table/tbody/tr[1]/td/table[1]/tbody/tr[13]/td/table/tbody/tr[5]/td[2]")).Text.Trim();

                            cityFirstPaymentDate   = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr[2]/td/table/tbody/tr/td[2]/table/tbody/tr[1]/td/table[1]/tbody/tr[13]/td/table/tbody/tr[7]")).Text.Trim();
                            cityFirstPaymentAmount = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr[2]/td/table/tbody/tr/td[2]/table/tbody/tr[1]/td/table[1]/tbody/tr[13]/td/table/tbody/tr[8]")).Text.Trim();
                            cityLastPaymentDate    = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr[2]/td/table/tbody/tr/td[2]/table/tbody/tr[1]/td/table[1]/tbody/tr[13]/td/table/tbody/tr[9]")).Text.Trim();
                            cityLastAmount         = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr[2]/td/table/tbody/tr/td[2]/table/tbody/tr[1]/td/table[1]/tbody/tr[13]/td/table/tbody/tr[10]")).Text.Trim();
                        }
                    }
                    catch
                    {
                    }

                    taxingAuthority = "DeKalb County Tax Commissioner Collections Division PO Box 100004,Decatur, GA 30031-7004";

                    try
                    {
                        countyExemptionType      = driver.FindElement(By.XPath("//*[@id='printable']/table/tbody/tr/td/table/tbody/tr/td[1]/table/tbody/tr[4]/td/table/tbody/tr[2]/td[2]")).Text;
                        countyTaxExemptionAmount = driver.FindElement(By.XPath("//*[@id='printable']/table/tbody/tr/td/table/tbody/tr/td[1]/table/tbody/tr[4]/td/table/tbody/tr[3]/td[2]")).Text;
                        cityExemptionType        = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr[2]/td/table/tbody/tr/td[1]/table/tbody/tr[3]/td/table/tbody/tr[4]/td[2]")).Text;
                        if (cityExemptionType == " ")
                        {
                            cityExemptionType = "-";
                        }
                        CityExemptionAmount = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr[2]/td/table/tbody/tr/td[1]/table/tbody/tr[3]/td/table/tbody/tr[5]/td[2]")).Text;
                    }
                    catch
                    {
                    }
                    try
                    {
                        cityTaxType = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr[2]/td/table/tbody/tr/td[2]/table/tbody/tr[1]/td/table[1]/tbody/tr[16]/td/table/tbody/tr[6]/td")).Text.Trim();
                    }
                    catch { }

                    IWebElement Homesteadtable = driver.FindElement(By.XPath("//*[@id='printable']/table/tbody/tr/td/table/tbody/tr/td[1]/table/tbody/tr[3]/td/table/tbody"));
                    taxExemptionType     = gc.Between(Homesteadtable.Text, "Exemption Type", "Tax Exempt Amount").Trim();
                    valueExemptionAmount = GlobalClass.After(Homesteadtable.Text, "Tax Exempt Amount").Trim();


                    //Delinquent Taxes
                    string Tax_Sale_File_Number = "-", FiFa_GED_Book_Page = "-", Levy_Date = "-", Sale_Date = "-", Delinquent_Amount_Due = "-";
                    try
                    {
                        Tax_Sale_File_Number = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr[2]/td/table/tbody/tr/td[2]/table/tbody/tr[2]/td/table/tbody/tr[2]/td[2]")).Text.Trim();
                        if (Tax_Sale_File_Number == "")
                        {
                            Tax_Sale_File_Number = "-";
                        }
                        FiFa_GED_Book_Page = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr[2]/td/table/tbody/tr/td[2]/table/tbody/tr[2]/td/table/tbody/tr[3]/td[2]")).Text.Trim();
                        if (FiFa_GED_Book_Page == "")
                        {
                            FiFa_GED_Book_Page = "-";
                        }
                        Levy_Date = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr[2]/td/table/tbody/tr/td[2]/table/tbody/tr[2]/td/table/tbody/tr[4]/td[2]")).Text.Trim();
                        if (Levy_Date == "")
                        {
                            Levy_Date = "-";
                        }
                        Sale_Date = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr[2]/td/table/tbody/tr/td[2]/table/tbody/tr[2]/td/table/tbody/tr[5]/td[2]")).Text.Trim();
                        if (Sale_Date == "")
                        {
                            Sale_Date = "-";
                        }
                        Delinquent_Amount_Due = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr[2]/td/table/tbody/tr/td[2]/table/tbody/tr[2]/td/table/tbody/tr[6]/td[2]")).Text.Trim();
                        if (Delinquent_Amount_Due == "")
                        {
                            Delinquent_Amount_Due = "-";
                        }
                    }
                    catch { }

                    string tax_deliquent_details = pin_Number + "~" + property_Type + "~" + tax_District + "~" + tax_Year + "~" + milage_Rate + "~" + tax_Type + "~" + firstinstallmentamount + "~" + SecondInstallmentAmt + "~" + taxes_Billed + "~" + taxes_Paid + "~" + taxes_Due + "~" + total_Billed + "~" + total_Paid + "~" + total_Due + "~" + cityTaxesBilled + "~" + cityTaxesPaid + "~" + cityTaxesDue + "~" + firstPaymentDate + "~" + firstPaymentAmount + "~" + lastPaymentDate + "~" + lastPaymentAmount + "~" + cityFirstPaymentDate + "~" + cityFirstPaymentAmount + "~" + cityLastPaymentDate + "~" + cityLastAmount + "~" + taxingAuthority + "~" + countyExemptionType + "~" + countyTaxExemptionAmount + "~" + cityExemptionType + "~" + CityExemptionAmount + "~" + cityTaxType + "~" + taxExemptionType + "~" + valueExemptionAmount + "~" + Tax_Sale_File_Number + "~" + FiFa_GED_Book_Page + "~" + Levy_Date + "~" + Sale_Date + "~" + Delinquent_Amount_Due;
                    gc.insert_date(orderNumber, parcel_number, 55, tax_deliquent_details, 1, DateTime.Now);

                    int    i          = 1;
                    string strTaxType = "";
                    //Tax History
                    IWebElement         tableTaxHistory = driver.FindElement(By.XPath("//*[@id='printable']/table/tbody/tr/td/table/tbody/tr/td[2]/table/tbody/tr[1]/td/table[3]/tbody"));
                    IList <IWebElement> TRTaxHistory    = tableTaxHistory.FindElements(By.TagName("tr"));
                    IList <IWebElement> TDTaxHistory;
                    foreach (IWebElement row1 in TRTaxHistory)
                    {
                        TDTaxHistory = row1.FindElements(By.TagName("td"));
                        if (TDTaxHistory.Count != 0 && TDTaxHistory.Count == 1 && !row1.Text.Contains("Commissioner") && !row1.Text.Contains("TaxYear") && !row1.Text.Contains("Prior Years Tax"))
                        {
                            if (TDTaxHistory[0].Text.Contains("DeKalb County Tax") || TDTaxHistory[0].Text.Contains("City Atlanta Tax"))
                            {
                                strTaxType = TDTaxHistory[0].Text;
                            }
                        }
                        if (i >= 7)
                        {
                            if (TDTaxHistory.Count > 1 && !row1.Text.Contains("City ") && !row1.Text.Contains("TaxYear"))
                            {
                                string TDTaxHistory4 = "";
                                if (TDTaxHistory[4].Text.Trim() == "")
                                {
                                    TDTaxHistory4 = "-";
                                }
                                string taxhistory_details = strTaxType + "~" + TDTaxHistory[0].Text.Trim() + "~" + TDTaxHistory[1].Text.Trim() + "~" + TDTaxHistory[2].Text.Trim() + "~" + TDTaxHistory[3].Text.Trim() + "~" + TDTaxHistory4;
                                gc.insert_date(orderNumber, parcel_number, 54, taxhistory_details, 1, DateTime.Now);
                            }
                        }
                        i++;
                    }

                    gc.CreatePdf(orderNumber, parcelNumber, "Tax Details", driver, "GA", "DeKalb");
                    try
                    {
                        driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr[2]/td/table/tbody/tr/td[2]/table/tbody/tr[1]/td/table[2]/tbody/tr[1]/td[2]/form/input[3]")).SendKeys(Keys.Enter);
                        driver.SwitchTo().Window(driver.WindowHandles.Last());
                        IWebElement         tableTaxBill   = driver.FindElement(By.XPath("/html/body/table/tbody/tr/td/table[3]"));
                        IList <IWebElement> tableRowTaxBil = tableTaxBill.FindElements(By.TagName("tr"));
                        IList <IWebElement> rowTDTaxBill;

                        List <string> urlList = new List <string>();
                        foreach (IWebElement row in tableRowTaxBil)
                        {
                            rowTDTaxBill = row.FindElements(By.TagName("td"));
                            if (rowTDTaxBill.Count != 0)
                            {
                                if (rowTDTaxBill[0].Text.Contains("2017") || rowTDTaxBill[0].Text.Contains("2018"))
                                {
                                    IWebElement link = rowTDTaxBill[2].FindElement(By.TagName("a"));
                                    string      url  = link.GetAttribute("onclick");
                                    url = WebDriverTest.Between(url, "('", "')");
                                    string pdfName = url;
                                    //string outputPath = ConfigurationManager.AppSettings["screenShotPath-GAde"];
                                    //outputPath = outputPath + orderNumber + "\\" + parcelNumber.Replace(" ", "") + "\\" + pdfName.Replace('/', '_');
                                    url = "https://taxcommissioner.dekalbcountyga.gov/TaxCommissioner/" + url;
                                    //WebClient downloadTaxBills = new WebClient();
                                    //downloadTaxBills.DownloadFile(url, outputPath);
                                    gc.downloadfile(url, orderNumber, parcelNumber, pdfName.Replace('/', '_'), "GA", "DeKalb");
                                }
                            }
                        }
                    }
                    catch { }

                    if (tax_District.Contains("DECATUR"))
                    {
                        try
                        {
                            DekalbTax_search1(orderNumber, parcelNumber);
                            DekalbTax_search2(orderNumber, parcelNumber);
                            // DekalbTax_Year_Installment1();
                            //DekalbTax_Year_Installment2();
                        }
                        catch (Exception e)
                        {
                        }
                    }
                    TaxTime = DateTime.Now.ToString("HH:mm:ss");

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

                    driver.Quit();
                    gc.mergpdf(orderNumber, "GA", "DeKalb");
                    return("Data Inserted Successfully");
                }
                catch (Exception ex)
                {
                    driver.Quit();
                    throw ex;
                }
            }
        }
Esempio n. 4
0
        public void FTP_LA(string address, string parcelNumber, string searchType, string orderNumber, string directParcel, string treasurerCaptcha)
        {
            GlobalClass.global_orderNo             = orderNumber;
            HttpContext.Current.Session["orderNo"] = orderNumber;
            GlobalClass.global_parcelNo            = parcelNumber;

            if (treasurerCaptcha == "")
            {
                var driverService = PhantomJSDriverService.CreateDefaultService();
                driverService.HideCommandPromptWindow = true;
                driver = new PhantomJSDriver();
                try
                {
                    if (searchType == "address")
                    {
                        if (Assessor_pageLoad())
                        {
                            GlobalClass.multiParcel_la = "Yes";;
                            driver.FindElement(By.Name("basicsearchterm")).SendKeys(address);
                            driver.FindElement(By.XPath("/html/body/div/div[2]/div/form[1]/div/span/button")).Click();
                            Thread.Sleep(3000);

                            //Select address from list....
                            IWebElement         tableElement = driver.FindElement(By.XPath("/html/body/div/div[3]/div/table"));
                            IList <IWebElement> tableRow     = tableElement.FindElements(By.TagName("tr"));
                            IList <IWebElement> rowTD;

                            foreach (IWebElement row in tableRow)
                            {
                                rowTD = row.FindElements(By.TagName("td"));
                                if (rowTD.Count != 0)
                                {
                                    string multi = rowTD[1].Text + "~" + rowTD[2].Text.Replace("'", "");
                                    gc.insert_data(orderNumber, DateTime.Now, rowTD[0].Text.Trim(), 51, multi, 1);
                                    //db.ExecuteQuery("insert into la_multiowner(parcel_no,situs_address,legal_description,order_no) values('" + rowTD[0].Text + "','" + rowTD[1].Text + "','" + rowTD[2].Text.Replace("'", "") + "','" + orderNumber + "') ");
                                }
                            }
                            driver.Quit();
                            return;
                        }
                    }
                    else if (searchType == "parcel")
                    {
                        string parcelUrl = "https://portal.assessor.lacounty.gov/parceldetail/" + parcelNumber;
                        driver.Navigate().GoToUrl(parcelUrl);

                        GlobalClass.parcel_status = driver.FindElement(By.XPath("/html/body/div/div/section[1]/div[2]/div/div/div[1]/div[2]/div[3]/dl/dd[1]")).Text.TrimStart().TrimEnd();

                        if (GlobalClass.parcel_status == "DELETED" || GlobalClass.parcel_status == "INACTIVE" || GlobalClass.parcel_status == "IN ACTIVE")
                        {
                            driver.Quit();
                            return;
                        }

                        GlobalClass.parcelNumber_la = driver.FindElement(By.XPath("/html/body/div/div/section[1]/div[2]/div/div/div[1]/div[1]/h2/div")).Text;
                        GlobalClass.parcelNumber_la = WebDriverTest.Between(GlobalClass.parcelNumber_la, " ", " ");
                        gc.CreatePdf(orderNumber, parcelNumber, "Assessor", driver, "CA", "Los Angeles");

                        //scrap exemption...
                        IWebElement exemption = driver.FindElement(By.XPath("/html/body/div/div/section[1]/div[2]/div/div/div[1]/div[2]/div[3]/dl/dd[6]"));
                        string      exemp_Value = "-", usetype = "-", taxratearea = "-", yearbuilt = "-";
                        exemp_Value = exemption.Text;

                        //if (directParcel == "Yes")
                        //{
                        IWebElement sit_addr          = driver.FindElement(By.XPath("/html/body/div/div/section[2]/div[2]/div/div[2]/div[1]/div[3]/dl/dd"));
                        string      situs_address     = sit_addr.Text;
                        IWebElement legal_desc        = driver.FindElement(By.XPath("/html/body/div/div/section[2]/div[2]/div/div[2]/div[1]/div[4]/dl/dd"));
                        string      legal_description = legal_desc.Text;
                        usetype = driver.FindElement(By.XPath("/html/body/div/div/section[1]/div[2]/div/div/div[1]/div[2]/div[2]/dl/dd[1]")).Text.Trim();
                        if (usetype == "")
                        {
                            usetype = "-";
                        }
                        taxratearea = driver.FindElement(By.XPath("/html/body/div/div/section[1]/div[2]/div/div/div[1]/div[2]/div[2]/dl/dd[3]")).Text.Trim();
                        if (taxratearea == "")
                        {
                            taxratearea = "-";
                        }
                        yearbuilt = driver.FindElement(By.XPath("/html/body/div/div/section[1]/div[2]/div/div/div[1]/div[4]/div[3]/dl/dd[1]")).Text.Trim();
                        if (yearbuilt == "")
                        {
                            yearbuilt = "-";
                        }
                        string property = situs_address + "~" + legal_description + "~" + usetype + "~" + taxratearea + "~" + yearbuilt;
                        gc.insert_data(orderNumber, DateTime.Now, parcelNumber, 50, property, 1);
                        //  db.ExecuteQuery("insert into la_multiowner(parcel_no,situs_address,legal_description,order_no) values('" + parcelNumber + "','" + situs_address + "','" + legal_description + "','" + orderNumber + "') ");

                        //  }
                        //scrap table...
                        IWebElement tblAssess = driver.FindElement(By.XPath("/html/body/div/div/section[1]/div[2]/div/div/div[1]/div[5]/table"));

                        string yr1 = driver.FindElement(By.XPath("/html/body/div/div/section[1]/div[2]/div/div/div[1]/div[5]/table/thead/tr/th[2]")).Text;
                        yr1 = WebDriverTest.Before(yr1, " Roll");
                        string yr2 = driver.FindElement(By.XPath("/html/body/div/div/section[1]/div[2]/div/div/div[1]/div[5]/table/thead/tr/th[3]")).Text;
                        yr2 = WebDriverTest.Before(yr2, " Current");
                        List <string> data1 = getTableData1(tblAssess);
                        string        land = "-", improvement = "-", total = "-";

                        land        = "$" + WebDriverTest.After(data1[1], "$").TrimStart();
                        improvement = "$" + WebDriverTest.After(data1[2], "$").TrimStart();
                        total       = "$" + WebDriverTest.After(data1[3], "$").TrimStart();
                        string ass = yr1 + "~" + land + "~" + improvement + "~" + total + "~" + exemp_Value;
                        gc.insert_data(orderNumber, DateTime.Now, parcelNumber, 52, ass, 1);
                        //db.ExecuteQuery("insert into la_assessor (order_no,parcel_no,year,land,improvements,total,exemption_type) values ('" + orderNumber + "','" + parcelNumber + "','" + yr1 + "','" + land + "','" + improvement + "','" + total + "','" + exemp_Value + "')");

                        List <string> data2 = getTableData(tblAssess);
                        land        = "$" + WebDriverTest.After(data2[1], "$").TrimStart();
                        improvement = "$" + WebDriverTest.After(data2[2], "$").TrimStart();
                        total       = "$" + WebDriverTest.After(data2[3], "$").TrimStart();
                        string ass1 = yr2 + "~" + land + "~" + improvement + "~" + total + "~" + exemp_Value;
                        gc.insert_data(orderNumber, DateTime.Now, parcelNumber, 52, ass1, 1);
                        //db.ExecuteQuery("insert into la_assessor (order_no,parcel_no,year,land,improvements,total,exemption_type) values ('" + orderNumber + "','" + parcelNumber + "','" + yr2 + "','" + land + "','" + improvement + "','" + total + "','" + exemp_Value + "')");



                        //treasurer details.....
                        driver.Navigate().GoToUrl("https://vcheck.ttc.lacounty.gov/");
                        Thread.Sleep(5000);
                        var imgId = driver.FindElement(By.Id("recaptcha_challenge_image"));

                        GlobalClass.imgURL = imgId.GetAttribute("src");

                        string    outPath = System.Web.HttpContext.Current.Server.MapPath("~/captcha\\") + parcelNumber + ".png";
                        WebClient captcha = new WebClient();
                        captcha.DownloadFile(GlobalClass.imgURL, outPath);

                        if (GlobalClass.imgURL != "")
                        {
                            //db.ExecuteQuery("insert into la_url (parcel_no,order_no,src) values ('" + parcelNumber + "','" + orderNumber + "','" + GlobalClass.imgURL + "')");
                            GlobalClass.sDriver = driver;
                            return;
                        }
                    }
                }

                catch (Exception ex)
                {
                    if (driver != null)
                    {
                        driver.Quit();
                    }
                    throw ex;
                }
            }
            else
            {
                //try
                //{
                GlobalClass.sDriver.FindElement(By.Id("recaptcha_response_field")).SendKeys(treasurerCaptcha);
                GlobalClass.sDriver.FindElement(By.Id("next")).Click();

                IList <IWebElement> optionsClass = GlobalClass.sDriver.FindElements(By.TagName("span"));
                foreach (IWebElement strOption in optionsClass)
                {
                    if (strOption.Text.Contains("Property Tax Inquiry/One-"))
                    {
                        strOption.Click();
                        break;
                    }
                }

                string[] treasParclNo = GlobalClass.parcelNumber_la.Split('-');
                GlobalClass.sDriver.FindElement(By.Name("mapbook")).SendKeys(treasParclNo[0]);
                GlobalClass.sDriver.FindElement(By.Name("page")).SendKeys(treasParclNo[1]);
                GlobalClass.sDriver.FindElement(By.Name("parcel")).SendKeys(treasParclNo[2]);

                Thread.Sleep(3000);
                if (GlobalClass.sDriver.FindElement(By.Id("inquirebutton")).Enabled == true)
                {
                    GlobalClass.sDriver.FindElement(By.Id("inquirebutton")).Click();
                }


                outputPath = "";
                outputPath = ConfigurationManager.AppSettings["screenShotPath-la"];
                outputPath = outputPath + orderNumber + "\\" + parcelNumber + "\\";
                if (!Directory.Exists(outputPath))
                {
                    Directory.CreateDirectory(outputPath);
                }
                string img = outputPath + "taxSummary" + ".png";
                string pdf = outputPath + "taxSummary" + ".pdf";

                //driver.Manage().Window.Maximize();
                GlobalClass.sDriver.TakeScreenshot().SaveAsFile(img, ScreenshotImageFormat.Png);

                WebDriverTest.ConvertImageToPdf(img, pdf);
                if (File.Exists(img))
                {
                    File.Delete(img);
                }

                // CreatePdf(orderNumber, parcelNumber, "taxSummary");

                IList <IWebElement> installInfos = GlobalClass.sDriver.FindElements(By.ClassName("installmentinfo"));
                int    i = 0;
                string insInfo = "-", tax_year = "-", seq_no = "-", insInfo1 = "-", tax_year1 = "-", seq_no1 = "-";
                foreach (IWebElement installInfo in installInfos)
                {
                    if (i == 0)
                    {
                        insInfo  = WebDriverTest.After(installInfo.Text, "YEAR: ");
                        tax_year = WebDriverTest.Before(insInfo, "SEQUENCE:").TrimStart().TrimEnd();
                        seq_no   = WebDriverTest.After(insInfo, "SEQUENCE:").TrimStart().TrimEnd();
                    }
                    else
                    {
                        insInfo1  = WebDriverTest.After(installInfo.Text, "YEAR: ");
                        tax_year1 = WebDriverTest.Before(insInfo1, "SEQUENCE:").TrimStart().TrimEnd();
                        seq_no1   = WebDriverTest.After(insInfo1, "SEQUENCE:").TrimStart().TrimEnd();
                    }
                    i++;
                }


                IList <IWebElement> tableElements = GlobalClass.sDriver.FindElements(By.ClassName("installmenttable"));
                int j = 0;
                foreach (IWebElement tableElement in tableElements)
                {
                    IList <IWebElement> tableRow = tableElement.FindElements(By.TagName("tr"));
                    IList <IWebElement> rowTD;
                    List <string>       installment1 = new List <string>();
                    List <string>       installment2 = new List <string>();
                    foreach (IWebElement row in tableRow)
                    {
                        rowTD = row.FindElements(By.TagName("td"));
                        if (rowTD.Count == 5)
                        {
                            installment1.Add(rowTD[1].Text);
                            installment2.Add(rowTD[4].Text);
                        }
                    }

                    string tax_amt = "-", penalty_amt = "-", total_due = "-", paid_amt = "-", balance_due = "-", delinquent = "-", tax_status = "-";

                    tax_status = WebDriverTest.After(GlobalClass.sDriver.FindElement(By.ClassName("installmentstatus")).Text, "Tax Status:").TrimStart();

                    //installment1....
                    //Installment~Tax_amount~Penalty_amount~Total_due~Paid_amount~Balance_due~Delinquent~Tax_status~Tax_year~Seq_no

                    tax_amt    = installment1[0]; penalty_amt = installment1[1]; total_due = installment1[2]; paid_amt = installment1[3]; balance_due = installment1[4];
                    delinquent = installment1[5];
                    if (delinquent == " ")
                    {
                        delinquent = "-";
                    }
                    if (j == 0)
                    {
                        string inst = "1" + "~" + tax_amt + "~" + penalty_amt + "~" + total_due + "~" + paid_amt + "~" + balance_due + "~" + delinquent + "~" + tax_status + "~" + tax_year + "~" + seq_no;
                        gc.insert_data(orderNumber, DateTime.Now, parcelNumber, 53, inst, 1);


                        //installment1....

                        tax_amt = installment2[0]; penalty_amt = installment2[1]; total_due = installment2[2]; paid_amt = installment2[3]; balance_due = installment2[4]; delinquent = installment2[5];
                        if (delinquent == " ")
                        {
                            delinquent = "-";
                        }
                        string inst1 = "2" + "~" + tax_amt + "~" + penalty_amt + "~" + total_due + "~" + paid_amt + "~" + balance_due + "~" + delinquent + "~" + tax_status + "~" + tax_year + "~" + seq_no;
                        gc.insert_data(orderNumber, DateTime.Now, parcelNumber, 53, inst1, 1);
                    }
                    else
                    {
                        string inst = "1" + "~" + tax_amt + "~" + penalty_amt + "~" + total_due + "~" + paid_amt + "~" + balance_due + "~" + delinquent + "~" + "SUPPLEMENTAL" + "~" + tax_year1 + "~" + seq_no1;
                        gc.insert_data(orderNumber, DateTime.Now, parcelNumber, 53, inst, 1);
                        //installment1....

                        tax_amt = installment2[0]; penalty_amt = installment2[1]; total_due = installment2[2]; paid_amt = installment2[3]; balance_due = installment2[4]; delinquent = installment2[5];
                        if (delinquent == " ")
                        {
                            delinquent = "-";
                        }
                        string inst1 = "2" + "~" + tax_amt + "~" + penalty_amt + "~" + total_due + "~" + paid_amt + "~" + balance_due + "~" + delinquent + "~" + "SUPPLEMENTAL" + "~" + tax_year1 + "~" + seq_no1;
                        gc.insert_data(orderNumber, DateTime.Now, parcelNumber, 53, inst1, 1);
                    }
                    j++;
                }



                //delinquent data....
                try
                {
                    IWebElement         delinqTable = GlobalClass.sDriver.FindElement(By.ClassName("installmentdelinq"));
                    IList <IWebElement> tblRow      = delinqTable.FindElements(By.TagName("tr"));
                    IList <IWebElement> rowtD;
                    List <string>       tr1 = new List <string>();
                    List <string>       tr3 = new List <string>();

                    foreach (IWebElement row in tblRow)
                    {
                        rowtD = row.FindElements(By.TagName("td"));
                        tr1.Add(rowtD[1].Text);
                        if (rowtD.Count >= 4)
                        {
                            tr3.Add(rowtD[3].Text);
                        }
                    }
                    //insert data
                }
                catch
                {
                }

                GlobalClass.sDriver.Quit();

                //}
                ////catch (Exception ex)
                ////{
                //    GlobalClass.sDriver.Quit();
                //    throw ex;
                //}
            }
        }
Esempio n. 5
0
        public string FTP_Coweta(string address, string assessment_id, string parcelNumber, string searchType, string orderNumber, string directParcel, string ownername)
        {
            GlobalClass.global_orderNo             = orderNumber;
            HttpContext.Current.Session["orderNo"] = orderNumber;
            GlobalClass.global_parcelNo            = parcelNumber;

            string StartTime = "", AssessmentTime = "", TaxTime = "", CitytaxTime = "", LastEndTime = "";

            var driverService = PhantomJSDriverService.CreateDefaultService();

            driverService.HideCommandPromptWindow = true;
            using (driver = new PhantomJSDriver())//
            {
                //driver = new ChromeDriver();

                try
                {
                    StartTime = DateTime.Now.ToString("HH:mm:ss");

                    if (searchType == "titleflex")
                    {
                        string titleaddress = address;
                        gc.TitleFlexSearch(orderNumber, "", "", titleaddress, "GA", "Coweta");
                        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_CowetaGA"] = "Yes";
                            driver.Quit();
                            return("No Data Found");
                        }
                        parcelNumber = HttpContext.Current.Session["titleparcel"].ToString();
                        searchType   = "parcel";
                    }

                    if (searchType == "address")
                    {
                        driver.Navigate().GoToUrl("https://qpublic.schneidercorp.com/Application.aspx?App=CowetaCountyGA&Layer=Parcels&PageType=Search");
                        Thread.Sleep(2000);

                        try
                        {
                            driver.FindElement(By.XPath("//*[@id='appBody']/div[4]/div/div/div[3]/a[1]")).Click();
                            Thread.Sleep(2000);
                        }
                        catch { }
                        try
                        {
                            driver.FindElement(By.XPath("//*[@id='appBody']/div[5]/div/div/div[3]/a")).Click();
                            Thread.Sleep(2000);
                        }
                        catch { }

                        driver.FindElement(By.Id("ctlBodyPane_ctl01_ctl01_txtAddress")).SendKeys(address);

                        gc.CreatePdf_WOP(orderNumber, "Address search", driver, "GA", "Coweta");
                        driver.FindElement(By.Id("ctlBodyPane_ctl01_ctl01_btnSearch")).SendKeys(Keys.Enter);
                        Thread.Sleep(2000);

                        try
                        {
                            IWebElement         MultiAddressTB = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl00_ctl01_gvwParcelResults']/tbody"));
                            IList <IWebElement> MultiAddressTR = MultiAddressTB.FindElements(By.TagName("tr"));
                            IList <IWebElement> MultiAddressTD;
                            gc.CreatePdf_WOP(orderNumber, "Multi Address search", driver, "GA", "Coweta");
                            int AddressmaxCheck = 0;

                            foreach (IWebElement MultiAddress in MultiAddressTR)
                            {
                                if (AddressmaxCheck <= 25)
                                {
                                    MultiAddressTD = MultiAddress.FindElements(By.TagName("td"));
                                    if (MultiAddressTD.Count != 0)
                                    {
                                        Parcelno         = MultiAddressTD[1].Text;
                                        Owner            = MultiAddressTD[3].Text;
                                        Property_Address = MultiAddressTD[4].Text;

                                        MultiAddress_details = Owner + "~" + Property_Address;
                                        gc.insert_date(orderNumber, Parcelno, 635, MultiAddress_details, 1, DateTime.Now);
                                    }
                                    AddressmaxCheck++;
                                }
                            }
                            if (MultiAddressTR.Count > 25)
                            {
                                HttpContext.Current.Session["multiParcel_Coweta_Multicount"] = "Maximum";
                            }
                            else
                            {
                                HttpContext.Current.Session["multiparcel_Coweta"] = "Yes";
                            }
                            driver.Quit();

                            return("MultiParcel");
                        }
                        catch
                        { }
                        try
                        {
                            //No Data Found
                            string nodata = driver.FindElement(By.Id("ctlBodyPane_noDataList_pnlNoResults")).Text;
                            if (nodata.Contains("No results match your search criteria."))
                            {
                                HttpContext.Current.Session["Nodata_CowetaGA"] = "Yes";
                                driver.Quit();
                                return("No Data Found");
                            }
                        }
                        catch { }
                    }

                    if (searchType == "parcel")
                    {
                        driver.Navigate().GoToUrl("https://qpublic.schneidercorp.com/Application.aspx?App=CowetaCountyGA&Layer=Parcels&PageType=Search");
                        Thread.Sleep(2000);

                        try
                        {
                            driver.FindElement(By.XPath("//*[@id='appBody']/div[4]/div/div/div[3]/a[1]")).Click();
                            Thread.Sleep(2000);
                        }
                        catch { }
                        try
                        {
                            driver.FindElement(By.XPath("//*[@id='appBody']/div[5]/div/div/div[3]/a")).Click();
                            Thread.Sleep(2000);
                        }
                        catch { }

                        driver.FindElement(By.Id("ctlBodyPane_ctl02_ctl01_txtParcelID")).SendKeys(parcelNumber);

                        gc.CreatePdf(orderNumber, parcelNumber, "ParcelSearch", driver, "GA", "Coweta");
                        driver.FindElement(By.Id("ctlBodyPane_ctl02_ctl01_btnSearch")).SendKeys(Keys.Enter);
                        Thread.Sleep(2000);
                        try
                        {
                            //No Data Found
                            string nodata = driver.FindElement(By.Id("ctlBodyPane_noDataList_pnlNoResults")).Text;
                            if (nodata.Contains("No results match your search criteria."))
                            {
                                HttpContext.Current.Session["Nodata_CowetaGA"] = "Yes";
                                driver.Quit();
                                return("No Data Found");
                            }
                        }
                        catch { }
                    }

                    if (searchType == "ownername")
                    {
                        driver.Navigate().GoToUrl("https://qpublic.schneidercorp.com/Application.aspx?App=CowetaCountyGA&Layer=Parcels&PageType=Search");
                        Thread.Sleep(2000);

                        try
                        {
                            driver.FindElement(By.XPath("//*[@id='appBody']/div[4]/div/div/div[3]/a[1]")).Click();
                            Thread.Sleep(2000);
                        }
                        catch { }
                        try
                        {
                            driver.FindElement(By.XPath("//*[@id='appBody']/div[5]/div/div/div[3]/a")).Click();
                            Thread.Sleep(2000);
                        }
                        catch { }

                        driver.FindElement(By.Id("ctlBodyPane_ctl00_ctl01_txtName")).SendKeys(ownername);

                        gc.CreatePdf_WOP(orderNumber, "Owner search", driver, "GA", "Coweta");
                        driver.FindElement(By.Id("ctlBodyPane_ctl00_ctl01_btnSearch")).SendKeys(Keys.Enter);
                        Thread.Sleep(2000);

                        try
                        {
                            IWebElement         MultiAddressTB = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl00_ctl01_gvwParcelResults']/tbody"));
                            IList <IWebElement> MultiAddressTR = MultiAddressTB.FindElements(By.TagName("tr"));
                            IList <IWebElement> MultiAddressTD;
                            gc.CreatePdf_WOP(orderNumber, "Multi Owner search", driver, "GA", "Coweta");
                            int AddressmaxCheck = 0;

                            foreach (IWebElement MultiAddress in MultiAddressTR)
                            {
                                if (AddressmaxCheck <= 25)
                                {
                                    MultiAddressTD = MultiAddress.FindElements(By.TagName("td"));
                                    if (MultiAddressTD.Count != 0)
                                    {
                                        Parcelno         = MultiAddressTD[1].Text;
                                        Owner            = MultiAddressTD[3].Text;
                                        Property_Address = MultiAddressTD[4].Text;

                                        MultiAddress_details = Owner + "~" + Property_Address;
                                        gc.insert_date(orderNumber, Parcelno, 635, MultiAddress_details, 1, DateTime.Now);
                                    }
                                    AddressmaxCheck++;
                                }
                            }
                            if (MultiAddressTR.Count > 25)
                            {
                                HttpContext.Current.Session["multiParcel_Coweta_Multicount"] = "Maximum";
                            }
                            else
                            {
                                HttpContext.Current.Session["multiparcel_Coweta"] = "Yes";
                            }
                            driver.Quit();

                            return("MultiParcel");
                        }
                        catch
                        { }
                        try
                        {
                            //No Data Found
                            string nodata = driver.FindElement(By.Id("ctlBodyPane_noDataList_pnlNoResults")).Text;
                            if (nodata.Contains("No results match your search criteria."))
                            {
                                HttpContext.Current.Session["Nodata_CowetaGA"] = "Yes";
                                driver.Quit();
                                return("No Data Found");
                            }
                        }
                        catch { }
                    }

                    //Property Details
                    IWebElement         tbmulti11 = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl00_ctl01_dvNonPrebillMH']/table/tbody"));
                    IList <IWebElement> TRmulti11 = tbmulti11.FindElements(By.TagName("tr"));
                    IList <IWebElement> TDmulti11;
                    foreach (IWebElement row in TRmulti11)
                    {
                        TDmulti11 = row.FindElements(By.TagName("td"));
                        if (TDmulti11.Count != 0)
                        {
                            if (i == 0)
                            {
                                ParcelID = TDmulti11[1].Text;
                            }
                            if (i == 1)
                            {
                                Loc_Addrs = TDmulti11[1].Text;
                            }
                            if (i == 3)
                            {
                                Leg_Desp = TDmulti11[1].Text;
                            }
                            if (i == 5)
                            {
                                Class = TDmulti11[1].Text;
                            }
                            if (i == 7)
                            {
                                Tax_Dist = TDmulti11[1].Text;
                            }
                            if (i == 8)
                            {
                                Milagerate = TDmulti11[1].Text;
                            }
                            if (i == 9)
                            {
                                Acres = TDmulti11[1].Text;
                            }
                            if (i == 10)
                            {
                                Neighberwood = TDmulti11[1].Text;
                            }
                            if (i == 11)
                            {
                                Homstd_Exmp = TDmulti11[1].Text;
                            }
                            i++;
                        }
                    }

                    try
                    {
                        Owner1 = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl01_mSection']/div")).Text.Replace("\r\n", "").Trim();
                    }
                    catch
                    { }
                    try
                    {
                        Year_Built = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl09_ctl01_gvwPrebillMH']/tbody/tr/td[4]")).Text;
                    }
                    catch
                    { }
                    try
                    {
                        IWebElement         Yeartb = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl05_mSection']/div/table/tbody"));
                        IList <IWebElement> YearTR = Yeartb.FindElements(By.TagName("tr"));
                        IList <IWebElement> YearTD;

                        foreach (IWebElement Tax4 in YearTR)
                        {
                            YearTD = Tax4.FindElements(By.TagName("td"));
                            if (YearTD.Count != 0)
                            {
                                string yblt = YearTD[0].Text;
                                if (yblt.Contains("Year Built"))
                                {
                                    Year_Built = YearTD[1].Text;
                                }
                            }
                        }
                    }
                    catch
                    { }

                    property = Loc_Addrs + "~" + Leg_Desp + "~" + Class + "~" + Tax_Dist + "~" + Milagerate + "~" + Acres + "~" + Neighberwood + "~" + Homstd_Exmp + "~" + Owner1 + "~" + Year_Built;
                    gc.CreatePdf(orderNumber, ParcelID, "Property Details", driver, "GA", "Coweta");
                    gc.insert_date(orderNumber, ParcelID, 636, property, 1, DateTime.Now);

                    //Assessment Details
                    IWebElement         AssmThTb = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl13_ctl01_grdValuation']/thead"));
                    IList <IWebElement> AssmThTr = AssmThTb.FindElements(By.TagName("tr"));
                    IList <IWebElement> AssmTh;

                    foreach (IWebElement Assm in AssmThTr)
                    {
                        AssmTh = Assm.FindElements(By.TagName("th"));
                        if (AssmTh.Count != 0)
                        {
                            Year1 = AssmTh[0].Text;
                            Year2 = AssmTh[1].Text;
                            Year3 = AssmTh[2].Text;
                        }
                    }

                    IWebElement         AssmTb = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl13_ctl01_grdValuation']/tbody"));
                    IList <IWebElement> AssmTr = AssmTb.FindElements(By.TagName("tr"));
                    IList <IWebElement> AssmTd;

                    List <string> Previous_Value    = new List <string>();
                    List <string> Land_Value        = new List <string>();
                    List <string> Improvement_Value = new List <string>();
                    List <string> Accessory_Value   = new List <string>();
                    List <string> Current_Value     = new List <string>();

                    foreach (IWebElement Assmrow in AssmTr)
                    {
                        AssmTd = Assmrow.FindElements(By.TagName("td"));

                        if (AssmTd.Count != 0)
                        {
                            if (j == 0)
                            {
                                Previous_Value.Add(AssmTd[2].Text);
                                Previous_Value.Add(AssmTd[3].Text);
                                Previous_Value.Add(AssmTd[4].Text);
                            }
                            else if (j == 1)
                            {
                                Land_Value.Add(AssmTd[2].Text);
                                Land_Value.Add(AssmTd[3].Text);
                                Land_Value.Add(AssmTd[4].Text);
                            }
                            else if (j == 2)
                            {
                                Improvement_Value.Add(AssmTd[2].Text);
                                Improvement_Value.Add(AssmTd[3].Text);
                                Improvement_Value.Add(AssmTd[4].Text);
                            }
                            else if (j == 3)
                            {
                                Accessory_Value.Add(AssmTd[2].Text);
                                Accessory_Value.Add(AssmTd[3].Text);
                                Accessory_Value.Add(AssmTd[4].Text);
                            }
                            else if (j == 4)
                            {
                                Current_Value.Add(AssmTd[2].Text);
                                Current_Value.Add(AssmTd[3].Text);
                                Current_Value.Add(AssmTd[4].Text);
                            }

                            j++;
                        }
                    }

                    Assemnt_Details1 = Year1 + "~" + Previous_Value[0] + "~" + Land_Value[0] + "~" + Improvement_Value[0] + "~" + Accessory_Value[0] + "~" + Current_Value[0];
                    Assemnt_Details2 = Year2 + "~" + Previous_Value[1] + "~" + Land_Value[1] + "~" + Improvement_Value[1] + "~" + Accessory_Value[1] + "~" + Current_Value[1];
                    Assemnt_Details3 = Year3 + "~" + Previous_Value[2] + "~" + Land_Value[2] + "~" + Improvement_Value[2] + "~" + Accessory_Value[2] + "~" + Current_Value[2];
                    gc.insert_date(orderNumber, ParcelID, 638, Assemnt_Details1, 1, DateTime.Now);
                    gc.insert_date(orderNumber, ParcelID, 638, Assemnt_Details2, 1, DateTime.Now);
                    gc.insert_date(orderNumber, ParcelID, 638, Assemnt_Details3, 1, DateTime.Now);
                    AssessmentTime = DateTime.Now.ToString("HH:mm:ss");

                    //Tax Details
                    driver.Navigate().GoToUrl("https://www.cowetataxcom.com/taxes.html#/WildfireSearch");
                    Thread.Sleep(2000);
                    //driver.FindElement(By.LinkText("SEARCH & PAY TAXES")).Click();
                    Thread.Sleep(2000);
                    try
                    {
                        driver.FindElement(By.Id("btnAccept")).Click();
                        Thread.Sleep(2000);
                    }
                    catch
                    { }

                    try
                    {
                        driver.FindElement(By.XPath("/html/body/div[1]/div/div/div[3]/button[1]")).Click();
                        Thread.Sleep(2000);
                    }
                    catch
                    { }

                    driver.FindElement(By.Id("searchBox")).SendKeys(ParcelID);
                    Thread.Sleep(4000);

                    //TaxPayment Receipt Details
                    try
                    {
                        IWebElement TaxPaymentTB = null;
                        try
                        {
                            TaxPaymentTB = driver.FindElement(By.XPath("//*[@id='avalon']/div/div[3]/div[2]/table/tbody"));
                        }
                        catch { }
                        try
                        {
                            if (TaxPaymentTB == null)
                            {
                                TaxPaymentTB = driver.FindElement(By.XPath("//*[@id='avalon']/div/div[4]/div[2]/table/tbody"));
                            }
                        }
                        catch { }

                        IList <IWebElement> TaxPaymentTR = TaxPaymentTB.FindElements(By.TagName("tr"));
                        IList <IWebElement> TaxPaymentTD;

                        foreach (IWebElement TaxPayment in TaxPaymentTR)
                        {
                            TaxPaymentTD = TaxPayment.FindElements(By.TagName("td"));
                            if (TaxPaymentTD.Count != 0)
                            {
                                Owners    = TaxPaymentTD[0].Text;
                                year      = TaxPaymentTD[1].Text;
                                receipt   = TaxPaymentTD[2].Text;
                                Desc      = TaxPaymentTD[3].Text;
                                Type      = TaxPaymentTD[4].Text;
                                Paid      = TaxPaymentTD[5].Text;
                                Paid_date = TaxPaymentTD[6].Text;

                                Payment_details = Owners + "~" + year + "~" + receipt + "~" + Desc + "~" + Type + "~" + Paid + "~" + Paid_date;
                                gc.CreatePdf(orderNumber, ParcelID, "Tax Bill Details", driver, "GA", "Coweta");
                                gc.insert_date(orderNumber, ParcelID, 645, Payment_details, 1, DateTime.Now);
                            }
                        }
                    }
                    catch
                    { }

                    //Tax Info Details
                    IWebElement Receipttable = null;
                    try
                    {
                        Receipttable = driver.FindElement(By.XPath("//*[@id='avalon']/div/div[3]/div[2]/table/tbody"));
                    }
                    catch { }
                    try
                    {
                        if (Receipttable == null)
                        {
                            Receipttable = driver.FindElement(By.XPath("//*[@id='avalon']/div/div[4]/div[2]/table/tbody"));
                        }
                    }
                    catch { }
                    IList <IWebElement> ReceipttableRow = Receipttable.FindElements(By.TagName("tr"));
                    int rowcount = ReceipttableRow.Count;

                    for (int p = 1; p <= rowcount; p++)
                    {
                        if (p < 4)
                        {
                            try
                            {
                                driver.FindElement(By.XPath("//*[@id='avalon']/div/div[3]/div[2]/table/tbody/tr[" + p + "]/td[9]/button")).Click();
                            }
                            catch { }

                            try
                            {
                                driver.FindElement(By.XPath("//*[@id='avalon']/div/div[4]/div[2]/table/tbody/tr[" + p + "]/td[9]/button/i")).Click();
                            }
                            catch { }

                            Thread.Sleep(6000);

                            try
                            {
                                IWebElement         DeliquentTB = driver.FindElement(By.XPath("/html/body/div[1]/div/div/div[1]/table/tbody"));
                                IList <IWebElement> DeliquentTR = DeliquentTB.FindElements(By.TagName("tr"));
                                IList <IWebElement> DeliquentTD;

                                foreach (IWebElement Deliquent in DeliquentTR)
                                {
                                    DeliquentTD = Deliquent.FindElements(By.TagName("td"));
                                    if (DeliquentTD.Count != 0 && DeliquentTR.Count != 2)
                                    {
                                        name    = DeliquentTD[0].Text;
                                        Taxyear = DeliquentTD[1].Text;
                                        bill_no = DeliquentTD[2].Text;
                                        amount  = DeliquentTD[6].Text;

                                        Del_details = name + "~" + Taxyear + "~" + bill_no + "~" + amount;
                                        gc.CreatePdf(orderNumber, ParcelID, "Deliquent Details" + Taxy, driver, "GA", "Coweta");
                                        gc.insert_date(orderNumber, ParcelID, 652, Del_details, 1, DateTime.Now);
                                        name = ""; Taxyear = ""; bill_no = ""; amount = "";
                                    }
                                }
                            }
                            catch
                            { }
                            try
                            {
                                IWebElement         DeliquentfootTB = driver.FindElement(By.XPath("/html/body/div[1]/div/div/div[1]/table/tfoot"));
                                IList <IWebElement> DeliquentfootTR = DeliquentfootTB.FindElements(By.TagName("tr"));
                                IList <IWebElement> DeliquentfootTD;

                                foreach (IWebElement Deliquentfoot in DeliquentfootTR)
                                {
                                    DeliquentfootTD = Deliquentfoot.FindElements(By.TagName("th"));
                                    if (DeliquentfootTD.Count != 0 && !Deliquentfoot.Text.Contains("$734.16"))
                                    {
                                        string bill_no1 = DeliquentfootTD[0].Text;
                                        string amount1  = DeliquentfootTD[2].Text;

                                        string Del_details1 = "" + "~" + "" + "~" + bill_no1 + "~" + amount1;
                                        gc.insert_date(orderNumber, ParcelID, 652, Del_details1, 1, DateTime.Now);
                                    }
                                }
                            }
                            catch
                            { }

                            try
                            {
                                driver.FindElement(By.XPath("/html/body/div[1]/div/div/div[2]/button[2]")).Click();
                                Thread.Sleep(2000);
                            }
                            catch
                            { }

                            IWebElement         TaxTB = driver.FindElement(By.XPath("//*[@id='avalon']/div/div/div/div[1]/div[2]/div[1]/table/tbody"));
                            IList <IWebElement> TaxTR = TaxTB.FindElements(By.TagName("tr"));
                            IList <IWebElement> TaxTD;
                            foreach (IWebElement Tax in TaxTR)
                            {
                                TaxTD = Tax.FindElements(By.TagName("td"));
                                if (TaxTD.Count != 0 && !Tax.Text.Contains("Parcel Number") && TaxTD[1].Text != "")
                                {
                                    Dist = TaxTD[0].Text;
                                    if (Dist.Contains("District"))
                                    {
                                        Dis = TaxTD[1].Text;
                                    }
                                    Ac = TaxTD[0].Text;
                                    if (Ac.Contains("Acres"))
                                    {
                                        Acres1 = TaxTD[1].Text;
                                    }
                                    AsVal = TaxTD[0].Text;
                                    if (AsVal.Contains("Description"))
                                    {
                                        Description = TaxTD[1].Text;
                                    }
                                    ProVal = TaxTD[0].Text;
                                    if (ProVal.Contains("Property Address"))
                                    {
                                        Pro_Addr = TaxTD[1].Text;
                                    }
                                    AppVal = TaxTD[0].Text;
                                    if (AppVal.Contains("Assessed Value"))
                                    {
                                        Assed_Val = TaxTD[1].Text;
                                    }
                                    ApprVal = TaxTD[0].Text;
                                    if (ApprVal.Contains("Appraised Value"))
                                    {
                                        Appr_Value = TaxTD[1].Text;
                                    }
                                }
                            }

                            IWebElement         Tax1TB = driver.FindElement(By.XPath("//*[@id='avalon']/div/div/div/div[1]/div[1]/div[2]/table/tbody"));
                            IList <IWebElement> Tax1TR = Tax1TB.FindElements(By.TagName("tr"));
                            IList <IWebElement> Tax1TD;
                            foreach (IWebElement Tax1 in Tax1TR)
                            {
                                Tax1TD = Tax1.FindElements(By.TagName("td"));
                                if (Tax1TD.Count != 0)
                                {
                                    Sta = Tax1TD[0].Text;
                                    if (Sta.Contains("Status"))
                                    {
                                        Status = Tax1TD[1].Text;
                                    }
                                    Latpay = Tax1TD[0].Text;
                                    if (Latpay.Contains("Last Payment Date"))
                                    {
                                        Last_Pay = Tax1TD[1].Text;
                                    }
                                    Amtpaid = Tax1TD[0].Text;
                                    if (Amtpaid.Contains("Amount Paid"))
                                    {
                                        Amt_Paid = Tax1TD[1].Text;
                                    }
                                }
                            }

                            IWebElement         Tax2TB = driver.FindElement(By.XPath("//*[@id='avalon']/div/div/div/div[1]/div[2]/div[2]/table/tbody"));
                            IList <IWebElement> Tax2TR = Tax2TB.FindElements(By.TagName("tr"));
                            IList <IWebElement> Tax2TD;
                            foreach (IWebElement Tax2 in Tax2TR)
                            {
                                Tax2TD = Tax2.FindElements(By.TagName("td"));
                                if (Tax2TD.Count != 0)
                                {
                                    Rcdtyp = Tax2TD[0].Text;
                                    if (Rcdtyp.Contains("Record Type"))
                                    {
                                        Record_Type = Tax2TD[1].Text;
                                    }
                                    tYear = Tax2TD[0].Text;
                                    if (tYear.Contains("Tax Year"))
                                    {
                                        Taxy = Tax2TD[1].Text;
                                    }
                                    Rep = Tax2TD[0].Text;
                                    if (Rep.Contains("Bill Number"))
                                    {
                                        Recep = Tax2TD[1].Text;
                                    }
                                    Dudt = Tax2TD[0].Text;
                                    if (Dudt.Contains("Account Number"))
                                    {
                                        Accnt_Num = Tax2TD[1].Text;
                                    }
                                    Duet = Tax2TD[0].Text;
                                    if (Duet.Contains("Due Date"))
                                    {
                                        Due_Date = Tax2TD[1].Text;
                                    }
                                }
                            }

                            IWebElement         Tax4TB = driver.FindElement(By.XPath("//*[@id='avalon']/div/div/div/div[1]/div[2]/div[3]/table/tbody"));
                            IList <IWebElement> Tax4TR = Tax4TB.FindElements(By.TagName("tr"));
                            IList <IWebElement> Tax4TD;
                            foreach (IWebElement Tax4 in Tax4TR)
                            {
                                Tax4TD = Tax4.FindElements(By.TagName("td"));
                                if (Tax4TD.Count != 0 && Tax4TD[1].Text != "")
                                {
                                    Base = Tax4TD[0].Text;
                                    if (Base.Contains("Base Taxes"))
                                    {
                                        Base_Taxes = Tax4TD[1].Text;
                                    }
                                    Pan = Tax4TD[0].Text;
                                    if (Pan.Contains("Penalty"))
                                    {
                                        penalty = Tax4TD[1].Text;
                                    }
                                    Inst = Tax4TD[0].Text;
                                    if (Inst.Contains("Interest"))
                                    {
                                        Interst = Tax4TD[1].Text;
                                    }
                                    Otherfee = Tax4TD[0].Text;
                                    if (Otherfee.Contains("Other Fees"))
                                    {
                                        Other_Fee = Tax4TD[1].Text;
                                    }
                                    string tytl_due = Tax4TD[0].Text;
                                    if (tytl_due.Contains(Taxy + "Total Due"))
                                    {
                                        string Del_Taxyear = Tax4TD[1].Text;
                                    }
                                    Backtax = Tax4TD[0].Text;
                                    if (Backtax.Contains("Back Taxes"))
                                    {
                                        Back_Tax = Tax4TD[1].Text;
                                    }
                                    tldue = Tax4TD[0].Text;
                                    if (tldue.Contains("Total Due"))
                                    {
                                        Total_Due = Tax4TD[1].Text;
                                    }
                                }
                            }

                            gc.CreatePdf(orderNumber, ParcelID, "Tax Details" + Taxy, driver, "GA", "Coweta");

                            string Tax_Deatils = Taxy + "~" + Dis + "~" + Acres1 + "~" + Description + "~" + Pro_Addr + "~" + Assed_Val + "~" + Appr_Value + "~" + Status + "~" + Last_Pay + "~" + Amt_Paid + "~" + Record_Type + "~" + Recep + "~" + Accnt_Num + "~" + Due_Date + "~" + Base_Taxes + "~" + penalty + "~" + Interst + "~" + Other_Fee + "~" + Del_Taxyear + "~" + Back_Tax + "~" + Total_Due;
                            gc.insert_date(orderNumber, ParcelID, 647, Tax_Deatils, 1, DateTime.Now);

                            //Tax Breakdown


                            try
                            {
                                IWebElement         BreakdownTB = driver.FindElement(By.XPath("//*[@id='avalon']/div/div/div/div[1]/div[3]/div/table/tbody"));
                                IList <IWebElement> BreakdownTR = BreakdownTB.FindElements(By.TagName("tr"));
                                IList <IWebElement> BreakdownTD;

                                foreach (IWebElement Breakdown in BreakdownTR)
                                {
                                    BreakdownTD = Breakdown.FindElements(By.TagName("td"));
                                    if (BreakdownTD.Count != 0)
                                    {
                                        Entity     = BreakdownTD[0].Text;
                                        AdjtFMV    = BreakdownTD[1].Text;
                                        NetAssnt   = BreakdownTD[2].Text;
                                        Exemptions = BreakdownTD[3].Text;
                                        Taxbleval  = BreakdownTD[4].Text;
                                        Milagete   = BreakdownTD[5].Text;
                                        grosstax   = BreakdownTD[6].Text;
                                        Credits    = BreakdownTD[7].Text;
                                        Net_Tax    = BreakdownTD[8].Text;

                                        Breakdown_details = Entity + "~" + AdjtFMV + "~" + NetAssnt + "~" + Exemptions + "~" + Taxbleval + "~" + Milagete + "~" + grosstax + "~" + Credits + "~" + Net_Tax;
                                        gc.insert_date(orderNumber, ParcelID, 650, Breakdown_details, 1, DateTime.Now);
                                    }
                                }
                            }
                            catch
                            { }

                            try
                            {
                                IWebElement         FooterTB = driver.FindElement(By.XPath("//*[@id='avalon']/div/div/div/div[1]/div[3]/div/table/tfoot"));
                                IList <IWebElement> FooterTR = FooterTB.FindElements(By.TagName("tr"));
                                IList <IWebElement> FooterTD;

                                foreach (IWebElement Footer in FooterTR)
                                {
                                    FooterTD = Footer.FindElements(By.TagName("th"));
                                    if (FooterTD.Count != 0)
                                    {
                                        Entity1     = FooterTD[0].Text;
                                        AdjtFMV1    = FooterTD[1].Text;
                                        NetAssnt1   = FooterTD[2].Text;
                                        Exemptions1 = FooterTD[3].Text;
                                        Taxbleval1  = FooterTD[4].Text;
                                        Milagete1   = FooterTD[5].Text;
                                        grosstax1   = FooterTD[6].Text;
                                        Credits1    = FooterTD[7].Text;
                                        Net_Tax1    = FooterTD[8].Text;
                                    }
                                }

                                Breakdown_details1 = Entity1 + "~" + AdjtFMV1 + "~" + NetAssnt1 + "~" + Exemptions1 + "~" + Taxbleval1 + "~" + Milagete1 + "~" + grosstax1 + "~" + Credits1 + "~" + Net_Tax1;
                                gc.insert_date(orderNumber, ParcelID, 650, Breakdown_details1, 1, DateTime.Now);
                            }
                            catch
                            { }

                            //Tax Bill
                            try
                            {
                                driver.FindElement(By.XPath("//*[@id='avalon']/div/div/ul/li[2]/a")).Click();
                                Thread.Sleep(5000);

                                gc.CreatePdf(orderNumber, ParcelID, "Tax Bill Details" + Taxy, driver, "GA", "Coweta");
                            }
                            catch
                            { }
                            try
                            {
                                driver.FindElement(By.XPath("//*[@id='avalon']/div/div/ul/li[3]/a")).Click();
                                Thread.Sleep(4000);

                                gc.CreatePdf(orderNumber, ParcelID, "Tax Receipt Details" + Taxy, driver, "GA", "Coweta");
                            }
                            catch
                            { }

                            driver.Navigate().Back();
                            Thread.Sleep(3000);
                        }
                    }

                    //Tax Authority
                    driver.Navigate().GoToUrl("https://www.cowetataxcom.com/#/contact");
                    Thread.Sleep(2000);
                    try
                    {
                        Taxing     = driver.FindElement(By.XPath("//*[@id='editor1567']/p[1]")).Text;
                        Taxing     = WebDriverTest.Between(Taxing, "Coweta County Tax Commissioner", "County Administration Building").Replace("\r\n", " ").Trim();
                        Tax_athuer = "Newnan, Georgia 30264";
                        Phone      = "770-254-2670";
                        Fax        = "770-683-2038";
                        gc.CreatePdf(orderNumber, ParcelID, "Tax Authority Details", driver, "GA", "Coweta");
                        Taxing_Authority = Taxing + " " + Tax_athuer + " " + Phone + " " + Fax;

                        Taxauthority_Details = Taxing_Authority;
                        gc.insert_date(orderNumber, ParcelID, 653, Taxauthority_Details, 1, DateTime.Now);
                    }
                    catch
                    { }

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

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

                    driver.Quit();
                    gc.mergpdf(orderNumber, "GA", "Coweta");
                    return("Data Inserted Successfully");
                }
                catch (Exception ex)
                {
                    driver.Quit();
                    GlobalClass.LogError(ex, orderNumber);
                    throw;
                }
            }
        }
Esempio n. 6
0
        public string FTP_WADC(string houseno, string sname, string sttype, string blockno, string parcelNumber, string searchType, string orderNumber, string directParcel)
        {
            GlobalClass.global_orderNo             = orderNumber;
            HttpContext.Current.Session["orderNo"] = orderNumber;
            GlobalClass.global_parcelNo            = parcelNumber;
            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");
                    if (searchType == "titleflex")
                    {
                        string titleaddress = houseno + " " + sname + " " + sttype + " " + blockno;
                        gc.TitleFlexSearch(orderNumber, "", directParcel, titleaddress, "DC", "District of Columbia");
                        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_DCDC"] = "Zero";
                            driver.Quit();
                            return("No Data Found");
                        }
                        parcelNumber = HttpContext.Current.Session["titleparcel"].ToString();
                        searchType   = "parcel";
                    }

                    if (searchType == "address")
                    {
                        driver.Navigate().GoToUrl("https://www.taxpayerservicecenter.com/RP_Search.jsp?search_type=Assessment");
                        Thread.Sleep(2000);
                        //*[@id='SearchForm']/table/tbody/tr/td/table[2]/tbody/tr[4]/td[2]/table/tbody/tr[1]/td[2]/input
                        driver.FindElement(By.XPath("//*[@id='SearchForm']/div/table/tbody/tr/td/table[2]/tbody/tr[3]/td[2]/table/tbody/tr[1]/td[1]/input")).SendKeys(houseno);
                        driver.FindElement(By.XPath("//*[@id='SearchForm']/div/table/tbody/tr/td/table[2]/tbody/tr[3]/td[2]/table/tbody/tr[1]/td[2]/input")).SendKeys(sname);
                        gc.CreatePdf_WOP(orderNumber, "DCAddressSearch", driver, "DC", "District of Columbia");
                        driver.FindElement(By.Id("imgSearch")).SendKeys(Keys.Enter);
                        try
                        {
                            IWebElement Imulti = driver.FindElement(By.XPath("//*[@id='TABLE1']/tbody/tr/td[2]/div/table/tbody/tr[1]/td/table/tbody/tr[1]/td[1]/font"));
                            strMulti = Imulti.Text;
                        }
                        catch { }

                        try
                        {
                            IWebElement INodata = driver.FindElement(By.XPath("//*[@id='SearchForm']/div/table/tbody/tr/td/table[1]/tbody/tr[3]/td"));
                            if (INodata.Text.Contains("No records were found"))
                            {
                                HttpContext.Current.Session["Nodata_DCDC"] = "Zero";
                                driver.Quit();
                                return("No Data Found");
                            }
                        }
                        catch { }
                        //Multiparcel for Address
                        if (strMulti.Contains("Results 1 to "))
                        {
                            try
                            {
                                strMultiresult = WebDriverTest.Between(strMulti, "Results 1 to ", " of");
                                if ((Convert.ToInt32(strMultiresult) > 1))
                                {
                                    HttpContext.Current.Session["multiparcel_dc"] = "Yes";
                                    int multicount = 0;
                                    gc.CreatePdf_WOP(orderNumber, "DCMultiPropertyDetails", driver, "DC", "District of Columbia");
                                    IWebElement         ImultiTable = driver.FindElement(By.XPath("//*[@id='TABLE1']/tbody/tr/td[2]/div/table/tbody/tr[2]/td/table"));
                                    IList <IWebElement> ImultiRow   = ImultiTable.FindElements(By.TagName("tr"));
                                    IList <IWebElement> ImultiTD;
                                    foreach (IWebElement rows in ImultiRow)
                                    {
                                        ImultiTD = rows.FindElements(By.TagName("td"));
                                        if (ImultiTD.Count != 0)
                                        {
                                            if (multicount <= 25)
                                            {
                                                string strParcel  = ImultiTD[0].Text;
                                                string strAddress = ImultiTD[1].Text;
                                                string strOwner   = ImultiTD[2].Text;

                                                string multi = strOwner + "~" + strAddress;
                                                // db.ExecuteQuery("insert into data_value_master (Order_no,parcel_no,Data_Field_Text_Id,Data_Field_value,Is_Table) values ('" + orderNumber + "','" + strParcel.Trim() + "',47 ,'" + multi + "',1)");
                                                gc.insert_date(orderNumber, strParcel.Trim(), 47, multi, 1, DateTime.Now);
                                            }
                                        }
                                        multicount++;
                                    }
                                }
                                if ((Convert.ToInt32(strMultiresult) > 25))
                                {
                                    HttpContext.Current.Session["multiparcel_dc_count"] = "Maximum";
                                    return("Maximum");
                                }
                            }

                            catch { }

                            driver.Quit();
                            return("MultiParcel");
                        }
                        else
                        {
                            IWebElement Iparcel = driver.FindElement(By.XPath("//*[@id='form1']/table/tbody/tr[2]/td/table/tbody/tr[2]/td[2]"));
                            if (Iparcel.Text != " ")
                            {
                                parcelNumber = Iparcel.Text;
                            }
                            propertyDetails(orderNumber, parcelNumber);
                        }
                    }
                    if (searchType == "parcel")
                    {
                        if (GlobalClass.titleparcel != "")
                        {
                            parcelNumber = GlobalClass.titleparcel;
                        }
                        if (parcelNumber.Contains("-"))
                        {
                            parcelNumber = parcelNumber.Replace("-", "");
                        }
                        Outparcelno = parcelNumber.Replace(" ", "");
                        driver.Navigate().GoToUrl("https://www.taxpayerservicecenter.com/RP_Search.jsp?search_type=Assessment");
                        Thread.Sleep(2000);
                        if (Outparcelno.Length == 12)
                        {
                            strsplitparfirst = Outparcelno.Substring(0, 4);
                            driver.FindElement(By.XPath("//*[@id='SearchForm']/div/table/tbody/tr/td/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td[2]/input")).SendKeys(strsplitparfirst);
                            strsplitparsecond = Outparcelno.Substring(4, 4);
                            if (strsplitparsecond == "0000")
                            {
                                strsplitparsecond = "";
                            }
                            driver.FindElement(By.XPath("//*[@id='SearchForm']/div/table/tbody/tr/td/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td[4]/input")).SendKeys(strsplitparsecond);
                            strsplitparthird = Outparcelno.Substring(8, 4);
                            driver.FindElement(By.XPath("//*[@id='SearchForm']/div/table/tbody/tr/td/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td[6]/input")).SendKeys(strsplitparthird);
                            //Screenshot
                            gc.CreatePdf(orderNumber, Outparcelno, "DCParcelSearch", driver, "DC", "District of Columbia");
                            driver.FindElement(By.Id("imgSearch")).SendKeys(Keys.Enter);

                            try
                            {
                                IWebElement INodata = driver.FindElement(By.XPath("//*[@id='SearchForm']/div/table/tbody/tr/td/table[1]/tbody/tr[3]/td"));
                                if (INodata.Text.Contains("No records were found"))
                                {
                                    HttpContext.Current.Session["Nodata_DCDC"] = "Zero";
                                    driver.Quit();
                                    return("No Data Found");
                                }
                            }
                            catch { }
                            ParcelSearch(orderNumber, Outparcelno);
                        }
                        if (Outparcelno.Length == 8)
                        {
                            strsplitparfirst = Outparcelno.Substring(0, 4);
                            driver.FindElement(By.XPath("//*[@id='SearchForm']/div/table/tbody/tr/td/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td[2]/input")).SendKeys(strsplitparfirst);
                            strsplitparsecond = Outparcelno.Substring(4, 4);
                            driver.FindElement(By.XPath("//*[@id='SearchForm']/div/table/tbody/tr/td/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td[6]/input")).SendKeys(strsplitparsecond);
                            driver.FindElement(By.Id("imgSearch")).SendKeys(Keys.Enter);
                            //Screenshot
                            gc.CreatePdf(orderNumber, Outparcelno, "DCParcelSearch", driver, "DC", "District of Columbia");

                            try
                            {
                                IWebElement INodata = driver.FindElement(By.XPath("//*[@id='SearchForm']/div/table/tbody/tr/td/table[1]/tbody/tr[3]/td"));
                                if (INodata.Text.Contains("No records were found"))
                                {
                                    HttpContext.Current.Session["Nodata_DCDC"] = "Zero";
                                    driver.Quit();
                                    return("No Data Found");
                                }
                            }
                            catch { }
                            propertyDetails(orderNumber, Outparcelno);
                        }
                    }
                    GlobalClass.titleparcel = "";

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

                    LastEndTime = DateTime.Now.ToString("HH:mm:ss");
                    gc.insert_TakenTime(orderNumber, "DC", "District of Columbia", StartTime, AssessmentTime, TaxTime, CitytaxTime, LastEndTime);


                    driver.Quit();
                    gc.mergpdf(orderNumber, "DC", "District of Columbia");
                    return("Data Inserted Successfully");
                }
                catch (Exception ex)
                {
                    driver.Quit();
                    throw ex;
                }
            }
        }
Esempio n. 7
0
        public string FTP_FLFlagler(string address, string assessment_id, string parcelNumber, string searchType, string orderNumber, string directParcel, string ownername)
        {
            string Parcelno = "", Owner = "", Property_Address = "", City = "", MultiOwner_details = "", MultiAddress_details = "";
            string Par = "", Parcel_ID = "", Loc = "", Location = "", Lg_Des = "", Legal = "", Pro_Code = "", Property_Code = "", Distr = "", Property_District = "", Mi_Rate = "", Pro_Milagerate = "", Acres = "", Acreage = "", PRo_Home = "", Homestead = "", Pro_Owner = "", Pro_MilingAddreess = "", Pro_YearBuilt = "", property = "";
            string Assemnt_Details1 = "", Assemnt_Details2 = "", Assemnt_Details3 = "", Assemnt_Details4 = "", Year1 = "", Year2 = "", Year3 = "", Year4 = "", currenttax = "", curtax = "", prior_total = "", priortotlinsert = "", taxhis = "", Url = "", tax_authority = "", Tax_Sale = "", tax_sales = "", taxhistoryownername = "";
            string exempt = "", exempt_amount = "", EscrowCode = "", milage_code = "", taxhistoryPayid = "", tax_type = "", tax_years = "", valoremtotal = "", total_milage = "", total_Asstax = "", valoremtax = "", nonvaloremtax = "", total_ass = "", Total_taxes = "", valoremtotalass = "", valoremtotaltax = "", curtaxhis = "", date_paid = "", Transaction = "", Receipt = "", Amount_Paid = "", Item = "";

            GlobalClass.global_orderNo             = orderNumber;
            HttpContext.Current.Session["orderNo"] = orderNumber;
            GlobalClass.global_parcelNo            = parcelNumber;
            string StartTime = "", AssessmentTime = "", TaxTime = "", CitytaxTime = "", LastEndTime = "";
            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");

                    if (searchType == "titleflex")
                    {
                        string titleaddress = address;
                        gc.TitleFlexSearch(orderNumber, "", "", titleaddress, "FL", "Flagler");

                        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_FLFlagler"] = "Yes";
                            driver.Quit();
                            return("No Data Found");
                        }
                        parcelNumber = HttpContext.Current.Session["titleparcel"].ToString();
                        searchType   = "parcel";
                    }

                    if (searchType == "address")
                    {
                        driver.Navigate().GoToUrl("https://qpublic.schneidercorp.com/Application.aspx?App=FlaglerCountyFL&Layer=Parcels&PageType=Search");
                        Thread.Sleep(5000);
                        try
                        {
                            driver.FindElement(By.XPath("//*[@id='appBody']/div[4]/div/div/div[3]/a[1]")).Click();
                            Thread.Sleep(2000);
                        }
                        catch { }

                        driver.FindElement(By.Id("ctlBodyPane_ctl00_ctl01_txtAddress")).SendKeys(address);
                        gc.CreatePdf_WOP(orderNumber, "Address search", driver, "FL", "Flagler");
                        driver.FindElement(By.Id("ctlBodyPane_ctl00_ctl01_btnSearch")).SendKeys(Keys.Enter);
                        Thread.Sleep(2000);

                        try
                        {
                            IWebElement         MultiAddressTB = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl00_ctl01_gvwParcelResults']/tbody"));
                            IList <IWebElement> MultiAddressTR = MultiAddressTB.FindElements(By.TagName("tr"));
                            IList <IWebElement> MultiAddressTD;
                            gc.CreatePdf_WOP(orderNumber, "Multi Address search", driver, "FL", "Flagler");
                            int AddressmaxCheck = 0;
                            foreach (IWebElement MultiAddress in MultiAddressTR)
                            {
                                if (AddressmaxCheck <= 25)
                                {
                                    MultiAddressTD = MultiAddress.FindElements(By.TagName("td"));
                                    if (MultiAddressTD.Count != 0)
                                    {
                                        Parcelno         = MultiAddressTD[2].Text;
                                        Owner            = MultiAddressTD[3].Text;
                                        Property_Address = MultiAddressTD[4].Text;
                                        City             = MultiAddressTD[5].Text;

                                        MultiAddress_details = Owner + "~" + Property_Address + "~" + City;
                                        gc.insert_date(orderNumber, Parcelno, 1289, MultiAddress_details, 1, DateTime.Now);
                                    }
                                    AddressmaxCheck++;
                                }
                            }
                            if (MultiAddressTR.Count > 25)
                            {
                                HttpContext.Current.Session["multiParcel_FLFlagler_Multicount"] = "Maximum";
                            }
                            else
                            {
                                HttpContext.Current.Session["multiparcel_FLFlagler"] = "Yes";
                            }
                            driver.Quit();
                            return("MultiParcel");
                        }
                        catch
                        { }
                        try
                        {
                            string nodata = driver.FindElement(By.Id("ctlBodyPane_noDataList_pnlNoResults")).Text;
                            if (nodata.Contains("No results"))
                            {
                                HttpContext.Current.Session["Nodata_FLFlagler"] = "Yes";
                                driver.Quit();
                                return("No Data Found");
                            }
                        }
                        catch { }
                    }

                    if (searchType == "parcel")
                    {
                        driver.Navigate().GoToUrl("https://qpublic.schneidercorp.com/Application.aspx?App=FlaglerCountyFL&Layer=Parcels&PageType=Search");
                        Thread.Sleep(2000);
                        try
                        {
                            driver.FindElement(By.XPath("//*[@id='appBody']/div[4]/div/div/div[3]/a[1]")).Click();
                            Thread.Sleep(2000);
                        }
                        catch { }

                        driver.FindElement(By.Id("ctlBodyPane_ctl02_ctl01_txtParcelID")).SendKeys(parcelNumber);
                        gc.CreatePdf(orderNumber, parcelNumber, "ParcelSearch", driver, "FL", "Flagler");
                        driver.FindElement(By.Id("ctlBodyPane_ctl02_ctl01_btnSearch")).SendKeys(Keys.Enter);
                        Thread.Sleep(2000);
                    }

                    if (searchType == "ownername")
                    {
                        driver.Navigate().GoToUrl("https://qpublic.schneidercorp.com/Application.aspx?App=FlaglerCountyFL&Layer=Parcels&PageType=Search");
                        Thread.Sleep(2000);
                        try
                        {
                            driver.FindElement(By.XPath("//*[@id='appBody']/div[4]/div/div/div[3]/a[1]")).Click();
                            Thread.Sleep(2000);
                        }
                        catch { }

                        driver.FindElement(By.Id("ctlBodyPane_ctl01_ctl01_txtName")).SendKeys(ownername);
                        gc.CreatePdf_WOP(orderNumber, "Owner search", driver, "FL", "Flagler");
                        driver.FindElement(By.Id("ctlBodyPane_ctl01_ctl01_btnSearch")).SendKeys(Keys.Enter);
                        Thread.Sleep(2000);

                        try
                        {
                            IWebElement         MultiOwnerTB = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl00_ctl01_gvwParcelResults']/tbody"));
                            IList <IWebElement> MultiOwnerTR = MultiOwnerTB.FindElements(By.TagName("tr"));
                            IList <IWebElement> MultiOwnerTD;
                            gc.CreatePdf_WOP(orderNumber, "Multi Owner search", driver, "FL", "Flagler");
                            int OwnermaxCheck = 0;
                            foreach (IWebElement MultiOwner in MultiOwnerTR)
                            {
                                if (OwnermaxCheck <= 25)
                                {
                                    MultiOwnerTD = MultiOwner.FindElements(By.TagName("td"));
                                    if (MultiOwnerTD.Count != 0)
                                    {
                                        Parcelno         = MultiOwnerTD[2].Text;
                                        Owner            = MultiOwnerTD[3].Text;
                                        Property_Address = MultiOwnerTD[4].Text;
                                        City             = MultiOwnerTD[5].Text;

                                        MultiOwner_details = Owner + "~" + Property_Address + "~" + City;
                                        gc.insert_date(orderNumber, Parcelno, 1289, MultiOwner_details, 1, DateTime.Now);
                                    }
                                    OwnermaxCheck++;
                                }
                            }
                            if (MultiOwnerTR.Count > 25)
                            {
                                HttpContext.Current.Session["multiParcel_FLFlagler_Multicount"] = "Maximum";
                            }
                            else
                            {
                                HttpContext.Current.Session["multiparcel_FLFlagler"] = "Yes";
                            }
                            driver.Quit();
                            return("MultiParcel");
                        }
                        catch
                        { }
                    }
                    try
                    {
                        IWebElement Inodata = driver.FindElement(By.Id("ctlBodyPane_noDataList_pnlNoResults"));
                        if (Inodata.Text.Contains("No results match"))
                        {
                            HttpContext.Current.Session["Nodata_FLFlagler"] = "Yes";
                            driver.Quit();
                            return("No Data Found");
                        }
                    }
                    catch { }
                    //Property Details
                    IWebElement         PropertyTB = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl01_mSection']/div/table/tbody"));
                    IList <IWebElement> PropertyTR = PropertyTB.FindElements(By.TagName("tr"));
                    IList <IWebElement> PropertyTD;
                    foreach (IWebElement Property in PropertyTR)
                    {
                        PropertyTD = Property.FindElements(By.TagName("td"));
                        if (PropertyTD.Count != 0)
                        {
                            Par = PropertyTD[0].Text;
                            if (Par.Contains("Parcel ID"))
                            {
                                Parcel_ID = PropertyTD[1].Text;
                            }

                            Loc = PropertyTD[0].Text;
                            if (Loc.Contains("Location Address"))
                            {
                                Location = PropertyTD[1].Text;
                            }

                            Lg_Des = PropertyTD[0].Text;
                            if (Lg_Des.Contains("Brief Tax Description*"))
                            {
                                Legal = PropertyTD[1].Text;
                            }

                            Pro_Code = PropertyTD[0].Text;
                            if (Pro_Code.Contains("Property Use Code"))
                            {
                                Property_Code = PropertyTD[1].Text;
                            }

                            Distr = PropertyTD[0].Text;
                            if (Distr.Contains("Tax District"))
                            {
                                Property_District = PropertyTD[1].Text;
                            }

                            Mi_Rate = PropertyTD[0].Text;
                            if (Mi_Rate.Contains("Millage Rate"))
                            {
                                Pro_Milagerate = PropertyTD[1].Text;
                            }

                            Acres = PropertyTD[0].Text;
                            if (Acres.Contains("Acreage"))
                            {
                                Acreage = PropertyTD[1].Text;
                            }

                            PRo_Home = PropertyTD[0].Text;
                            if (PRo_Home.Contains("Homestead"))
                            {
                                Homestead = PropertyTD[1].Text;
                            }
                        }
                    }

                    try
                    {
                        Pro_Owner          = driver.FindElement(By.Id("ctlBodyPane_ctl00_ctl01_lstPrimaryOwner_ctl00_lblPrimaryOwnerName_lblSearch")).Text;
                        Pro_MilingAddreess = driver.FindElement(By.Id("ctlBodyPane_ctl00_ctl01_lstPrimaryOwner_ctl00_lblPrimaryOwnerAddress")).Text;
                        Pro_YearBuilt      = driver.FindElement(By.Id("ctlBodyPane_ctl08_ctl01_lstBuildings_ctl00_Label1")).Text;
                    }
                    catch
                    { }

                    property = Location + "~" + Legal + "~" + Pro_Owner + "~" + Property_Code + "~" + Property_District + "~" + Pro_Milagerate + "~" + Acreage + "~" + Homestead + "~" + Pro_MilingAddreess + "~" + Pro_YearBuilt;
                    gc.CreatePdf(orderNumber, Parcel_ID, "Property Details", driver, "FL", "Flagler");
                    gc.insert_date(orderNumber, Parcel_ID, 1290, property, 1, DateTime.Now);

                    //Assessment Details
                    //*[@id="ctlBodyPane_ctl02_ctl01_grdValuation"]/thead
                    IWebElement         AssmThTb = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl02_ctl01_grdValuation']/thead"));
                    IList <IWebElement> AssmThTr = AssmThTb.FindElements(By.TagName("tr"));
                    IList <IWebElement> AssmTh;

                    foreach (IWebElement Assm in AssmThTr)
                    {
                        AssmTh = Assm.FindElements(By.TagName("th"));
                        if (AssmTh.Count != 0)
                        {
                            Year1 = AssmTh[0].Text;
                            Year2 = AssmTh[1].Text;
                            Year3 = AssmTh[2].Text;
                            Year4 = AssmTh[3].Text;
                        }
                    }

                    IWebElement         AssmTb = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl02_ctl01_grdValuation']/tbody"));
                    IList <IWebElement> AssmTr = AssmTb.FindElements(By.TagName("tr"));
                    IList <IWebElement> AssmTd;
                    int j = 0;

                    List <string> Building_Value          = new List <string>();
                    List <string> Extra_Feature_Value     = new List <string>();
                    List <string> Land_Value              = new List <string>();
                    List <string> Land_Agricultural_Value = new List <string>();
                    List <string> Agricultural_Value      = new List <string>();
                    List <string> Just_Value              = new List <string>();
                    List <string> Assessed_Value          = new List <string>();
                    List <string> Exempt_Value            = new List <string>();
                    List <string> Taxable_Value           = new List <string>();
                    List <string> Protected_Value         = new List <string>();

                    foreach (IWebElement Assmrow in AssmTr)
                    {
                        AssmTd = Assmrow.FindElements(By.TagName("td"));

                        if (AssmTd.Count != 0)
                        {
                            if (j == 0)
                            {
                                Building_Value.Add(AssmTd[1].Text);
                                Building_Value.Add(AssmTd[2].Text);
                                Building_Value.Add(AssmTd[3].Text);
                                Building_Value.Add(AssmTd[4].Text);
                            }

                            else if (j == 1)
                            {
                                Extra_Feature_Value.Add(AssmTd[1].Text);
                                Extra_Feature_Value.Add(AssmTd[2].Text);
                                Extra_Feature_Value.Add(AssmTd[3].Text);
                                Extra_Feature_Value.Add(AssmTd[4].Text);
                            }

                            else if (j == 2)
                            {
                                Land_Value.Add(AssmTd[1].Text);
                                Land_Value.Add(AssmTd[2].Text);
                                Land_Value.Add(AssmTd[3].Text);
                                Land_Value.Add(AssmTd[4].Text);
                            }

                            else if (j == 3)
                            {
                                Land_Agricultural_Value.Add(AssmTd[1].Text);
                                Land_Agricultural_Value.Add(AssmTd[2].Text);
                                Land_Agricultural_Value.Add(AssmTd[3].Text);
                                Land_Agricultural_Value.Add(AssmTd[4].Text);
                            }

                            else if (j == 4)
                            {
                                Agricultural_Value.Add(AssmTd[1].Text);
                                Agricultural_Value.Add(AssmTd[2].Text);
                                Agricultural_Value.Add(AssmTd[3].Text);
                                Agricultural_Value.Add(AssmTd[4].Text);
                            }

                            else if (j == 5)
                            {
                                Just_Value.Add(AssmTd[1].Text);
                                Just_Value.Add(AssmTd[2].Text);
                                Just_Value.Add(AssmTd[3].Text);
                                Just_Value.Add(AssmTd[4].Text);
                            }

                            else if (j == 6)
                            {
                                Assessed_Value.Add(AssmTd[1].Text);
                                Assessed_Value.Add(AssmTd[2].Text);
                                Assessed_Value.Add(AssmTd[3].Text);
                                Assessed_Value.Add(AssmTd[4].Text);
                            }

                            else if (j == 7)
                            {
                                Exempt_Value.Add(AssmTd[1].Text);
                                Exempt_Value.Add(AssmTd[2].Text);
                                Exempt_Value.Add(AssmTd[3].Text);
                                Exempt_Value.Add(AssmTd[4].Text);
                            }

                            else if (j == 8)
                            {
                                Taxable_Value.Add(AssmTd[1].Text);
                                Taxable_Value.Add(AssmTd[2].Text);
                                Taxable_Value.Add(AssmTd[3].Text);
                                Taxable_Value.Add(AssmTd[4].Text);
                            }

                            else if (j == 9)
                            {
                                Protected_Value.Add(AssmTd[1].Text);
                                Protected_Value.Add(AssmTd[2].Text);
                                Protected_Value.Add(AssmTd[3].Text);
                                Protected_Value.Add(AssmTd[4].Text);
                            }

                            j++;
                        }
                    }
                    Assemnt_Details1 = Year1 + "~" + Building_Value[0] + "~" + Extra_Feature_Value[0] + "~" + Land_Value[0] + "~" + Land_Agricultural_Value[0] + "~" + Agricultural_Value[0] + "~" + Just_Value[0] + "~" + Assessed_Value[0] + "~" + Exempt_Value[0] + "~" + Taxable_Value[0] + "~" + Protected_Value[0];
                    Assemnt_Details2 = Year2 + "~" + Building_Value[1] + "~" + Extra_Feature_Value[1] + "~" + Land_Value[1] + "~" + Land_Agricultural_Value[1] + "~" + Agricultural_Value[1] + "~" + Just_Value[1] + "~" + Assessed_Value[1] + "~" + Exempt_Value[1] + "~" + Taxable_Value[1] + "~" + Protected_Value[1];
                    Assemnt_Details3 = Year3 + "~" + Building_Value[2] + "~" + Extra_Feature_Value[2] + "~" + Land_Value[2] + "~" + Land_Agricultural_Value[2] + "~" + Agricultural_Value[2] + "~" + Just_Value[2] + "~" + Assessed_Value[2] + "~" + Exempt_Value[2] + "~" + Taxable_Value[2] + "~" + Protected_Value[2];
                    Assemnt_Details4 = Year4 + "~" + Building_Value[3] + "~" + Extra_Feature_Value[3] + "~" + Land_Value[3] + "~" + Land_Agricultural_Value[3] + "~" + Agricultural_Value[3] + "~" + Just_Value[3] + "~" + Assessed_Value[3] + "~" + Exempt_Value[3] + "~" + Taxable_Value[3] + "~" + Protected_Value[3];

                    gc.insert_date(orderNumber, Parcel_ID, 1291, Assemnt_Details1, 1, DateTime.Now);
                    gc.insert_date(orderNumber, Parcel_ID, 1291, Assemnt_Details2, 1, DateTime.Now);
                    gc.insert_date(orderNumber, Parcel_ID, 1291, Assemnt_Details3, 1, DateTime.Now);
                    gc.insert_date(orderNumber, Parcel_ID, 1291, Assemnt_Details4, 1, DateTime.Now);
                    AssessmentTime = DateTime.Now.ToString("HH:mm:ss");
                    //Tax Details

                    driver.Navigate().GoToUrl("http://fl-flagler-taxcollector.governmax.com/collectmax/collect30.asp");
                    Thread.Sleep(5000);
                    IWebElement iframeElement = driver.FindElement(By.XPath("/html/frameset/frame"));
                    driver.SwitchTo().Frame(iframeElement);
                    IWebElement img     = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table/tbody/tr/td/table/tbody/tr[4]/td/center")).FindElement(By.TagName("a"));
                    string      imghref = img.GetAttribute("href");
                    driver.Navigate().GoToUrl(imghref);
                    // img.SendKeys(Keys.Enter);
                    Thread.Sleep(5000);
                    // /html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table/tbody/tr/td/table/tbody/tr[1]/td/table/tbody/tr/td/table/tbody/tr[2]/td/font/input
                    //driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table/tbody/tr/td/table/tbody/tr[4]/td/center/a")).SendKeys(Keys.Enter);
                    // Thread.Sleep(5000);
                    driver.FindElement(By.Name("account")).SendKeys(Parcel_ID);
                    gc.CreatePdf(orderNumber, Parcel_ID, "TaxPage Input Passed", driver, "FL", "Flagler");
                    driver.FindElement(By.Name("go")).SendKeys(Keys.Enter);
                    Thread.Sleep(5000);
                    gc.CreatePdf(orderNumber, Parcel_ID, "Tax Deails", driver, "FL", "Flagler");
                    try
                    {
                        exempt = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table[3]/tbody/tr[6]/td/table/tbody/tr/td/table/tbody/tr[2]/td[1]/font")).Text.Trim();
                    }
                    catch { }

                    try
                    {
                        IWebElement         exemtable    = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table[3]/tbody/tr[6]/td/table/tbody/tr/td/table/tbody/tr[2]/td[1]/table/tbody"));
                        IList <IWebElement> exemtableRow = exemtable.FindElements(By.TagName("tr"));
                        int exemtablecount = exemtableRow.Count;
                        IList <IWebElement> exemtablerowTD;
                        int a = 0;
                        foreach (IWebElement rowid in exemtableRow)
                        {
                            exemtablerowTD = rowid.FindElements(By.TagName("td"));
                            if (exemtablerowTD.Count != 0 && !rowid.Text.Contains("Taxing Authority"))
                            {
                                if (a == 0)
                                {
                                    exempt        = exemtablerowTD[0].Text;
                                    exempt_amount = exemtablerowTD[1].Text;
                                }
                                else if (a == 1)
                                {
                                    exempt += ",";

                                    exempt        += exemtablerowTD[0].Text;
                                    exempt_amount += ",";
                                    exempt_amount += exemtablerowTD[1].Text;
                                }
                                a++;
                            }
                        }
                    }
                    catch { }

                    try
                    {
                        milage_code = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table[3]/tbody/tr[6]/td/table/tbody/tr/td/table/tbody/tr[2]/td[2]/font")).Text.Trim();
                        tax_type    = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table[3]/tbody/tr[2]/td[2]/font/b")).Text.Trim();
                        tax_years   = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table[3]/tbody/tr[2]/td[3]/font/b")).Text.Trim();
                        EscrowCode  = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table[3]/tbody/tr[6]/td/table/tbody/tr/td/table/tbody/tr[2]/td[3]/font")).Text;
                    }
                    catch
                    { }

                    //valorem Details
                    try
                    {
                        IWebElement         valoremtable    = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table[3]/tbody/tr[8]/td/table[1]/tbody"));
                        IList <IWebElement> valoremtableRow = valoremtable.FindElements(By.TagName("tr"));
                        int valoremtablerowcount            = valoremtableRow.Count;
                        IList <IWebElement> valoremtablerowTD;
                        foreach (IWebElement rowid in valoremtableRow)
                        {
                            valoremtablerowTD = rowid.FindElements(By.TagName("td"));
                            if (valoremtablerowTD.Count != 0 && !rowid.Text.Contains("Taxing Authority"))
                            {
                                if (valoremtablerowTD.Count == 6)
                                {
                                    valoremtax = valoremtablerowTD[0].Text + "~" + "" + "~" + "Ad Valorem Taxes" + "~" + valoremtablerowTD[1].Text + "~" + valoremtablerowTD[2].Text + "~" + valoremtablerowTD[3].Text + "~" + valoremtablerowTD[4].Text + "~" + valoremtablerowTD[5].Text;
                                    gc.insert_date(orderNumber, Parcel_ID, 1297, valoremtax, 1, DateTime.Now);
                                }
                                else if (valoremtablerowTD.Count == 2)
                                {
                                    valoremtax = valoremtablerowTD[0].Text + "~" + "" + "~" + "Ad Valorem Taxes" + "~" + "" + "~" + "" + "~" + "" + "~" + "" + "~" + "";
                                    gc.insert_date(orderNumber, Parcel_ID, 1297, valoremtax, 1, DateTime.Now);
                                }
                            }
                        }

                        total_milage = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table[3]/tbody/tr[8]/td/table[2]/tbody/tr/td[2]/font")).Text.Trim();
                        total_Asstax = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table[3]/tbody/tr[8]/td/table[2]/tbody/tr/td[4]/font")).Text.Trim();
                        valoremtotal = "Total" + "~" + "" + "~" + "Ad Valorem Taxes" + "~" + total_milage + "~" + " " + "~" + " " + "~" + " " + "~" + total_Asstax;
                        gc.insert_date(orderNumber, Parcel_ID, 1297, valoremtotal, 1, DateTime.Now);
                    }
                    catch { }

                    try
                    {
                        IWebElement         nonvaloremtable    = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table[3]/tbody/tr[10]/td/table[1]/tbody"));
                        IList <IWebElement> nonvaloremtableRow = nonvaloremtable.FindElements(By.TagName("tr"));
                        int nonvaloremtablerowcount            = nonvaloremtableRow.Count;
                        IList <IWebElement> nonvaloremtablerowTD;
                        foreach (IWebElement rowid in nonvaloremtableRow)
                        {
                            nonvaloremtablerowTD = rowid.FindElements(By.TagName("td"));
                            if (nonvaloremtablerowTD.Count != 0 && !rowid.Text.Contains("Levying Authority") && !rowid.Text.Trim().Contains(""))
                            {
                                nonvaloremtax = "";
                                try
                                {
                                    nonvaloremtax = nonvaloremtablerowTD[1].Text + "~" + nonvaloremtablerowTD[0].Text + "~" + "Non-Ad Valorem Taxes" + "~" + "" + "~" + "" + "~" + "" + "~" + "" + "~" + nonvaloremtablerowTD[2].Text;
                                    gc.insert_date(orderNumber, Parcel_ID, 1297, nonvaloremtax, 1, DateTime.Now);
                                }
                                catch { }
                            }
                        }

                        total_ass       = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table[3]/tbody/tr[10]/td/table[2]/tbody/tr/td[2]/font")).Text.Trim();
                        Total_taxes     = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table[3]/tbody/tr[11]/td/table/tbody/tr/td[4]/font")).Text.Trim();
                        valoremtotalass = "Total" + "~" + "" + "~" + "Total Assessments" + "~" + "" + "~" + " " + "~" + " " + "~" + " " + "~" + total_ass;
                        gc.insert_date(orderNumber, Parcel_ID, 1297, valoremtotalass, 1, DateTime.Now);
                        valoremtotaltax = "Total" + "~" + "" + "~" + "Taxes & Assessments" + "~" + "" + "~" + " " + "~" + " " + "~" + " " + "~" + Total_taxes;
                        gc.insert_date(orderNumber, Parcel_ID, 1297, valoremtotaltax, 1, DateTime.Now);
                    }
                    catch
                    { }

                    //Tax Due
                    try
                    {
                        IWebElement         taxduetable    = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table[4]/tbody/tr/td/table/tbody"));
                        IList <IWebElement> taxduetableRow = taxduetable.FindElements(By.TagName("tr"));
                        int taxduerowcount = taxduetableRow.Count;
                        IList <IWebElement> taxduetablerowTD;
                        foreach (IWebElement rowid in taxduetableRow)
                        {
                            taxduetablerowTD = rowid.FindElements(By.TagName("td"));
                            if (taxduetablerowTD.Count != 0 && !rowid.Text.Contains("If Paid By"))
                            {
                                try
                                {
                                    curtax = taxduetablerowTD[0].Text + "~" + taxduetablerowTD[1].Text;
                                    gc.insert_date(orderNumber, Parcel_ID, 1298, curtax, 1, DateTime.Now);
                                }
                                catch { }
                            }
                        }
                    }
                    catch { }

                    //curtaxhistory
                    try
                    {
                        IWebElement         taxpaidtable    = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table[5]"));
                        IList <IWebElement> taxpaidtableRow = taxpaidtable.FindElements(By.TagName("tr"));
                        int taxpaidrowcount = taxpaidtableRow.Count;
                        IList <IWebElement> taxduetablerowTD;
                        foreach (IWebElement rowid in taxpaidtableRow)
                        {
                            taxduetablerowTD = rowid.FindElements(By.TagName("td"));
                            if (taxduetablerowTD.Count != 0 && !rowid.Text.Contains("Date Paid"))
                            {
                                try
                                {
                                    date_paid = taxduetablerowTD[0].Text; Transaction = taxduetablerowTD[1].Text; Receipt = taxduetablerowTD[2].Text;
                                    Item      = taxduetablerowTD[3].Text; Amount_Paid = taxduetablerowTD[4].Text;
                                    //currenttax = "" + "~" + "" + "~" + "" + "~" + "" + "~" + Item + "~" + "" + "~" + Amount_Paid + "~" + date_paid + "~" + "" + "~" + Receipt + "~" + "" + "~" + Transaction + "~" + "";
                                    //gc.insert_date(orderNumber, Parcel_ID, 1299, currenttax, 1, DateTime.Now);
                                }
                                catch { }
                            }
                        }
                    }
                    catch
                    { }

                    //prior year tax
                    try
                    {
                        IWebElement         priortaxtable    = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table[6]/tbody/tr[2]/td/table[1]/tbody"));
                        IList <IWebElement> priortaxtableRow = priortaxtable.FindElements(By.TagName("tr"));
                        int priorrowcount = priortaxtableRow.Count;
                        IList <IWebElement> priortaxtablerowTD;
                        foreach (IWebElement rowid in priortaxtableRow)
                        {
                            priortaxtablerowTD = rowid.FindElements(By.TagName("td"));
                            if (priortaxtablerowTD.Count != 0 && !rowid.Text.Contains("Year"))
                            {
                                try
                                {
                                    curtax = priortaxtablerowTD[0].Text + "~" + priortaxtablerowTD[1].Text + "~" + priortaxtablerowTD[2].Text + "~" + priortaxtablerowTD[3].Text + "~" + priortaxtablerowTD[4].Text + "~" + priortaxtablerowTD[5].Text;
                                    gc.insert_date(orderNumber, Parcel_ID, 1300, curtax, 1, DateTime.Now);
                                }
                                catch { }
                            }
                        }
                    }
                    catch { }

                    try
                    {
                        prior_total     = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table[6]/tbody/tr[2]/td/table[3]/tbody/tr/td[2]")).Text.Trim();
                        priortotlinsert = "Prior Years Total " + "~" + "" + "~" + "" + "~" + "" + "~" + "" + "~" + prior_total;
                        gc.insert_date(orderNumber, Parcel_ID, 1300, priortotlinsert, 1, DateTime.Now);

                        IWebElement         priortaxdettable    = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table[7]/tbody"));
                        IList <IWebElement> priortaxdettableRow = priortaxdettable.FindElements(By.TagName("tr"));
                        int priortaxdettablecount = priortaxdettableRow.Count;
                        IList <IWebElement> priortaxdettablerowTD;
                        foreach (IWebElement rowid in priortaxdettableRow)
                        {
                            priortaxdettablerowTD = rowid.FindElements(By.TagName("td"));
                            if (priortaxdettablerowTD.Count != 0 && !rowid.Text.Contains("If Paid By"))
                            {
                                try
                                {
                                    curtax = priortaxdettablerowTD[0].Text + "~" + "Delinquent" + "~" + priortaxdettablerowTD[1].Text;
                                    gc.insert_date(orderNumber, Parcel_ID, 1298, curtax, 1, DateTime.Now);
                                }
                                catch { }
                            }
                        }
                    }
                    catch
                    { }

                    //Tax Sale
                    try
                    {
                        tax_sales = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table[4]/tbody/tr/td")).Text;
                        tax_sales = WebDriverTest.Between(tax_sales, "Please contact the ", " at (386)");
                        if (tax_sales == "Tax Department")
                        {
                            Tax_Sale = "Due to the status code assigned to this account, the remaining detail is blocked from viewing. Please contact the Tax Department at (386) 313-4160 for further information regarding this account.";
                            gc.insert_date(orderNumber, Parcel_ID, 1372, Tax_Sale, 1, DateTime.Now);
                        }
                    }
                    catch
                    { }

                    //Tax History Details
                    try
                    {
                        try
                        {
                            driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table[6]/tbody/tr/td/font/a")).SendKeys(Keys.Enter);
                            Thread.Sleep(2000);
                        }
                        catch { }
                        try
                        {
                            driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table[5]/tbody/tr/td/font/a")).SendKeys(Keys.Enter);
                        }
                        catch { }
                        Thread.Sleep(7000);
                        gc.CreatePdf(orderNumber, Parcel_ID, "Tax History Deails", driver, "FL", "Flagler");

                        IWebElement         tablelist  = driver.FindElement(By.XPath("html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table/tbody/tr/td"));
                        IList <IWebElement> tablelists = tablelist.FindElements(By.TagName("table"));
                        int tablecount = tablelists.Count;
                        int k          = 3;
                        for (k = 3; k < tablecount - 1; k++)
                        {
                            IWebElement         taxhistorytable    = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table/tbody/tr/td/table[" + k + "]/tbody"));
                            IList <IWebElement> taxhistorytableRow = taxhistorytable.FindElements(By.TagName("tr"));
                            int taxhistorytablecount = taxhistorytableRow.Count;
                            IList <IWebElement> taxhistorytablerowTD;
                            foreach (IWebElement rowid1 in taxhistorytableRow)
                            {
                                taxhistorytablerowTD = rowid1.FindElements(By.TagName("td"));
                                if (k == 3)
                                {
                                    if (taxhistorytablerowTD.Count != 0 && !rowid1.Text.Contains("Payment History") && !rowid1.Text.Contains("Year") && taxhistorytableRow.Count == 4)
                                    {
                                        if (taxhistorytablerowTD.Count == 6)
                                        {
                                            taxhis = taxhistorytablerowTD[0].Text + "~" + taxhistorytablerowTD[1].Text + "~" + taxhistorytablerowTD[2].Text + "~" + taxhistorytablerowTD[3].Text + "~" + taxhistorytablerowTD[4].Text + "~" + taxhistorytablerowTD[5].Text;
                                        }
                                        if (taxhistorytablerowTD.Count == 2)
                                        {
                                            if (taxhistorytablerowTD[0].Text.Trim().Contains("Owner Name"))
                                            {
                                                taxhistoryownername = taxhis + "~" + taxhistorytablerowTD[1].Text + "~" + "";
                                                gc.insert_date(orderNumber, Parcel_ID, 1304, taxhistoryownername, 1, DateTime.Now);
                                            }
                                        }
                                    }
                                    if (taxhistorytablerowTD.Count != 0 && !rowid1.Text.Contains("Payment History") && !rowid1.Text.Contains("Year") && taxhistorytableRow.Count == 5)
                                    {
                                        if (taxhistorytablerowTD.Count == 6)
                                        {
                                            taxhis = taxhistorytablerowTD[0].Text + "~" + taxhistorytablerowTD[1].Text + "~" + taxhistorytablerowTD[2].Text + "~" + taxhistorytablerowTD[3].Text + "~" + taxhistorytablerowTD[4].Text + "~" + taxhistorytablerowTD[5].Text;
                                        }
                                        if (taxhistorytablerowTD.Count == 2)
                                        {
                                            if (taxhistorytablerowTD[0].Text.Trim().Contains("Owner Name"))
                                            {
                                                taxhistoryownername = taxhistorytablerowTD[1].Text;
                                            }
                                            if (taxhistorytablerowTD[0].Text.Trim().Contains("Paid By"))
                                            {
                                                taxhistoryPayid = taxhis + "~" + taxhistoryownername + "~" + taxhistorytablerowTD[1].Text;
                                                gc.insert_date(orderNumber, Parcel_ID, 1304, taxhistoryPayid, 1, DateTime.Now);
                                            }
                                        }
                                    }
                                }
                                else
                                {
                                    if (taxhistorytablerowTD.Count != 0 && !rowid1.Text.Contains("Payment History") && !rowid1.Text.Contains("Year") && taxhistorytableRow.Count == 3)
                                    {
                                        if (taxhistorytablerowTD.Count == 6)
                                        {
                                            taxhis = taxhistorytablerowTD[0].Text + "~" + taxhistorytablerowTD[1].Text + "~" + taxhistorytablerowTD[2].Text + "~" + taxhistorytablerowTD[3].Text + "~" + taxhistorytablerowTD[4].Text + "~" + taxhistorytablerowTD[5].Text;
                                        }
                                        if (taxhistorytablerowTD.Count == 2)
                                        {
                                            if (taxhistorytablerowTD[0].Text.Trim().Contains("Owner Name"))
                                            {
                                                taxhistoryownername = taxhis + "~" + taxhistorytablerowTD[1].Text + "~" + "";
                                                gc.insert_date(orderNumber, Parcel_ID, 1304, taxhistoryownername, 1, DateTime.Now);
                                            }
                                        }
                                    }
                                    if (taxhistorytablerowTD.Count != 0 && !rowid1.Text.Contains("Payment History") && !rowid1.Text.Contains("Year") && taxhistorytableRow.Count == 4)
                                    {
                                        if (taxhistorytablerowTD.Count == 6)
                                        {
                                            taxhis = taxhistorytablerowTD[0].Text + "~" + taxhistorytablerowTD[1].Text + "~" + taxhistorytablerowTD[2].Text + "~" + taxhistorytablerowTD[3].Text + "~" + taxhistorytablerowTD[4].Text + "~" + taxhistorytablerowTD[5].Text;
                                        }
                                        if (taxhistorytablerowTD.Count == 2)
                                        {
                                            if (taxhistorytablerowTD[0].Text.Trim().Contains("Owner Name"))
                                            {
                                                taxhistoryownername = taxhistorytablerowTD[1].Text;
                                            }
                                            if (taxhistorytablerowTD[0].Text.Trim().Contains("Paid By"))
                                            {
                                                taxhistoryPayid = taxhis + "~" + taxhistoryownername + "~" + taxhistorytablerowTD[1].Text;
                                                gc.insert_date(orderNumber, Parcel_ID, 1304, taxhistoryPayid, 1, DateTime.Now);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                    catch { }

                    //Bill Screeshot
                    try
                    {
                        IWebElement Idownloadurl = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[1]/td[1]/table/tbody/tr[2]/td/table/tbody/tr[8]/td/font/a"));
                        Url = Idownloadurl.GetAttribute("href");
                        driver.Navigate().GoToUrl(Url);
                        Thread.Sleep(5000);
                        gc.CreatePdf(orderNumber, Parcel_ID, "Tax Bill", driver, "FL", "Flagler");
                    }
                    catch
                    { }

                    //Tax Authority
                    try
                    {
                        tax_authority = "Flagler County Tax Collector 1769 E. Moody Blvd. Suite 102 Bunnell, FL 32110 Phone: (386) 313-4160   FAX: (386) 313-4161";
                    }
                    catch
                    { }

                    curtaxhis = exempt + "~" + exempt_amount + "~" + milage_code + "~" + EscrowCode + "~" + Item + "~" + tax_type + "~" + Total_taxes + "~" + Amount_Paid + "~" + date_paid + "~" + Receipt + "~" + Transaction + "~" + tax_authority;
                    gc.insert_date(orderNumber, Parcel_ID, 1299, curtaxhis, 1, DateTime.Now);
                    TaxTime = DateTime.Now.ToString("HH:mm:ss");

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

                    driver.Quit();
                    gc.mergpdf(orderNumber, "FL", "Flagler");
                    return("Data Inserted Successfully");
                }
                catch (Exception ex)
                {
                    driver.Quit();
                    GlobalClass.LogError(ex, orderNumber);
                    throw;
                }
            }
        }
Esempio n. 8
0
        public string FTP_LAEastBatonRouge(string houseno, string sname, string sttype, string parcelNumber, string searchType, string orderNumber, string ownername, string directParcel)
        {
            GlobalClass.global_orderNo             = orderNumber;
            HttpContext.Current.Session["orderNo"] = orderNumber;
            GlobalClass.global_parcelNo            = parcelNumber;

            string StartTime = "", AssessmentTime = "", TaxTime = "", CitytaxTime = "", LastEndTime = "";

            var driverService = PhantomJSDriverService.CreateDefaultService();

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

                    if (searchType == "titleflex")
                    {
                        string address = houseno + " " + sname + " " + sttype;
                        gc.TitleFlexSearch(orderNumber, parcelNumber, "", address, "LA", "East Baton Rouge");
                        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["EastbatonLA_NoRecord"] = "Yes";
                            driver.Quit();
                            return("No Data Found");
                        }
                        parcelNumber = HttpContext.Current.Session["titleparcel"].ToString();
                        searchType   = "parcel";
                    }

                    driver.Navigate().GoToUrl("http://www.ebrpa.org/PageDisplay.asp?p1=1503");
                    Thread.Sleep(2000);
                    IWebElement iframeElement = null;
                    try
                    {
                        iframeElement = driver.FindElement(By.XPath("/html/body/center/div[2]/table/tbody/tr/td[2]/table/tbody/tr/td/table/tbody/tr[2]/td/font/div[1]/iframe"));
                    }
                    catch { }
                    try
                    {
                        if (iframeElement == null)
                        {
                            iframeElement = driver.FindElement(By.XPath("//*[@id='single-blocks']/div[2]/div[2]/div/div/div/div/div/iframe"));
                        }
                    }
                    catch { }
                    Thread.Sleep(2000);
                    driver.SwitchTo().Frame(iframeElement);
                    //if (searchType == "address")
                    //{
                    //    //driver.Navigate().GoToUrl("http://www.ebrpa.org/PageDisplay.asp?p1=1503");
                    //    //Thread.Sleep(2000);

                    //    //IWebElement iframeElement = driver.FindElement(By.XPath("/html/body/center/div[2]/table/tbody/tr/td[2]/table/tbody/tr/td/table/tbody/tr[2]/td/font/div[1]/iframe"));
                    //    //Thread.Sleep(2000);
                    //    driver.SwitchTo().Frame(iframeElement);

                    //    driver.FindElement(By.XPath("/html/body/div[2]/div/div[3]/div/div/form/input[3]")).Click();
                    //    Thread.Sleep(2000);
                    //    driver.FindElement(By.XPath("/html/body/div[2]/div/div[3]/div/div/form/div[2]/div/input[1]")).SendKeys(houseno);
                    //    driver.FindElement(By.XPath("/html/body/div[2]/div/div[3]/div/div/form/div[2]/div/input[2]")).SendKeys(sname);

                    //    driver.FindElement(By.XPath("/html/body/div[2]/div/div[3]/div/div/form/div[5]/button")).Click();
                    //    Thread.Sleep(2000);
                    //    //Screen-Shot
                    //    gc.CreatePdf_WOP(orderNumber, "AddressSearch", driver, "LA", "East Baton Rouge");


                    //    //MultiParcel
                    //    IWebElement MultiParcelTable = driver.FindElement(By.XPath("/html/body/div[2]/div/div[3]/div/div/table/tbody"));
                    //    IList<IWebElement> MultiParcelTR = MultiParcelTable.FindElements(By.TagName("tr"));

                    //    if (MultiParcelTR.Count == 1)
                    //    {
                    //        NavigateUrl(driver);
                    //    }
                    //    else
                    //    {
                    //        try
                    //        {
                    //            string no = driver.FindElement(By.XPath("//*[@id='ng-view']/div/div")).Text;
                    //            if (no.Contains("No results found"))
                    //            {
                    //                HttpContext.Current.Session["EastbatonLA_NoRecord"] = "Yes";
                    //                driver.Quit();
                    //                return "No Data Found";
                    //            }
                    //        }
                    //        catch
                    //        {

                    //        }

                    //        IList<IWebElement> MultiParcelTD;
                    //        foreach (IWebElement multi in MultiParcelTR)
                    //        {
                    //            MultiParcelTD = multi.FindElements(By.TagName("td"));
                    //            if (MultiParcelTD.Count != 0)
                    //            {
                    //                parcelNumber = MultiParcelTD[0].Text;
                    //                Ownername = MultiParcelTD[1].Text;
                    //                Physicaladdrerss = MultiParcelTD[2].Text;
                    //                Multidata = Ownername + "~" + Physicaladdrerss;
                    //                gc.insert_date(orderNumber, parcelNumber, 177, Multidata, 1, DateTime.Now);
                    //            }
                    //            HttpContext.Current.Session["multiParcel_LAEastBatonRouge"] = "Yes";
                    //        }

                    //        if (MultiParcelTR.Count > 25)
                    //        {
                    //            HttpContext.Current.Session["multiParcel_LAEastBatonRouge_Multicount"] = "Maximum";
                    //        }
                    //        driver.Quit();
                    //        return "MultiParcel";
                    //    }
                    //}

                    //else if (searchType == "parcel")
                    //{
                    //    driver.Navigate().GoToUrl("http://www.ebrpa.org/PageDisplay.asp?p1=1503");
                    //    Thread.Sleep(2000);

                    //    IWebElement iframeElement = driver.FindElement(By.XPath("/html/body/center/div[2]/table/tbody/tr/td[2]/table/tbody/tr/td/table/tbody/tr[2]/td/font/div[1]/iframe"));
                    //    driver.SwitchTo().Frame(iframeElement);

                    //    driver.FindElement(By.XPath("/html/body/div[2]/div/div[3]/div/div/form/input[1]")).Click();
                    //    Thread.Sleep(2000);
                    //    driver.FindElement(By.XPath("/html/body/div[2]/div/div[3]/div/div/form/input[7]")).SendKeys(parcelNumber);
                    //    gc.CreatePdf(orderNumber, parcelNumber, "ParcelSearch", driver, "LA", "East Baton Rouge");
                    //    driver.FindElement(By.XPath("/html/body/div[2]/div/div[3]/div/div/form/div[5]/button")).Click();
                    //    Thread.Sleep(2000);

                    //    driver.FindElement(By.XPath("/html/body/div[2]/div/div[3]/div/div/table/tbody/tr/td[4]/a")).Click();
                    //    Thread.Sleep(3000);
                    //    NavigateUrl(driver);
                    //}

                    //else if (searchType == "ownername")
                    //{
                    //    driver.Navigate().GoToUrl("http://www.ebrpa.org/PageDisplay.asp?p1=1503");
                    //    Thread.Sleep(2000);

                    //    IWebElement iframeElement = driver.FindElement(By.XPath("/html/body/center/div[2]/table/tbody/tr/td[2]/table/tbody/tr/td/table/tbody/tr[2]/td/font/div[1]/iframe"));
                    //    driver.SwitchTo().Frame(iframeElement);

                    //    driver.FindElement(By.XPath("/html/body/div[2]/div/div[3]/div/div/form/input[2]")).Click();
                    //    Thread.Sleep(2000);
                    //    driver.FindElement(By.XPath("/html/body/div[2]/div/div[3]/div/div/form/input[7]")).SendKeys(ownername);
                    //    gc.CreatePdf(orderNumber, parcelNumber, "ParcelSearch", driver, "LA", "East Baton Rouge");
                    //    driver.FindElement(By.XPath("/html/body/div[2]/div/div[3]/div/div/form/div[5]/button")).Click();
                    //    Thread.Sleep(2000);
                    //    gc.CreatePdf(orderNumber, outparcelno, "Property_Search", driver, "LA", "East Baton Rouge");
                    //    //MultiParcel
                    //    IWebElement MultiParcelTable = driver.FindElement(By.XPath("/html/body/div[2]/div/div[3]/div/div/table/tbody"));
                    //    IList<IWebElement> MultiParcelTR = MultiParcelTable.FindElements(By.TagName("tr"));

                    //    if (MultiParcelTR.Count == 1)
                    //    {
                    //        NavigateUrl(driver);
                    //    }
                    //    else
                    //    {
                    //        IList<IWebElement> MultiParcelTD;
                    //        foreach (IWebElement multi in MultiParcelTR)
                    //        {
                    //            MultiParcelTD = multi.FindElements(By.TagName("td"));
                    //            if (MultiParcelTD.Count != 0)
                    //            {
                    //                parcelNumber = MultiParcelTD[0].Text;
                    //                Ownername = MultiParcelTD[1].Text;
                    //                Physicaladdrerss = MultiParcelTD[2].Text;
                    //                Multidata = Ownername + "~" + Physicaladdrerss;
                    //                gc.insert_date(orderNumber, parcelNumber, 177, Multidata, 1, DateTime.Now);
                    //            }
                    //        }

                    //        HttpContext.Current.Session["multiParcel_LAEastBatonRouge"] = "Yes";
                    //        if (MultiParcelTR.Count > 25)
                    //        {
                    //            HttpContext.Current.Session["multiParcel_LAEastBatonRouge_Multicount"] = "Maximum";
                    //        }
                    //        driver.Quit();
                    //        return "MultiParcel";
                    //    }

                    //}
                    if (searchType == "address")
                    {
                        driver.FindElement(By.XPath("//*[@id='ng-view']/div/form/input[3]")).Click();
                        Thread.Sleep(2000);
                        driver.FindElement(By.XPath("//*[@id='ng-view']/div/form/div[2]/div/input[1]")).SendKeys(houseno);
                        driver.FindElement(By.XPath("//*[@id='ng-view']/div/form/div[2]/div/input[2]")).SendKeys(sname);
                        gc.CreatePdf_WOP(orderNumber, "Address Search", driver, "LA", "East Baton Rouge");
                        driver.FindElement(By.XPath("//*[@id='ng-view']/div/form/div[5]/button")).Click();
                        Thread.Sleep(2000);
                        //Screen-Shot
                        gc.CreatePdf_WOP(orderNumber, "Address Search Result", driver, "LA", "East Baton Rouge");


                        //MultiParcel
                        IWebElement         MultiParcelTable = driver.FindElement(By.XPath("//*[@id='ng-view']/div/table/tbody"));
                        IList <IWebElement> MultiParcelTR    = MultiParcelTable.FindElements(By.TagName("tr"));

                        if (MultiParcelTR.Count == 1)
                        {
                            NavigateUrl(driver);
                        }
                        else
                        {
                            try
                            {
                                string no = driver.FindElement(By.XPath("//*[@id='ng-view']/div/div")).Text;
                                if (no.Contains("No results found"))
                                {
                                    HttpContext.Current.Session["EastbatonLA_NoRecord"] = "Yes";
                                    driver.Quit();
                                    return("No Data Found");
                                }
                            }
                            catch
                            {
                            }

                            IList <IWebElement> MultiParcelTD;
                            foreach (IWebElement multi in MultiParcelTR)
                            {
                                MultiParcelTD = multi.FindElements(By.TagName("td"));
                                if (MultiParcelTD.Count != 0)
                                {
                                    parcelNumber     = MultiParcelTD[0].Text;
                                    Ownername        = MultiParcelTD[1].Text;
                                    Physicaladdrerss = MultiParcelTD[2].Text;
                                    Multidata        = Ownername + "~" + Physicaladdrerss;
                                    gc.insert_date(orderNumber, parcelNumber, 177, Multidata, 1, DateTime.Now);
                                }
                                HttpContext.Current.Session["multiParcel_LAEastBatonRouge"] = "Yes";
                            }

                            if (MultiParcelTR.Count > 25)
                            {
                                HttpContext.Current.Session["multiParcel_LAEastBatonRouge_Multicount"] = "Maximum";
                            }
                            driver.Quit();
                            return("MultiParcel");
                        }
                    }

                    else if (searchType == "parcel")
                    {
                        //driver.Navigate().GoToUrl("http://www.ebrpa.org/PageDisplay.asp?p1=1503");
                        //Thread.Sleep(2000);

                        //IWebElement iframeElement = driver.FindElement(By.XPath("/html/body/center/div[2]/table/tbody/tr/td[2]/table/tbody/tr/td/table/tbody/tr[2]/td/font/div[1]/iframe"));
                        //driver.SwitchTo().Frame(iframeElement);

                        driver.FindElement(By.XPath("//*[@id='ng-view']/div/form/input[1]")).Click();
                        Thread.Sleep(2000);
                        driver.FindElement(By.XPath("//*[@id='ng-view']/div/form/input[7]")).SendKeys(parcelNumber);
                        gc.CreatePdf(orderNumber, parcelNumber, "ParcelSearch", driver, "LA", "East Baton Rouge");
                        driver.FindElement(By.XPath("//*[@id='ng-view']/div/form/div[5]/button")).Click();
                        Thread.Sleep(2000);

                        driver.FindElement(By.XPath("//*[@id='ng-view']/div/table/tbody/tr/td[4]/a")).Click();
                        Thread.Sleep(3000);
                        NavigateUrl(driver);
                    }

                    else if (searchType == "ownername")
                    {
                        //driver.Navigate().GoToUrl("http://www.ebrpa.org/PageDisplay.asp?p1=1503");
                        //Thread.Sleep(2000);

                        //IWebElement iframeElement = driver.FindElement(By.XPath("/html/body/center/div[2]/table/tbody/tr/td[2]/table/tbody/tr/td/table/tbody/tr[2]/td/font/div[1]/iframe"));
                        //driver.SwitchTo().Frame(iframeElement);

                        driver.FindElement(By.XPath("//*[@id='ng-view']/div/form/input[2]")).Click();
                        Thread.Sleep(2000);
                        driver.FindElement(By.XPath("//*[@id='ng-view']/div/form/input[7]")).SendKeys(ownername);
                        gc.CreatePdf(orderNumber, parcelNumber, "ParcelSearch", driver, "LA", "East Baton Rouge");
                        driver.FindElement(By.XPath("//*[@id='ng-view']/div/form/div[5]/button")).Click();
                        Thread.Sleep(2000);
                        gc.CreatePdf(orderNumber, outparcelno, "Property_Search", driver, "LA", "East Baton Rouge");
                        //MultiParcel
                        IWebElement         MultiParcelTable = driver.FindElement(By.XPath("//*[@id='ng-view']/div/table/tbody"));
                        IList <IWebElement> MultiParcelTR    = MultiParcelTable.FindElements(By.TagName("tr"));

                        if (MultiParcelTR.Count == 1)
                        {
                            NavigateUrl(driver);
                        }
                        else
                        {
                            IList <IWebElement> MultiParcelTD;
                            foreach (IWebElement multi in MultiParcelTR)
                            {
                                MultiParcelTD = multi.FindElements(By.TagName("td"));
                                if (MultiParcelTD.Count != 0)
                                {
                                    parcelNumber     = MultiParcelTD[0].Text;
                                    Ownername        = MultiParcelTD[1].Text;
                                    Physicaladdrerss = MultiParcelTD[2].Text;
                                    Multidata        = Ownername + "~" + Physicaladdrerss;
                                    gc.insert_date(orderNumber, parcelNumber, 177, Multidata, 1, DateTime.Now);
                                }
                            }

                            HttpContext.Current.Session["multiParcel_LAEastBatonRouge"] = "Yes";
                            if (MultiParcelTR.Count > 25)
                            {
                                HttpContext.Current.Session["multiParcel_LAEastBatonRouge_Multicount"] = "Maximum";
                            }
                            driver.Quit();
                            return("MultiParcel");
                        }
                    }

                    //Scrapped Data

                    //Property Deatails
                    outparcelno = driver.FindElement(By.XPath("/html/body/div[3]/div/div[1]/span[2]")).Text;
                    OwnerName   = driver.FindElement(By.XPath("/html/body/div[3]/div/div[2]/div/span[2]")).Text;
                    if (OwnerName.Contains("\r\n"))
                    {
                        OwnerName = OwnerName.Replace("\r\n", ",");
                    }
                    Mailingaddress = driver.FindElement(By.XPath("/html/body/div[3]/div/div[3]/div/span")).Text;
                    if (Mailingaddress.Contains("\r\n"))
                    {
                        Mailingaddress = Mailingaddress.Replace("\r\n", ",");
                    }
                    Property_Type   = driver.FindElement(By.XPath("/html/body/div[3]/div/div[5]/div/span")).Text;
                    Propertyaddress = driver.FindElement(By.XPath("/html/body/div[3]/div/div[7]/div/span[2]")).Text;
                    if (Propertyaddress.Contains("\r\n"))
                    {
                        Propertyaddress = Propertyaddress.Replace("\r\n", ",");
                    }
                    gc.CreatePdf(orderNumber, outparcelno, "Assement", driver, "LA", "East Baton Rouge");

                    //Assessment Details
                    //string year = driver.FindElement(By.XPath("/html/body/div[2]/div/span[1]")).Text;
                    //IWebElement TBAssess = driver.FindElement(By.XPath("/html/body/div[3]/div/div[8]/table/tbody"));
                    string year = "";
                    try
                    {
                        year = driver.FindElement(By.XPath("/html/body/div[2]/div/span")).Text.Replace("Assessment Listing", "").Trim();
                    }
                    catch { }
                    IWebElement         TBAssess = driver.FindElement(By.XPath("//*[@id='parcelDetails']/div[8]/table/tbody"));
                    IList <IWebElement> TRAssess = TBAssess.FindElements(By.TagName("tr"));
                    IList <IWebElement> TDAssess;
                    foreach (IWebElement assess in TRAssess)
                    {
                        TDAssess = assess.FindElements(By.TagName("td"));
                        if (TDAssess.Count != 0)
                        {
                            Property_class   = TDAssess[0].Text;
                            AssedValues      = TDAssess[1].Text;
                            Units            = TDAssess[2].Text;
                            Homestead        = TDAssess[3].Text;
                            Assement_details = year + "~" + Property_class + "~" + AssedValues + "~" + Units + "~" + Homestead;
                            gc.insert_date(orderNumber, outparcelno, 198, Assement_details, 1, DateTime.Now);
                        }
                    }
                    AssessmentTime = DateTime.Now.ToString("HH:mm:ss");

                    //TaxDistribution Details
                    //IWebElement TBTax = driver.FindElement(By.XPath("/html/body/div[3]/div/div[11]/table/tbody"));
                    IWebElement         TBTax = driver.FindElement(By.XPath("//*[@id='parcelDetails']/div[11]/table/tbody"));
                    IList <IWebElement> TRTax = TBTax.FindElements(By.TagName("tr"));
                    IList <IWebElement> TDTax;
                    foreach (IWebElement tax in TRTax)
                    {
                        TDTax = tax.FindElements(By.TagName("td"));
                        if (TDTax.Count != 0)
                        {
                            Millage                = TDTax[0].Text;
                            Mills                  = TDTax[1].Text;
                            Tax                    = TDTax[2].Text;
                            Homestead_Tax          = TDTax[3].Text;
                            TaxDistributionDetails = Millage + "~" + Mills + "~" + Tax + "~" + Homestead_Tax;
                            gc.insert_date(orderNumber, outparcelno, 201, TaxDistributionDetails, 1, DateTime.Now);
                        }
                    }

                    amc.TaxId = outparcelno;
                    //TaxInformation Details
                    driver.Navigate().GoToUrl("http://snstaxpayments.com/ebr");
                    Thread.Sleep(2000);

                    driver.FindElement(By.Id("submit")).SendKeys(Keys.Enter);
                    Thread.Sleep(2000);

                    driver.FindElement(By.XPath("/html/body/div[1]/div[3]/form/div/div/div[1]/div[2]/label/input")).Click();
                    Thread.Sleep(2000);
                    driver.FindElement(By.Id("searchFor1")).SendKeys(outparcelno);
                    gc.CreatePdf(orderNumber, outparcelno, "Tax", driver, "LA", "East Baton Rouge");
                    driver.FindElement(By.Id("searchButton")).SendKeys(Keys.Enter);
                    Thread.Sleep(2000);
                    gc.CreatePdf(orderNumber, outparcelno, "View", driver, "LA", "East Baton Rouge");

                    IWebElement         SelectOption = driver.FindElement(By.Id("taxyear"));
                    IList <IWebElement> Select       = SelectOption.FindElements(By.TagName("option"));
                    List <string>       option       = new List <string>();
                    int Check = 0;
                    foreach (IWebElement Op in Select)
                    {
                        if (Check <= 2)
                        {
                            option.Add(Op.Text);
                            Check++;
                        }
                    }
                    int amccount = 0;
                    foreach (string item in option)
                    {
                        var SelectAddress    = driver.FindElement(By.Id("taxyear"));
                        var SelectAddressTax = new SelectElement(SelectAddress);
                        SelectAddressTax.SelectByText(item);
                        Thread.Sleep(4000);
                        driver.FindElement(By.Id("searchButton")).SendKeys(Keys.Enter);
                        Thread.Sleep(4000);

                        try
                        {
                            driver.FindElement(By.XPath("/html/body/div[1]/div[3]/div[3]/table/tbody/tr/td[1]/button")).Click();
                            Thread.Sleep(7000);
                        }
                        catch
                        { }

                        gc.CreatePdf(orderNumber, outparcelno, "Popup 2015", driver, "LA", "East Baton Rouge");

                        //Open Popup
                        try
                        {
                            Notice = driver.FindElement(By.XPath("/html/body/div[5]/div[2]/div/div/div[3]/div[1]")).Text;
                            Notice = WebDriverTest.After(Notice, "Tax Notice#");

                            Taxyear     = driver.FindElement(By.XPath("/html/body/div[5]/div[2]/div/div/div[3]/div[2]")).Text;
                            Taxyear     = WebDriverTest.After(Taxyear, "Tax Year");
                            amc.TaxYear = Taxyear;

                            TaxPayer = driver.FindElement(By.XPath("/html/body/div[5]/div[2]/div/div/div[4]")).Text;
                            TaxPayer = WebDriverTest.Between(TaxPayer, "Taxpayer", "**** ").Replace("\r\n", " ").Trim();

                            IWebElement         TBOpen    = driver.FindElement(By.XPath("/html/body/div[5]/div[2]/div/div/div[5]"));
                            IList <IWebElement> DivMaster = TBOpen.FindElements(By.TagName("div"));
                            foreach (IWebElement div in DivMaster)
                            {
                                Taxes    = DivMaster[0].Text.Trim();
                                Interest = DivMaster[1].Text.Trim();
                                Cost     = DivMaster[2].Text.Trim();
                                Other    = DivMaster[3].Text.Trim();
                                Paid     = DivMaster[4].Text.Trim();
                                Balance  = DivMaster[5].Text.Trim();
                            }
                            try
                            {
                                IWebElement ITaxsale = driver.FindElement(By.XPath("//*[@id='details']/div[5]"));
                                if (ITaxsale.Text.Contains("Tax Sale Status: "))
                                {
                                    amc.IsDelinquent = "Yes";
                                }
                                double TaxesAmount = 0.00, InterestAmount = 0.00, CostAmount = 0.00, OtherAmount = 0.00, PaidAmount = 0.00, BalanceAmount = 0.00;

                                TaxesAmount    = Convert.ToDouble(Taxes.Replace("Taxes\r\n", "").Trim());
                                InterestAmount = Convert.ToDouble(Interest.Replace("Interest\r\n", "").Trim());
                                PaidAmount     = Convert.ToDouble(Paid.Replace("Paid\r\n", "").Trim());
                                CostAmount     = Convert.ToDouble(Cost.Replace("Cost\r\n", "").Trim());
                                OtherAmount    = Convert.ToDouble(Other.Replace("Other\r\n", "").Trim());
                                BalanceAmount  = Convert.ToDouble(Balance.Replace("Balance\r\n", "").Trim());


                                if (TaxesAmount != 0 && InterestAmount == 0 && CostAmount == 0 && OtherAmount == 0 && PaidAmount != 0 && BalanceAmount == 0)
                                {
                                    amc.Instamount1     = Taxes.Replace("Taxes\r\n", "").Trim();
                                    amc.Instamountpaid1 = Paid.Replace("Paid\r\n", "").Trim();
                                    amc.InstPaidDue1    = "Paid";
                                    amc.IsDelinquent    = "No";
                                }
                                else if (TaxesAmount != 0 && InterestAmount == 0 && CostAmount == 0 && OtherAmount == 0 && PaidAmount == 0 && BalanceAmount != 0 && TaxesAmount == BalanceAmount)
                                {
                                    amc.Instamount1     = Taxes.Replace("Taxes\r\n", "").Trim();
                                    amc.Instamountpaid1 = Balance.Replace("Balance\r\n", "").Trim();
                                    amc.InstPaidDue1    = "Due";
                                    amc.IsDelinquent    = "No";
                                }
                                else if (TaxesAmount != 0 && InterestAmount != 0 && ((CostAmount != 0 || CostAmount == 0) && (OtherAmount == 0 || OtherAmount != 0)) && PaidAmount == 0 && BalanceAmount != 0 && TaxesAmount < BalanceAmount)
                                {
                                    amc.IsDelinquent = "Yes";
                                }
                                else if (TaxesAmount != 0 && InterestAmount != 0 && ((CostAmount != 0 || CostAmount == 0) && (OtherAmount == 0 || OtherAmount != 0)) && PaidAmount != 0 && BalanceAmount == 0 && TaxesAmount < PaidAmount)
                                {
                                    amc.IsDelinquent = "Yes";
                                }
                            }
                            catch { }


                            if (Interest.Replace("Interest\r\n", "") != "0.00" && Balance.Replace("Balance\r\n", "") != "0.00")
                            {
                                Deliquent_Interest      = Interest;
                                Deliquent_Balance       = Balance;
                                Interest                = "";
                                Balance                 = "";
                                DeliquentTaxInformation = Notice + "~" + Taxyear + "~" + TaxPayer + "~" + Taxes.Replace("Taxes\r\n", "") + "~" + Interest.Replace("Interest\r\n", "") + "~" + Cost.Replace("Cost\r\n", "") + "~" + Other.Replace("Other\r\n", "") + "~" + Paid.Replace("Paid\r\n", "") + "~" + Balance.Replace("Balance\r\n", "") + "~" + Deliquent_Interest.Replace("Interest\r\n", "") + "~" + Deliquent_Balance.Replace("Balance\r\n", "");
                                gc.insert_date(orderNumber, outparcelno, 203, DeliquentTaxInformation, 1, DateTime.Now);
                            }
                            else
                            {
                                string TaxInformation = Notice + "~" + Taxyear + "~" + TaxPayer + "~" + Taxes.Replace("Taxes\r\n", "") + "~" + Interest.Replace("Interest\r\n", "") + "~" + Cost.Replace("Cost\r\n", "") + "~" + Other.Replace("Other\r\n", "") + "~" + Paid.Replace("Paid\r\n", "") + "~" + Balance.Replace("Balance\r\n", "") + "~" + Deliquent_Interest.Replace("Interest\r\n", "") + "~" + Deliquent_Balance.Replace("Balance\r\n", "");
                                gc.insert_date(orderNumber, outparcelno, 203, TaxInformation, 1, DateTime.Now);
                            }

                            Legal_Description = driver.FindElement(By.XPath("//*[@id='details']/div[7]")).Text.Replace("Legal", "");

                            if (amccount < 1)
                            {
                                if (amc.IsDelinquent == "Yes")
                                {
                                    gc.InsertAmrockTax(orderNumber, amc.TaxId, null, null, null, null, null, null, null, null, null, null, null, null, amc.IsDelinquent);
                                    amccount++;
                                }

                                if (amc.IsDelinquent == "No")
                                {
                                    gc.InsertAmrockTax(orderNumber, amc.TaxId, amc.Instamount1, amc.Instamount2, amc.Instamount3, amc.Instamount4, amc.Instamountpaid1, amc.Instamountpaid2, amc.Instamountpaid3, amc.Instamountpaid4, amc.InstPaidDue1, amc.InstPaidDue2, amc.instPaidDue3, amc.instPaidDue4, amc.IsDelinquent);
                                    amccount++;
                                }
                            }

                            //Tax History
                            IWebElement         TBHistory = driver.FindElement(By.XPath("/html/body/div[5]/div[2]/div/div/div[9]/table/tbody"));
                            IList <IWebElement> TRHistory = TBHistory.FindElements(By.TagName("tr"));
                            IList <IWebElement> TDHistory;
                            foreach (IWebElement History in TRHistory)
                            {
                                TDHistory = History.FindElements(By.TagName("td"));
                                if (TDHistory.Count != 0)
                                {
                                    Date        = TDHistory[0].Text;
                                    Description = TDHistory[1].Text;
                                    Amount      = TDHistory[2].Text;
                                    TaxHistory  = Date + "~" + Description + "~" + Amount;
                                    gc.insert_date(orderNumber, outparcelno, 202, TaxHistory, 1, DateTime.Now);
                                }
                            }

                            IWebElement ITax = driver.FindElement(By.XPath("//*[@id='details']/div[2]/a"));
                            strTax = ITax.GetAttribute("href");
                            Thread.Sleep(5000);
                            driver.Navigate().GoToUrl(strTax);
                            Actions action = new Actions(driver);
                            action.SendKeys(Keys.Escape).Build().Perform();
                            gc.CreatePdf(orderNumber, outparcelno, "Bill 2015", driver, "LA", "East Baton Rouge");
                            driver.Navigate().Back();
                            Thread.Sleep(2000);
                        }
                        catch
                        { }
                    }
                    try
                    {
                        for (int k = 1; k < 4; k++)
                        {
                            if (k == 1)
                            {
                                try
                                {
                                    var SelectAddress2017    = driver.FindElement(By.Id("taxyear"));
                                    var SelectAddressTax2017 = new SelectElement(SelectAddress2017);
                                    SelectAddressTax2017.SelectByIndex(0);
                                    Thread.Sleep(4000);
                                    driver.FindElement(By.Id("searchButton")).SendKeys(Keys.Enter);
                                    Thread.Sleep(4000);
                                    gc.CreatePdf(orderNumber, outparcelno, "View1", driver, "LA", "East Baton Rouge");
                                    driver.FindElement(By.XPath("/html/body/div[1]/div[3]/div[3]/table/tbody/tr/td[1]/button")).Click();
                                    Thread.Sleep(5000);

                                    IWebElement ITax = driver.FindElement(By.XPath("//*[@id='details']/div[2]/a"));
                                    strTax = ITax.GetAttribute("href");
                                    Thread.Sleep(5000);
                                    driver.Navigate().GoToUrl(strTax);
                                    Actions action = new Actions(driver);
                                    action.SendKeys(Keys.Escape).Build().Perform();
                                    gc.CreatePdf(orderNumber, outparcelno, "Bill 2017", driver, "LA", "East Baton Rouge");
                                    driver.Navigate().Back();
                                    Thread.Sleep(2000);
                                }
                                catch
                                { }
                            }
                            else if (k == 2)
                            {
                                try
                                {
                                    var SelectAddress2016    = driver.FindElement(By.Id("taxyear"));
                                    var SelectAddressTax2016 = new SelectElement(SelectAddress2016);
                                    SelectAddressTax2016.SelectByIndex(1);
                                    Thread.Sleep(4000);
                                    driver.FindElement(By.Id("searchButton")).SendKeys(Keys.Enter);
                                    Thread.Sleep(4000);
                                    gc.CreatePdf(orderNumber, outparcelno, "View2", driver, "LA", "East Baton Rouge");
                                    driver.FindElement(By.XPath("/html/body/div[1]/div[3]/div[3]/table/tbody/tr/td[1]/button")).Click();
                                    Thread.Sleep(5000);

                                    IWebElement ITax = driver.FindElement(By.XPath("//*[@id='details']/div[2]/a"));
                                    strTax = ITax.GetAttribute("href");
                                    Thread.Sleep(5000);
                                    driver.Navigate().GoToUrl(strTax);
                                    Actions action = new Actions(driver);
                                    action.SendKeys(Keys.Escape).Build().Perform();
                                    gc.CreatePdf(orderNumber, outparcelno, "Bill 2016", driver, "LA", "East Baton Rouge");
                                    driver.Close();
                                }
                                catch
                                { }
                            }
                        }
                    }
                    catch
                    { }

                    property_details = OwnerName + "~" + Propertyaddress + "~" + Mailingaddress + "~" + Property_Type + "~" + Legal_Description;
                    gc.insert_date(orderNumber, outparcelno, 197, property_details, 1, DateTime.Now);

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

                    LastEndTime = DateTime.Now.ToString("HH:mm:ss");
                    gc.insert_TakenTime(orderNumber, "LA", "East Baton Rouge", StartTime, AssessmentTime, TaxTime, CitytaxTime, LastEndTime);

                    driver.Quit();
                    //megrge pdf files
                    gc.mergpdf(orderNumber, "LA", "East Baton Rouge");
                    return("Data Inserted Successfully");
                }
                catch (Exception ex)
                {
                    driver.Quit();
                    GlobalClass.LogError(ex, orderNumber);
                    throw ex;
                }
            }
        }
Esempio n. 9
0
        public string FTP_CAFresno(string houseno, string sname, string parcelNumber, string ownername, string searchType, string orderNumber, string directParcel)
        {
            GlobalClass.global_orderNo             = orderNumber;
            HttpContext.Current.Session["orderNo"] = orderNumber;
            GlobalClass.global_parcelNo            = parcelNumber;
            var driverService = PhantomJSDriverService.CreateDefaultService();

            driverService.HideCommandPromptWindow = true;
            using (driver = new PhantomJSDriver())
            {
                try
                {
                    StartTime = DateTime.Now.ToString("HH:mm:ss");
                    if (searchType == "titleflex")
                    {
                        string address = houseno + " " + sname;
                        gc.TitleFlexSearch(orderNumber, parcelNumber, ownername, address, "CA", "Fresno");
                        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_CAFresno"] = "Zero";
                                driver.Quit();
                                return("No Data Found");
                            }
                            //string strTitleAssess = HttpContext.Current.Session["TitleFlexAssess"].ToString();
                            parcelNumber = HttpContext.Current.Session["titleparcel"].ToString();
                            //gc.insert_date(orderNumber, parcelNumber, 311, strTitleAssess, 1, DateTime.Now);
                            searchType     = "parcel";
                            AssessmentTime = DateTime.Now.ToString("HH:mm:ss");
                        }
                    }
                    if (searchType == "parcel")
                    {
                        ParcelSearch(orderNumber, parcelNumber);
                        IWebElement         ITaxTable = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr/td/form/table/tbody/tr[6]/td/table/tbody"));
                        IList <IWebElement> Itaxrow   = ITaxTable.FindElements(By.TagName("input"));
                        foreach (IWebElement row in Itaxrow)
                        {
                            Itaxtd = row.FindElements(By.TagName("input"));
                            string strValue = row.GetAttribute("value");
                            if (strValue == "View Tax Info" || strValue == "View Payment Info")
                            {
                                string strSearch = row.GetAttribute("onclick");
                                if (strSearch != "" && strSearch.Contains("SecuredDetails") || strSearch.Contains("SupplementalDetails") || strSearch.Contains("SecuredDelinquentOptions"))
                                {
                                    if (strSearch.Contains("SecuredDetails"))
                                    {
                                        string strSplitUrl = WebDriverTest.Between(strSearch, "window.location='", "'");
                                        string strUrl      = "https://www2.co.fresno.ca.us/0410/fresnottcpaymentapplication/" + strSplitUrl + "";
                                        strSecured.Add(strUrl);
                                    }
                                    if (strSearch.Contains("SupplementalDetails"))
                                    {
                                        string strSplitUrl = WebDriverTest.Between(strSearch, "window.location='", "'");
                                        string strUrl      = "https://www2.co.fresno.ca.us/0410/fresnottcpaymentapplication/" + strSplitUrl + "";
                                        strSecured.Add(strUrl);
                                    }
                                    if (strSearch.Contains("SecuredDelinquentOptions"))
                                    {
                                        string strSplitUrl = WebDriverTest.Between(strSearch, "window.location='", "'");
                                        string strUrl      = "https://www2.co.fresno.ca.us/0410/fresnottcpaymentapplication/" + strSplitUrl + "";
                                        strSecured.Add(strUrl);
                                    }
                                }
                            }
                        }
                        foreach (string URL in strSecured)
                        {
                            driver.Navigate().GoToUrl(URL);
                            if (URL.Contains("SecuredDetails"))
                            {
                                Thread.Sleep(3000);
                                TaxDetais(orderNumber, strparcelNumber, "Secured Property Tax");
                            }
                            if (URL.Contains("SupplementalDetails"))
                            {
                                Thread.Sleep(3000);
                                TaxDetais(orderNumber, strparcelNumber, "Supplemental Property Tax(s)");
                            }
                            if (URL.Contains("SecuredDelinquentOptions"))
                            {
                                Thread.Sleep(3000);
                                TaxDetais(orderNumber, strparcelNumber, "Secured Delinquent Property Tax(s)");
                            }
                        }
                    }
                    HttpContext.Current.Session["titleparcel"] = null;
                    TaxTime = DateTime.Now.ToString("HH:mm:ss");

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


                    driver.Quit();
                    gc.mergpdf(orderNumber, "CA", "Fresno");
                    return("Data Inserted Successfully");
                }
                catch (Exception ex)
                {
                    driver.Quit();
                    throw ex;
                }
            }
        }
Esempio n. 10
0
        public string FTP_Cowlitz(string streetno, string direction, string streetname, string streettype, string parcelNumber, string ownername, string searchType, string orderNumber, string directParcel, string unitnumber)
        {
            GlobalClass.global_orderNo             = orderNumber;
            HttpContext.Current.Session["orderNo"] = orderNumber;
            GlobalClass.global_parcelNo            = parcelNumber;
            List <string> mcheck = new List <string>();

            string StartTime = "", AssessmentTime = "", TaxTime = "", CitytaxTime = "", LastEndTime = "";

            //driver = new c();
            //driver = new PhantomJSDriver();

            //var option = new ChromeOptions();
            //option.AddArgument("No-Sandbox");

            var driverService = PhantomJSDriverService.CreateDefaultService();

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

                    driver.Navigate().GoToUrl("http://www.cowlitzinfo.net/applications/cowlitzassessorparcelsearch/Default.aspx");
                    Thread.Sleep(3000);


                    if (searchType == "titleflex")
                    {
                        string address = "";
                        if (direction != "")
                        {
                            address = streetno + " " + streetname + " " + direction;
                        }
                        else
                        {
                            address = streetno + " " + streetname;
                        }
                        gc.TitleFlexSearch(orderNumber, parcelNumber, ownername, address.Trim(), "WA", "Cowlitz");
                        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["Cowlitz_Zero"] = "Zero";
                            driver.Quit();
                            return("No Data Found");
                        }
                        parcelNumber = HttpContext.Current.Session["titleparcel"].ToString().Replace("-", "");
                        searchType   = "parcel";
                    }


                    if (searchType == "address")
                    {
                        driver.FindElement(By.XPath("//*[@id='address_input_street_number']")).Click();
                        driver.FindElement(By.XPath("//*[@id='address_input_street_number']")).SendKeys(streetno);

                        driver.FindElement(By.XPath("//*[@id='address_input_street_name']")).Click();
                        driver.FindElement(By.XPath("//*[@id='address_input_street_name']")).SendKeys(streetname);

                        try
                        {
                            driver.FindElement(By.XPath("//*[@id='address_input_street_direction']")).SendKeys(direction);
                        }
                        catch
                        { }

                        gc.CreatePdf_WOP(orderNumber, "Address Search", driver, "WA", "Cowlitz");
                        driver.FindElement(By.Id("submit_input")).SendKeys(Keys.Enter);
                        Thread.Sleep(12000);
                        gc.CreatePdf_WOP(orderNumber, "Address Search Result", driver, "WA", "Cowlitz");

                        ChkMultiParcel = driver.FindElement(By.XPath("//*[@id='search-filter']/figure")).Text.Replace("\r\n", "");

                        if (ChkMultiParcel == "Search Results:1Sort By ")
                        {
                            driver.FindElement(By.XPath("//*[@id='properties_section']/div/a/div/div/div[2]/div/div[2]")).Click();
                            Thread.Sleep(10000);
                        }
                        else
                        {
                            try
                            {
                                int AddressmaxCheck = 0;

                                IWebElement         add_search   = driver.FindElement(By.XPath("//*[@id='properties_section']/div"));
                                IList <IWebElement> TRadd_search = add_search.FindElements(By.TagName("div"));
                                IList <IWebElement> TDadd_search;

                                foreach (IWebElement row in TRadd_search)
                                {
                                    if (AddressmaxCheck <= 25)
                                    {
                                        string addrerss1 = row.GetAttribute("class");
                                        if (addrerss1 == "info")
                                        {
                                            TDadd_search = row.FindElements(By.TagName("div"));
                                            if (TDadd_search.Count != 0)
                                            {
                                                parcelno = TDadd_search[0].Text;
                                                Pro_Id1  = TDadd_search[1].Text;
                                                Pro_Id1  = WebDriverTest.After(Pro_Id1, "Prop ID: ");
                                            }

                                            TDadd_search = row.FindElements(By.TagName("h3"));
                                            if (TDadd_search.Count != 0)
                                            {
                                                fulladdress = TDadd_search[0].Text;
                                            }

                                            multi_details = Pro_Id1 + "~" + fulladdress;
                                            gc.insert_date(orderNumber, parcelno, 815, multi_details, 1, DateTime.Now);
                                        }
                                        AddressmaxCheck++;
                                    }
                                }

                                if (TRadd_search.Count < 27)
                                {
                                    gc.CreatePdf_WOP(orderNumber, "Multi Address search result", driver, "WA", "Cowlitz");
                                    HttpContext.Current.Session["multiparcel_CowlitzWA"] = "Yes";
                                    driver.Quit();
                                    return("MultiParcel");
                                }
                                if (TRadd_search.Count >= 27)
                                {
                                    HttpContext.Current.Session["multiParcel_CowlitzWA_Multicount"] = "Maximum";
                                    driver.Quit();
                                    return("Maximum");
                                }
                            }
                            catch
                            { }
                        }

                        try
                        {
                            string Nodata = driver.FindElement(By.XPath("//*[@id='search-filter']/figure/h3")).Text;
                            if (Nodata.Contains("Search Results:"))
                            {
                                HttpContext.Current.Session["Cowlitz_Zero"] = "Zero";
                                driver.Quit();
                                return("No Data Found");
                            }
                        }
                        catch { }

                        //IWebElement add_search = driver.FindElement(By.XPath("//*[@id='ctl00_cphParcelSearch_gvSearchResults']/tbody"));
                        //IList<IWebElement> TRadd_search = add_search.FindElements(By.TagName("tr"));

                        //IList<IWebElement> TDadd_search;
                        //foreach (IWebElement row in TRadd_search)
                        //{
                        //    TDadd_search = row.FindElements(By.TagName("td"));
                        //    if (TRadd_search.Count > 2 && TDadd_search.Count != 0)
                        //    {
                        //        string straccount_no = TDadd_search[1].Text;
                        //        string parcel_no = TDadd_search[9].Text;
                        //        string Address_Details = TDadd_search[2].Text + " " + TDadd_search[3].Text + " " + TDadd_search[4].Text + " " + TDadd_search[5].Text + " " + TDadd_search[6].Text + " " + TDadd_search[7].Text;

                        //        gc.insert_date(orderNumber, parcel_no, 815, straccount_no + "~" + Address_Details, 1, DateTime.Now);
                        //    }
                        //    if (TRadd_search.Count == 2)
                        //    {
                        //        driver.FindElement(By.XPath("//*[@id='ctl00_cphParcelSearch_gvSearchResults']/tbody/tr[2]/td[1]/a")).SendKeys(Keys.Enter);
                        //        Thread.Sleep(5000);
                        //        break;
                        //    }
                        //}
                        //if (TRadd_search.Count < 27 && TRadd_search.Count > 2)
                        //{
                        //    gc.CreatePdf_WOP(orderNumber, "Multi Address search result", driver, "WA", "Cowlitz");
                        //    HttpContext.Current.Session["multiparcel_CowlitzWA"] = "Yes";
                        //    driver.Quit();
                        //    return "MultiParcel";
                        //}
                        //if (TRadd_search.Count >= 27 && TRadd_search.Count > 2)
                        //{
                        //    HttpContext.Current.Session["multiParcel_CowlitzWA_Multicount"] = "Maximum";
                        //    driver.Quit();
                        //    return "Maximum";
                        //}
                    }

                    if (searchType == "parcel")
                    {
                        driver.FindElement(By.Id("radSearchType_1")).Click();
                        Thread.Sleep(2000);

                        driver.FindElement(By.XPath("//*[@id='parcel_input']")).Click();
                        driver.FindElement(By.XPath("//*[@id='parcel_input']")).SendKeys(parcelNumber);
                        gc.CreatePdf(orderNumber, parcelNumber, "Parcel search", driver, "WA", "Cowlitz");
                        driver.FindElement(By.XPath("//*[@id='submit_input']")).SendKeys(Keys.Enter);
                        gc.CreatePdf(orderNumber, parcelNumber, "Parcel search result", driver, "WA", "Cowlitz");
                        Thread.Sleep(2000);

                        driver.FindElement(By.XPath("//*[@id='properties_section']/div/div/div/div[1]/a")).SendKeys(Keys.Enter);
                        Thread.Sleep(12000);

                        try
                        {
                            string Nodata = driver.FindElement(By.XPath("//*[@id='search-filter']/figure/h3")).Text;
                            if (Nodata.Contains("Search Results:"))
                            {
                                HttpContext.Current.Session["Cowlitz_Zero"] = "Zero";
                                driver.Quit();
                                return("No Data Found");
                            }
                        }
                        catch { }
                    }

                    try
                    {
                        // Property Details
                        Parcel_Id     = driver.FindElement(By.XPath("//*[@id='general_property_info']/dl/dd[1]")).Text;
                        Pro_Id        = driver.FindElement(By.XPath("//*[@id='general_property_info']/dl/dd[2]")).Text;
                        Jurisdiction  = driver.FindElement(By.XPath("//*[@id='general_property_info']/dl/dd[3]")).Text;
                        Acres         = driver.FindElement(By.XPath("//*[@id='general_property_info']/dl/dd[4]")).Text;
                        Township      = driver.FindElement(By.XPath("//*[@id='general_property_info']/dl/dd[7]")).Text;
                        Pro_Use       = driver.FindElement(By.XPath("//*[@id='general_property_info']/dl/dd[8]")).Text;
                        Neighberhood  = driver.FindElement(By.XPath("//*[@id='general_property_info']/dl/dd[9]")).Text;
                        Tax_Code      = driver.FindElement(By.XPath("//*[@id='general_property_info']/dl/dd[10]")).Text;
                        Exemptions    = driver.FindElement(By.XPath("//*[@id='general_property_info']/dl/dd[11]")).Text;
                        Leavy_Rate    = driver.FindElement(By.XPath("//*[@id='general_property_info']/dl/dt[12]")).Text;
                        Leavy_Rate    = WebDriverTest.Between(Leavy_Rate, "Rate = ", ")");
                        Primary_Owner = driver.FindElement(By.XPath("//*[@id='owner_info']/dl/dd[1]")).Text;
                        Address1      = driver.FindElement(By.XPath("//*[@id='owner_info']/dl/dd[2]")).Text;
                        Address2      = driver.FindElement(By.XPath("//*[@id='owner_info']/dl/dd[3]")).Text;

                        Address    = Address1 + " " + Address2;
                        Year_Built = driver.FindElement(By.XPath("//*[@id='property_detail_info']/dl/dd[1]")).Text;

                        gc.CreatePdf(orderNumber, parcelNumber, "Property Details", driver, "WA", "Cowlitz");
                        propertydetails = Primary_Owner + "~" + Address + "~" + Pro_Id + "~" + Jurisdiction + "~" + Acres + "~" + Township + "~" + Pro_Use + "~" + Neighberhood + "~" + Tax_Code + "~" + Exemptions + "~" + Leavy_Rate + "~" + Year_Built;
                        gc.insert_date(orderNumber, Parcel_Id, 763, propertydetails, 1, DateTime.Now);

                        //Assessment Details

                        IWebElement         AssessmentTB = driver.FindElement(By.XPath("//*[@id='assess_value_table']/table/tbody"));
                        IList <IWebElement> AssessmentTR = AssessmentTB.FindElements(By.TagName("tr"));
                        IList <IWebElement> AssessmentTD;

                        foreach (IWebElement Assessment in AssessmentTR)
                        {
                            AssessmentTD = Assessment.FindElements(By.TagName("td"));
                            if (AssessmentTD.Count != 0)
                            {
                                Asse_Year      = AssessmentTD[0].Text;
                                TaxPay_year    = AssessmentTD[1].Text;
                                Land_Value     = AssessmentTD[2].Text;
                                Impr_Value     = AssessmentTD[3].Text;
                                Totl_AsseValue = AssessmentTD[4].Text;
                                Notice_Value   = AssessmentTD[5].Text;

                                Assessment_details = Asse_Year + "~" + TaxPay_year + "~" + Land_Value + "~" + Impr_Value + "~" + Totl_AsseValue + "~" + Notice_Value;
                                gc.insert_date(orderNumber, Parcel_Id, 765, Assessment_details, 1, DateTime.Now);
                            }
                        }

                        gc.CreatePdf(orderNumber, parcelNumber, "Assessment Details", driver, "WA", "Cowlitz");

                        //Tax Payment Details

                        IWebElement         TaxPaymentTB = driver.FindElement(By.XPath("//*[@id='tax_value_table']/table/tbody"));
                        IList <IWebElement> TaxPaymentTR = TaxPaymentTB.FindElements(By.TagName("tr"));
                        IList <IWebElement> TaxPaymentTD;

                        foreach (IWebElement TaxPayment in TaxPaymentTR)
                        {
                            TaxPaymentTD = TaxPayment.FindElements(By.TagName("td"));
                            if (TaxPaymentTD.Count != 0)
                            {
                                Tax_Year     = TaxPaymentTD[0].Text;
                                Stmt_Id      = TaxPaymentTD[1].Text;
                                Taxes        = TaxPaymentTD[2].Text;
                                Assesments   = TaxPaymentTD[3].Text;
                                Totl_Charges = TaxPaymentTD[4].Text;
                                Totl_Paid    = TaxPaymentTD[5].Text;
                                Totl_Due     = TaxPaymentTD[6].Text;

                                TaxPayment_details = Tax_Year + "~" + Stmt_Id + "~" + Taxes + "~" + Assesments + "~" + Totl_Charges + "~" + Totl_Paid + "~" + Totl_Due;
                                gc.insert_date(orderNumber, Parcel_Id, 773, TaxPayment_details, 1, DateTime.Now);
                            }
                        }

                        //Pdf download
                        IWebElement         Receipttable    = driver.FindElement(By.XPath("//*[@id='tax_value_table']/table/tbody"));
                        IList <IWebElement> ReceipttableRow = Receipttable.FindElements(By.TagName("tr"));
                        int rowcount = ReceipttableRow.Count;

                        for (int p = 1; p <= rowcount; p++)
                        {
                            if (p < 4)
                            {
                                string Parent_Window1 = driver.CurrentWindowHandle;

                                driver.FindElement(By.XPath("//*[@id='tax_value_table']/table/tbody/tr[" + p + "]/td[10]/a")).Click();
                                Thread.Sleep(10000);


                                System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
                                driver.SwitchTo().Window(driver.WindowHandles.Last());
                                Thread.Sleep(4000);



                                try
                                {
                                    var chromeOptions     = new ChromeOptions();
                                    var downloadDirectory = ConfigurationManager.AppSettings["AutoPdf"];
                                    chromeOptions.AddUserProfilePreference("download.default_directory", downloadDirectory);
                                    chromeOptions.AddUserProfilePreference("download.prompt_for_download", false);
                                    chromeOptions.AddUserProfilePreference("disable-popup-blocking", true);
                                    chromeOptions.AddUserProfilePreference("plugins.always_open_pdf_externally", true);
                                    var chDriver = new ChromeDriver(chromeOptions);
                                    Array.ForEach(Directory.GetFiles(@downloadDirectory), File.Delete);
                                    chDriver.Navigate().GoToUrl(driver.Url);
                                    Thread.Sleep(8000);

                                    //PopUp
                                    try
                                    {
                                        chDriver.SwitchTo().Alert().Accept();
                                        Thread.Sleep(1000);
                                    }
                                    catch
                                    { }
                                    IWebElement         ISpan12 = chDriver.FindElement(By.Id("PdfDialog_PdfDownloadLink"));
                                    IJavaScriptExecutor js12    = chDriver as IJavaScriptExecutor;
                                    js12.ExecuteScript("arguments[0].click();", ISpan12);
                                    Thread.Sleep(5000);

                                    chDriver.FindElement(By.Id("PdfDialog_download")).Click();
                                    Thread.Sleep(20000);

                                    string fileName1 = latestfilename();
                                    Thread.Sleep(2000);
                                    gc.AutoDownloadFile(orderNumber, Parcel_Id, "Cowlitz", "WA", fileName1);
                                    chDriver.Quit();
                                }
                                catch { }

                                driver.SwitchTo().Window(Parent_Window1);
                                Thread.Sleep(2000);
                            }
                        }

                        //Tax Authority
                        driver.FindElement(By.XPath("//*[@id='top']/nav/ul/li[2]/a")).Click();
                        Thread.Sleep(2000);

                        //driver.SwitchTo().Window(driver.WindowHandles.Last());
                        //Thread.Sleep(2000);

                        Tax_Authority = driver.FindElement(By.XPath("//*[@id='address']")).Text;
                        Tax_Authority = WebDriverTest.Between(Tax_Authority, "Address", "Option 1").Replace("\r\n", "");

                        Taxauthority_Details = Tax_Authority;
                        gc.insert_date(orderNumber, Parcel_Id, 780, Taxauthority_Details, 1, DateTime.Now);
                    }
                    catch
                    { }

                    //IWebElement parcel_id = driver.FindElement(By.Id("ctl00_cphParcelSearch_txtParcel"));
                    //string Parcel_Id = parcel_id.GetAttribute("value");
                    //gc.CreatePdf(orderNumber, Parcel_Id, "Property Details", driver, "WA", "Cowlitz");
                    //IWebElement account_no = driver.FindElement(By.XPath("//*[@id='ctl00_cphParcelSearch_lnkAccount']"));
                    //string Account_No = account_no.Text;
                    //IWebElement jurisdiction = driver.FindElement(By.XPath("//*[@id='ctl00_cphParcelSearch_txtJurisdiction']"));
                    //string Jurisdiction = jurisdiction.GetAttribute("value");
                    //IWebElement owner_name = driver.FindElement(By.XPath("//*[@id='ctl00_cphParcelSearch_txtOwner']"));
                    //string Owner_Name = owner_name.GetAttribute("value");
                    //IWebElement mailing_address1 = driver.FindElement(By.XPath("//*[@id='ctl00_cphParcelSearch_txtAddress1']"));
                    //string Mailing_Address1 = mailing_address1.GetAttribute("value");
                    //IWebElement mailing_address2 = driver.FindElement(By.XPath("//*[@id='ctl00_cphParcelSearch_txtAddress2']"));
                    //string Mailing_Address2 = mailing_address2.GetAttribute("value");
                    //IWebElement tax_district = driver.FindElement(By.XPath("//*[@id='ctl00_cphParcelSearch_lnkTaxDistrict']"));
                    //string Tax_District = tax_district.Text;
                    //IWebElement neighbor_hood = driver.FindElement(By.XPath("//*[@id='ctl00_cphParcelSearch_txtNeighborhood']"));
                    //string Neighbor_Hood = neighbor_hood.GetAttribute("value");
                    //IWebElement levy_rate = driver.FindElement(By.XPath("//*[@id='ctl00_cphParcelSearch_txtLevyRate']"));
                    //string Levy_Rate = levy_rate.GetAttribute("value");
                    //IWebElement legal_desc = driver.FindElement(By.XPath("//*[@id='ctl00_cphParcelSearch_txtLegalDescr']"));
                    //string Legal_Desc = legal_desc.GetAttribute("value");
                    //IWebElement property_address = driver.FindElement(By.XPath("//*[@id='ctl00_cphParcelSearch_txtSitus']"));
                    //string Property_Address = property_address.GetAttribute("value");
                    //string propertydetails = Account_No + "~" + Jurisdiction + "~" + Owner_Name + "~" + Mailing_Address1 + Mailing_Address2 + "~" + Legal_Desc + "~" + Property_Address + "~" + Tax_District + "~" + Neighbor_Hood + "~" + Levy_Rate;
                    //gc.insert_date(orderNumber, Parcel_Id, 763, propertydetails, 1, DateTime.Now);

                    // Assessment Details table

                    //IWebElement tbmulti = driver.FindElement(By.XPath("//*[@id='ctl00_cphParcelSearch_tblAssessmentInformation']/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 == 7 && !row.Text.Contains("Assessment\r\nYear"))
                    //    {
                    //        string multi1 = TDmulti[0].Text + "~" + TDmulti[1].Text + "~" + TDmulti[2].Text + "~" + TDmulti[3].Text + "~" + TDmulti[4].Text + "~" + TDmulti[5].Text;
                    //        gc.insert_date(orderNumber, Parcel_Id, 765, multi1, 1, DateTime.Now);
                    //    }
                    //}

                    //  Payment History Table
                    //string currenturl = "";
                    //driver.FindElement(By.XPath("//*[@id='ctl00_cphParcelSearch_lnkbtnTransactionHistoricalValues']")).SendKeys(Keys.Enter);
                    //Thread.Sleep(5000);
                    //gc.CreatePdf(orderNumber, Parcel_Id, "TaxPaymentHistory", driver, "WA", "Cowlitz");
                    //try
                    //{
                    //    currenturl = driver.CurrentWindowHandle;
                    //    driver.FindElement(By.XPath("//*[@id='ctl00_cphParcelSearch_tblTransactionValues']/tbody/tr[3]/td[9]/a")).SendKeys(Keys.Enter);
                    //    Thread.Sleep(5000);

                    //    driver.SwitchTo().Window(driver.WindowHandles.Last());

                    //    IWebElement tbDelinq = driver.FindElement(By.XPath("//*[@id='ctl00_cphParcelSearch_tblTrxDetail']/tbody"));
                    //    IList<IWebElement> TRDelinq = tbDelinq.FindElements(By.TagName("tr"));

                    //    IList<IWebElement> TDDelinq;
                    //    foreach (IWebElement row in TRDelinq)
                    //    {

                    //        TDDelinq = row.FindElements(By.TagName("td"));
                    //        if (TDDelinq.Count == 5 && !row.Text.Contains("Assess\r\nYear") && !row.Text.Contains("Total Tax"))
                    //        {
                    //            string Delinq = TDDelinq[0].Text + "~" + TDDelinq[1].Text + "~" + TDDelinq[2].Text + "~" + TDDelinq[3].Text + "~" + TDDelinq[4].Text;
                    //            gc.insert_date(orderNumber, Parcel_Id, 817, Delinq, 1, DateTime.Now);
                    //        }

                    //        if (TDDelinq.Count == 5 && row.Text.Contains("Total Tax") && !row.Text.Contains("Assess\r\nYear"))
                    //        {
                    //            string Delinq = TDDelinq[3].Text + "~" + "~" + "~" + "~" + TDDelinq[4].Text;
                    //            gc.insert_date(orderNumber, Parcel_Id, 817, Delinq, 1, DateTime.Now);
                    //        }
                    //    }


                    //}
                    //catch (Exception ex)
                    //{

                    //}
                    //driver.SwitchTo().Window(currenturl);
                    //List<string> TaxYearDetails = new List<string>();
                    //List<string> TaxBillDetails = new List<string>();
                    //IWebElement tbmulti1 = driver.FindElement(By.XPath("//*[@id='ctl00_cphParcelSearch_tblTransactionValues']/tbody"));
                    //IList<IWebElement> TRmulti1 = tbmulti1.FindElements(By.TagName("tr"));
                    //IList<IWebElement> TDmulti1;
                    //foreach (IWebElement row in TRmulti1)
                    //{
                    //    TDmulti1 = row.FindElements(By.TagName("td"));
                    //    if ((TDmulti1.Count == 9 || TDmulti1.Count == 8) && !(row.Text.Contains("Assessment\r\nYear")))
                    //    {
                    //        string multi2 = TDmulti1[0].Text + "~" + TDmulti1[1].Text + "~" + TDmulti1[2].Text + "~" + TDmulti1[3].Text + "~" + TDmulti1[4].Text + "~" + TDmulti1[5].Text + "~" + TDmulti1[6].Text;

                    //        gc.insert_date(orderNumber, Parcel_Id, 773, multi2, 1, DateTime.Now);

                    //        if (TDmulti1.Count != 0 && TaxYearDetails.Count < 3)
                    //        {
                    //            IWebElement IYear = TDmulti1[1].FindElement(By.TagName("a"));
                    //            string strYear = IYear.GetAttribute("href");
                    //            TaxYearDetails.Add(strYear);
                    //        }
                    //        if (TDmulti1.Count != 0 && TaxBillDetails.Count < 3)
                    //        {
                    //            IWebElement ITaxBill = TDmulti1[7].FindElement(By.TagName("a"));
                    //            string strTaxBill = ITaxBill.GetAttribute("href");
                    //            TaxBillDetails.Add(strTaxBill);
                    //        }

                    //    }
                    //}

                    //int k = 0, l = 0;
                    //foreach (string yearURL in TaxYearDetails)
                    //{
                    //    driver.Navigate().GoToUrl(yearURL);

                    //    gc.CreatePdf(orderNumber, Parcel_Id, "Tax Detail" + k, driver, "WA", "Cowlitz");
                    //    k++;
                    //    try
                    //    {
                    //        IWebElement tbmulti2 = driver.FindElement(By.XPath("//*[@id='ctl00_cphParcelSearch_tblTrxDetail']/tbody"));
                    //        IList<IWebElement> TRmulti2 = tbmulti2.FindElements(By.TagName("tr"));
                    //        IList<IWebElement> TDmulti2;
                    //        foreach (IWebElement Tax in TRmulti2)
                    //        {
                    //            TDmulti2 = Tax.FindElements(By.TagName("td"));
                    //            if ((TDmulti2.Count == 6) && !Tax.Text.Contains("Tax Detail") && !Tax.Text.Contains("Account"))
                    //            {
                    //                string taxing_authority = "Cowlitz County Treasurer 207 4th Ave. N.Kelso, WA 98626";
                    //                string multi3 = TDmulti2[0].Text + "~" + TDmulti2[1].Text + "~" + TDmulti2[2].Text + "~" + TDmulti2[3].Text + "~" + TDmulti2[4].Text + "~" + TDmulti2[5].Text;
                    //                string multi4 = multi3 + "~" + taxing_authority;
                    //                gc.insert_date(orderNumber, Parcel_Id, 780, multi4, 1, DateTime.Now);
                    //            }
                    //        }
                    //    }
                    //    catch { }
                    //}
                    //int j = 0;
                    //foreach (string billURL in TaxBillDetails)
                    //{
                    //    driver.Navigate().GoToUrl(billURL);
                    //    IWebElement Ibill = driver.FindElement(By.XPath("//*[@id='PageToolbar']"));
                    //    IList<IWebElement> TRmulti5 = Ibill.FindElements(By.TagName("a"));
                    //    IList<IWebElement> TDmulti5;
                    //    foreach (IWebElement Tax in TRmulti5)
                    //    {
                    //        TDmulti5 = Tax.FindElements(By.TagName("img"));
                    //        if (TDmulti5.Count != 0)
                    //        {
                    //            IWebElement itaxbill = TDmulti5[0];
                    //            string strtaxbill = itaxbill.GetAttribute("id");
                    //            if (strtaxbill.Contains("FullScreenButton"))
                    //            {

                    //                IJavaScriptExecutor js = driver as IJavaScriptExecutor;
                    //                js.ExecuteScript("arguments[0].click();", itaxbill);
                    //                Thread.Sleep(6000);
                    //            }

                    //        }
                    //    }
                    //    gc.CreatePdf(orderNumber, Parcel_Id, "TaxBill Download" + j, driver, "WA", "Cowlitz");
                    //    try
                    //    {
                    //        //gc.downloadfile(billURL, orderNumber, Parcel_Id, "Paid Bill" + j, "WA", "Cowlitz");
                    //    }
                    //    catch { }
                    //    j++;
                    //}

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

                    driver.Quit();
                    gc.mergpdf(orderNumber, "WA", "Cowlitz");
                    return("Data Inserted Successfully");
                }
                catch (Exception ex)
                {
                    driver.Quit();
                    GlobalClass.LogError(ex, orderNumber);
                    throw ex;
                }
            }
        }
Esempio n. 11
0
        public string FTP_TNHamilton(string houseno, string sname, string sttype, string accno, string parcelNumber, string searchType, string orderNumber, string ownername, string directParcel, string unitno)
        {
            GlobalClass.global_orderNo             = orderNumber;
            HttpContext.Current.Session["orderNo"] = orderNumber;
            GlobalClass.global_parcelNo            = parcelNumber;

            string StartTime = "", AssessmentTime = "", TaxTime = "", CitytaxTime = "", LastEndTime = "";

            var driverService = PhantomJSDriverService.CreateDefaultService();

            driverService.HideCommandPromptWindow = true;
            using (driver = new PhantomJSDriver())
            {
                //driver = new ChromeDriver();

                try
                {
                    StartTime = DateTime.Now.ToString("HH:mm:ss");

                    if (searchType == "titleflex")
                    {
                        string address = houseno + " " + sname + " " + unitno;
                        gc.TitleFlexSearch(orderNumber, parcelNumber, "", address, "TN", "Hamilton");
                        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_TNHamilton"] = "Yes";
                            driver.Quit();
                            return("No Data Found");
                        }
                        parcelNumber = HttpContext.Current.Session["titleparcel"].ToString();
                        searchType   = "parcel";
                    }

                    if (searchType == "address")
                    {
                        driver.Navigate().GoToUrl("http://assessor.hamiltontn.gov/search.aspx");
                        Thread.Sleep(2000);

                        driver.FindElement(By.Id("SearchStreetName")).SendKeys(sname);
                        driver.FindElement(By.Id("SearchStreetNumber")).SendKeys(houseno);

                        driver.FindElement(By.Id("cmdGo")).SendKeys(Keys.Enter);
                        Thread.Sleep(2000);
                        gc.CreatePdf_WOP(orderNumber, "Address search", driver, "TN", "Hamilton");

                        IWebElement         MultiAddressTB = driver.FindElement(By.XPath("//*[@id='T1']/tbody"));
                        IList <IWebElement> MultiAddressTR = MultiAddressTB.FindElements(By.TagName("tr"));
                        IList <IWebElement> MultiAddressTD;

                        if (MultiAddressTR.Count == 1)
                        {
                            driver.FindElement(By.XPath("//*[@id='T1']/tbody/tr/td[1]/a")).Click();
                            Thread.Sleep(2000);
                        }

                        else
                        {
                            int AddressmaxCheck = 0;
                            foreach (IWebElement MultiAddress in MultiAddressTR)
                            {
                                if (AddressmaxCheck <= 25)
                                {
                                    MultiAddressTD = MultiAddress.FindElements(By.TagName("td"));
                                    if (MultiAddressTD.Count != 0)
                                    {
                                        Parcelno = MultiAddressTD[0].Text;
                                        Location = MultiAddressTD[1].Text;
                                        Owner    = MultiAddressTD[2].Text;

                                        MultiAddress_details = Location + "~" + Owner;
                                        gc.insert_date(orderNumber, Parcelno, 764, MultiAddress_details, 1, DateTime.Now);
                                    }
                                    AddressmaxCheck++;
                                }
                            }
                            if (MultiAddressTR.Count > 25)
                            {
                                HttpContext.Current.Session["multiParcel_TNHamilton_Multicount"] = "Maximum";
                            }
                            else
                            {
                                HttpContext.Current.Session["multiparcel_TNHamilton"] = "Yes";
                            }
                            driver.Quit();

                            return("MultiParcel");
                        }
                        try
                        {
                            //No Data Found
                            string nodata = driver.FindElement(By.XPath("//*[@id='body']/div[3]")).Text;
                            if (nodata.Contains("No results found!"))
                            {
                                HttpContext.Current.Session["Nodata_TNHamilton"] = "Yes";
                                driver.Quit();
                                return("No Data Found");
                            }
                        }
                        catch { }
                    }

                    if (searchType == "parcel")
                    {
                        driver.Navigate().GoToUrl("http://assessor.hamiltontn.gov/search.aspx");
                        Thread.Sleep(2000);

                        if (parcelNumber.Contains("-") || parcelNumber.Contains(" ") || parcelNumber.Contains("."))
                        {
                            parcelNumber = parcelNumber.Replace("-", "").Replace(" ", "").Replace(".", "");
                        }

                        string CommonParcel = parcelNumber;

                        if (CommonParcel.Length == 8)
                        {
                            string a = parcelNumber.Substring(0, 4);
                            string b = parcelNumber.Substring(4, 1);
                            string c = parcelNumber.Substring(5, 3);

                            parcelNumber = a + " " + b + " " + c;
                        }

                        if (CommonParcel.Length == 6)
                        {
                            string g = parcelNumber.Substring(0, 3);
                            string h = parcelNumber.Substring(3, 3);

                            parcelNumber = g + " " + h;
                        }

                        if (CommonParcel.Length == 13)
                        {
                            string d = parcelNumber.Substring(0, 4);
                            string e = parcelNumber.Substring(5, 1);
                            string f = parcelNumber.Substring(6, 3);

                            parcelNumber = d + " " + e + " " + f;
                        }

                        driver.FindElement(By.Id("SearchParcel")).SendKeys(parcelNumber);

                        driver.FindElement(By.Id("cmdGo")).SendKeys(Keys.Enter);
                        Thread.Sleep(2000);
                        gc.CreatePdf(orderNumber, parcelNumber, "ParcelSearch", driver, "TN", "Hamilton");

                        driver.FindElement(By.XPath("//*[@id='T1']/tbody/tr/td[1]/a")).Click();
                        Thread.Sleep(2000);
                    }

                    if (searchType == "ownername")
                    {
                        driver.Navigate().GoToUrl("http://assessor.hamiltontn.gov/search.aspx");
                        Thread.Sleep(2000);

                        driver.FindElement(By.Id("SearchOwner")).SendKeys(ownername);

                        driver.FindElement(By.Id("cmdGo")).SendKeys(Keys.Enter);
                        Thread.Sleep(2000);
                        gc.CreatePdf_WOP(orderNumber, "Owner search", driver, "TN", "Hamilton");

                        IWebElement         MultiOwnerTB = driver.FindElement(By.XPath("//*[@id='T1']/tbody"));
                        IList <IWebElement> MultiOwnerTR = MultiOwnerTB.FindElements(By.TagName("tr"));
                        IList <IWebElement> MultiOwnerTD;

                        if (MultiOwnerTR.Count == 1)
                        {
                            driver.FindElement(By.XPath("//*[@id='T1']/tbody/tr/td[1]/a")).Click();
                            Thread.Sleep(2000);
                        }

                        else
                        {
                            int AddressmaxCheck = 0;
                            foreach (IWebElement MultiOwner in MultiOwnerTR)
                            {
                                if (AddressmaxCheck <= 25)
                                {
                                    MultiOwnerTD = MultiOwner.FindElements(By.TagName("td"));
                                    if (MultiOwnerTD.Count != 0)
                                    {
                                        Parcelno = MultiOwnerTD[0].Text;
                                        Location = MultiOwnerTD[1].Text;
                                        Owner    = MultiOwnerTD[2].Text;

                                        MultiOwner_details = Location + "~" + Owner;
                                        gc.insert_date(orderNumber, Parcelno, 764, MultiOwner_details, 1, DateTime.Now);
                                    }
                                    AddressmaxCheck++;
                                }
                            }
                            if (MultiOwnerTR.Count > 25)
                            {
                                HttpContext.Current.Session["multiParcel_TNHamilton_Multicount"] = "Maximum";
                            }
                            else
                            {
                                HttpContext.Current.Session["multiparcel_TNHamilton"] = "Yes";
                            }
                            driver.Quit();
                            return("MultiParcel");
                        }
                        try
                        {
                            //No Data Found
                            string nodata = driver.FindElement(By.XPath("//*[@id='body']/div[3]")).Text;
                            if (nodata.Contains("No results found!"))
                            {
                                HttpContext.Current.Session["Nodata_TNHamilton"] = "Yes";
                                driver.Quit();
                                return("No Data Found");
                            }
                        }
                        catch { }
                    }

                    //Property Details
                    try
                    {
                        Property_Address = driver.FindElement(By.XPath("//*[@id='body']/form/div[2]/table[1]/tbody/tr[1]/td[1]/div/div")).Text;
                        Account_No       = driver.FindElement(By.XPath("//*[@id='body']/form/div[2]/table[1]/tbody/tr[1]/td[2]/div/div")).Text;
                        Parcel_ID        = driver.FindElement(By.XPath("//*[@id='body']/form/div[2]/table[1]/tbody/tr[1]/td[3]/div/div")).Text;
                        Pro_Type         = driver.FindElement(By.XPath("//*[@id='body']/form/div[2]/table[1]/tbody/tr[2]/td[1]/div/div")).Text;
                        Land_Use         = driver.FindElement(By.XPath("//*[@id='body']/form/div[2]/table[1]/tbody/tr[2]/td[2]/div/div")).Text;
                        Dist             = driver.FindElement(By.XPath("//*[@id='body']/form/div[2]/table[1]/tbody/tr[2]/td[3]/div/div")).Text;
                        Owner1           = driver.FindElement(By.XPath("//*[@id='body']/form/div[2]/table[2]/tbody/tr[2]/td/div/table/tbody/tr/td/table/tbody/tr[1]/td[2]/div")).Text;
                        Owner2           = driver.FindElement(By.XPath("//*[@id='body']/form/div[2]/table[2]/tbody/tr[2]/td/div/table/tbody/tr/td/table/tbody/tr[2]/td[2]/div")).Text;
                        Owners           = Owner1 + " &" + Owner2;
                        Mailing1         = driver.FindElement(By.XPath("//*[@id='body']/form/div[2]/table[2]/tbody/tr[2]/td/div/table/tbody/tr/td/table/tbody/tr[3]/td[2]/div")).Text;
                        Mailing2         = driver.FindElement(By.XPath("//*[@id='body']/form/div[2]/table[2]/tbody/tr[2]/td/div/table/tbody/tr/td/table/tbody/tr[1]/td[4]/div")).Text;
                        Mailing3         = driver.FindElement(By.XPath("//*[@id='body']/form/div[2]/table[2]/tbody/tr[2]/td/div/table/tbody/tr/td/table/tbody/tr[2]/td[4]/div")).Text;
                        Mailing4         = driver.FindElement(By.XPath("//*[@id='body']/form/div[2]/table[2]/tbody/tr[2]/td/div/table/tbody/tr/td/table/tbody/tr[3]/td[4]/div")).Text;
                        Mailing_Address  = Mailing1 + "," + Mailing2 + "," + Mailing3 + " " + Mailing4;
                        Year_Built       = driver.FindElement(By.XPath("//*[@id='body']/form/div[2]/table[2]/tbody/tr[4]/td/div[2]/center/table/tbody/tr[2]/td/div/table/tbody/tr/td/div")).Text;
                        Year_Built       = WebDriverTest.Between(Year_Built, "about ", " with");
                        Legal_Desp       = driver.FindElement(By.XPath("//*[@id='body']/form/div[2]/table[2]/tbody/tr[4]/td/div[2]/center/table/tbody/tr[2]/td/font[2]/div[1]/center/table[2]/tbody/tr[2]/td/div/table/tbody/tr/td/div")).Text;

                        property = Account_No + "~" + Property_Address + "~" + Pro_Type + "~" + Land_Use + "~" + Dist + "~" + Owners + "~" + Mailing_Address + "~" + Year_Built + "~" + Legal_Desp;
                        gc.CreatePdf(orderNumber, Parcel_ID, "Property Details", driver, "TN", "Hamilton");
                        gc.insert_date(orderNumber, Parcel_ID, 766, property, 1, DateTime.Now);
                    }
                    catch
                    { }

                    //Assessment Deatils
                    try
                    {
                        IWebElement         tbmulti11 = driver.FindElement(By.XPath("//*[@id='body']/form/div[2]/table[2]/tbody/tr[4]/td/div[1]/center/table/tbody/tr[2]/td/div/table/tbody/tr/td/table/tbody"));
                        IList <IWebElement> TRmulti11 = tbmulti11.FindElements(By.TagName("tr"));
                        IList <IWebElement> TDmulti11;

                        foreach (IWebElement row in TRmulti11)
                        {
                            TDmulti11 = row.FindElements(By.TagName("td"));
                            if (TDmulti11.Count != 0)
                            {
                                Build = TDmulti11[0].Text;
                                if (Build.Contains("Building Value"))
                                {
                                    Building_Value = TDmulti11[1].Text;
                                }

                                Xtra = TDmulti11[0].Text;
                                if (Xtra.Contains("Xtra Features Value"))
                                {
                                    Xtra_Fetures_Value = TDmulti11[1].Text;
                                }

                                Land = TDmulti11[0].Text;
                                if (Land.Contains("Land Value"))
                                {
                                    Land_Value = TDmulti11[1].Text;
                                }

                                tol = TDmulti11[0].Text;
                                if (tol.Contains("Total Value"))
                                {
                                    Total_Value = TDmulti11[1].Text;
                                }

                                Assed = TDmulti11[0].Text;
                                if (Assed.Contains("Assessed Value"))
                                {
                                    Assessed_Value = TDmulti11[1].Text;
                                }
                            }
                        }

                        Assessment = Building_Value + "~" + Xtra_Fetures_Value + "~" + Land_Value + "~" + Total_Value + "~" + Assessed_Value;
                        gc.insert_date(orderNumber, Parcel_ID, 767, Assessment, 1, DateTime.Now);
                    }
                    catch
                    { }


                    //Tax Details
                    driver.Navigate().GoToUrl("http://tpti.hamiltontn.gov/AppFolder/Trustee_PropertySearch.aspx");
                    Thread.Sleep(2000);

                    driver.FindElement(By.Id("ctl00_MainContent_btnMGP")).Click();
                    Thread.Sleep(2000);


                    Parcel_ID = Parcel_ID.Replace("_", "");

                    if (Parcel_ID.Contains("."))
                    {
                        Parcel_ID = GlobalClass.Before(Parcel_ID, ".").Trim();
                    }
                    string com_Parcel = Parcel_ID;
                    if (com_Parcel.Length == 7)
                    {
                        Map    = Parcel_ID.Substring(0, 4);
                        Parcel = Parcel_ID.Substring(4, 3);
                    }
                    if (com_Parcel.Length == 8)
                    {
                        Map    = Parcel_ID.Substring(0, 4);
                        Group  = Parcel_ID.Substring(4, 1);
                        Parcel = Parcel_ID.Substring(5, 3);
                    }
                    if (com_Parcel.Length == 9)
                    {
                        Map    = Parcel_ID.Substring(0, 5);
                        Group  = Parcel_ID.Substring(5, 1);
                        Parcel = Parcel_ID.Substring(6, 3);
                    }

                    driver.FindElement(By.Id("ctl00_MainContent_txtMap")).SendKeys(Map);
                    driver.FindElement(By.Id("ctl00_MainContent_txtGroup")).SendKeys(Group);
                    driver.FindElement(By.Id("ctl00_MainContent_txtParcel")).SendKeys(Parcel);

                    gc.CreatePdf(orderNumber, Parcel_ID, "Tax Parcel search", driver, "TN", "Hamilton");
                    driver.FindElement(By.Id("ctl00_MainContent_cmdMGP_Search")).SendKeys(Keys.Enter);

                    //County Tax History Details
                    try
                    {
                        IWebElement         CountyTaxPaymentTB = driver.FindElement(By.XPath("//*[@id='ctl00_MainContent_dgrResults']/tbody"));
                        IList <IWebElement> CountyTaxPaymentTR = CountyTaxPaymentTB.FindElements(By.TagName("tr"));
                        IList <IWebElement> CountyTaxPaymentTD;

                        foreach (IWebElement CountyTaxPayment in CountyTaxPaymentTR)
                        {
                            CountyTaxPaymentTD = CountyTaxPayment.FindElements(By.TagName("td"));
                            if (CountyTaxPaymentTD.Count != 0 && !CountyTaxPayment.Text.Contains("Year"))
                            {
                                County_Taxyear = CountyTaxPaymentTD[1].Text;
                                Bill           = CountyTaxPaymentTD[2].Text;
                                Bill_Type      = CountyTaxPaymentTD[4].Text;
                                CPro_Type      = CountyTaxPaymentTD[5].Text;
                                Own_name       = CountyTaxPaymentTD[6].Text;
                                Tol_Due        = CountyTaxPaymentTD[7].Text;
                                Status         = CountyTaxPaymentTD[8].Text;

                                CountyPayment_details = County_Taxyear + "~" + Bill + "~" + Bill_Type + "~" + CPro_Type + "~" + Own_name + "~" + Tol_Due + "~" + Status;
                                gc.CreatePdf(orderNumber, Parcel_ID, "County Tax History Details", driver, "TN", "Hamilton");
                                gc.insert_date(orderNumber, Parcel_ID, 768, CountyPayment_details, 1, DateTime.Now);
                            }
                        }
                    }
                    catch
                    { }

                    //County Tax Info Details
                    List <string> CountyInfoSearch = new List <string>();

                    try
                    {
                        IWebElement         CityInfoTB = driver.FindElement(By.XPath("//*[@id='ctl00_MainContent_dgrResults']/tbody"));
                        IList <IWebElement> CityInfoTR = CityInfoTB.FindElements(By.TagName("tr"));
                        IList <IWebElement> CityInfoTD;

                        int i = 0;
                        foreach (IWebElement CityInfo in CityInfoTR)
                        {
                            if (!CityInfo.Text.Contains("Year"))
                            {
                                if (i == 1 || i == 2 || i == 3)
                                {
                                    CityInfoTD = CityInfo.FindElements(By.TagName("td"));
                                    IWebElement CityInfo_link = CityInfoTD[0].FindElement(By.TagName("a"));
                                    string      CityInfourl   = CityInfo_link.GetAttribute("href");
                                    CountyInfoSearch.Add(CityInfourl);
                                }
                            }
                            i++;
                        }

                        foreach (string CityInfobill in CountyInfoSearch)
                        {
                            driver.Navigate().GoToUrl(CityInfobill);
                            Thread.Sleep(5000);

                            driver.SwitchTo().Window(driver.WindowHandles.Last());
                            Thread.Sleep(3000);

                            //Tax Info
                            Flags          = driver.FindElement(By.XPath("//*[@id='aspnetForm']/div[3]/table/tbody/tr[2]/td[2]/table/tbody/tr[5]/td/table/tbody/tr[1]/td[4]")).Text;
                            Tax_Distrct    = driver.FindElement(By.XPath("//*[@id='aspnetForm']/div[3]/table/tbody/tr[2]/td[2]/table/tbody/tr[5]/td/table/tbody/tr[2]/td[2]")).Text;
                            Bil_type       = driver.FindElement(By.XPath("//*[@id='aspnetForm']/div[3]/table/tbody/tr[2]/td[2]/table/tbody/tr[7]/td/table/tbody/tr[1]/td[2]")).Text;
                            TaxBil_type    = driver.FindElement(By.XPath("//*[@id='aspnetForm']/div[3]/table/tbody/tr[2]/td[2]/table/tbody/tr[7]/td/table/tbody/tr[1]/td[4]")).Text;
                            Bil_Status     = driver.FindElement(By.XPath("//*[@id='aspnetForm']/div[3]/table/tbody/tr[2]/td[2]/table/tbody/tr[7]/td/table/tbody/tr[2]/td[2]")).Text;
                            Bill_Hash      = driver.FindElement(By.XPath("//*[@id='aspnetForm']/div[3]/table/tbody/tr[2]/td[2]/table/tbody/tr[7]/td/table/tbody/tr[2]/td[4]")).Text;
                            Tax_Assessment = driver.FindElement(By.XPath("//*[@id='aspnetForm']/div[3]/table/tbody/tr[2]/td[2]/table/tbody/tr[7]/td/table/tbody/tr[5]/td[2]")).Text;

                            IWebElement         Tax3TB = driver.FindElement(By.XPath("//*[@id='ctl00_MainContent_dgrTrans']/tbody"));
                            IList <IWebElement> Tax3TR = Tax3TB.FindElements(By.TagName("tr"));
                            IList <IWebElement> Tax3TD;
                            foreach (IWebElement Tax3 in Tax3TR)
                            {
                                Tax3TD = Tax3.FindElements(By.TagName("td"));
                                if (Tax3TD.Count != 0 && !Tax3.Text.Contains("Date"))
                                {
                                    Billing_Date = Tax3TD[0].Text;
                                    Trns_type    = Tax3TD[1].Text;
                                    Fee_Type     = Tax3TD[2].Text;
                                    Bill_Amount  = Tax3TD[4].Text;
                                }
                            }

                            try
                            {
                                IWebElement         Tax4TB = driver.FindElement(By.XPath("//*[@id='ctl00_MainContent_dgrPayments']/tbody"));
                                IList <IWebElement> Tax4TR = Tax4TB.FindElements(By.TagName("tr"));
                                IList <IWebElement> Tax4TD;
                                foreach (IWebElement Tax4 in Tax4TR)
                                {
                                    Tax4TD = Tax4.FindElements(By.TagName("td"));
                                    if (Tax4TD.Count != 0 && !Tax4.Text.Contains("Date Paid"))
                                    {
                                        PayIfo_Date     = Tax4TD[0].Text;
                                        PayIfoTrns_type = Tax4TD[1].Text;
                                        PayIfoFee_Type  = Tax4TD[2].Text;
                                        PayIfo_Amount   = Tax4TD[3].Text;
                                    }
                                }
                            }
                            catch
                            { }

                            //Deliquent Details
                            try
                            {
                                IWebElement         IntrestTB = driver.FindElement(By.XPath("//*[@id='ctl00_MainContent_lblIntAndFees']/table/tbody"));
                                IList <IWebElement> IntrestTR = IntrestTB.FindElements(By.TagName("tr"));
                                IList <IWebElement> IntrestTD;
                                foreach (IWebElement Intrest in IntrestTR)
                                {
                                    IntrestTD = Intrest.FindElements(By.TagName("td"));
                                    if (IntrestTD.Count != 0)
                                    {
                                        ints = IntrestTD[0].Text;
                                        if (ints.Contains("Interest:"))
                                        {
                                            Deliq_Interest = IntrestTD[1].Text;
                                        }

                                        Court = IntrestTD[0].Text;
                                        if (Court.Contains("Court Cost:"))
                                        {
                                            Deliq_CourtCost = IntrestTD[1].Text;
                                        }

                                        Att = IntrestTD[0].Text;
                                        if (Att.Contains("Attorney's Fee:"))
                                        {
                                            Deliq_Attornys = IntrestTD[1].Text;
                                        }

                                        Clerk = IntrestTD[0].Text;
                                        if (Clerk.Contains("Clerk Commission:"))
                                        {
                                            Deliq_Clerk = IntrestTD[1].Text;
                                        }

                                        TR = IntrestTD[0].Text;
                                        if (TR.Contains("TR Costs:"))
                                        {
                                            Deliq_TR = IntrestTD[1].Text;
                                        }
                                    }
                                }
                            }
                            catch
                            { }

                            IWebElement         Tax2TB = driver.FindElement(By.XPath("//*[@id='ctl00_MainContent_pnlTotalDue']/table[1]/tbody/tr[1]/td/table/tbody"));
                            IList <IWebElement> Tax2TR = Tax2TB.FindElements(By.TagName("tr"));
                            IList <IWebElement> Tax2TD;

                            foreach (IWebElement Tax2 in Tax2TR)
                            {
                                Tax2TD = Tax2.FindElements(By.TagName("td"));
                                if (Tax2TD.Count != 0)
                                {
                                    t_du = Tax2TD[0].Text;
                                    if (t_du.Contains(" Total Due  "))
                                    {
                                        Total_taxDue = Tax2TD[1].Text;
                                    }
                                }
                            }
                            gc.CreatePdf(orderNumber, Parcel_ID, "Tax Details" + TaxBil_type, driver, "TN", "Hamilton");

                            try
                            {
                                Tax_Authority = driver.FindElement(By.XPath("//*[@id='ctl00_MainContent_pnlOurAddr']/table/tbody/tr/td/b")).Text;
                            }
                            catch
                            { }

                            try
                            {
                                Tax_Authority = driver.FindElement(By.XPath("//*[@id='ctl00_MainContent_pnlDelQ']/table/tbody/tr/td/b")).Text;
                            }
                            catch
                            { }

                            Tax_Deatils = Tax_Distrct + "~" + TaxBil_type + "~" + Flags + "~" + Bil_type + "~" + Bil_Status + "~" + Bill_Hash + "~" + Tax_Assessment + "~" + Billing_Date + "~" + Trns_type + "~" + Fee_Type + "~" + Bill_Amount + "~" + PayIfo_Date + "~" + PayIfoTrns_type + "~" + PayIfoFee_Type + "~" + PayIfo_Amount + "~" + Deliq_Interest + "~" + Deliq_CourtCost + "~" + Deliq_Attornys + "~" + Deliq_Clerk + "~" + Deliq_TR + "~" + Total_taxDue + "~" + Tax_Authority;
                            gc.insert_date(orderNumber, Parcel_ID, 769, Tax_Deatils, 1, DateTime.Now);
                            PayIfo_Date = ""; PayIfoTrns_type = ""; PayIfoFee_Type = ""; PayIfo_Amount = ""; Deliq_Interest = ""; Deliq_CourtCost = ""; Deliq_Attornys = ""; Deliq_Clerk = ""; Deliq_TR = ""; Total_taxDue = ""; Tax_Authority = "";
                        }
                    }
                    catch { }

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

                    if (Tax_Distrct == "Chattanooga (1)")
                    {
                        driver.Navigate().GoToUrl("http://propertytax.chattanooga.gov/component/ptaxweb/searchpage?field=mgp");
                        Thread.Sleep(2000);

                        City_map = Map.Replace(" ", "");

                        driver.FindElement(By.Id("filter_search_map")).SendKeys(City_map);
                        driver.FindElement(By.Id("filter_search_group")).SendKeys(Group);
                        driver.FindElement(By.Id("filter_search_parcel")).SendKeys(Parcel);

                        gc.CreatePdf(orderNumber, Parcel_ID, "City Parcel search", driver, "TN", "Hamilton");
                        driver.FindElement(By.XPath("//*[@id='content']/div[1]/form/div/div[2]/button")).SendKeys(Keys.Enter);
                        Thread.Sleep(2000);

                        driver.FindElement(By.XPath("//*[@id=\'content']/div/div[1]/form/table/tbody/tr/td[1]/a")).Click();
                        Thread.Sleep(2000);

                        //City Tax History Details
                        try
                        {
                            IWebElement         CityTaxPaymentTB = driver.FindElement(By.XPath("//*[@id='content']/div/div[1]/form/table[2]/tbody"));
                            IList <IWebElement> CityTaxPaymentTR = CityTaxPaymentTB.FindElements(By.TagName("tr"));
                            IList <IWebElement> CityTaxPaymentTD;

                            foreach (IWebElement CityTaxPayment in CityTaxPaymentTR)
                            {
                                CityTaxPaymentTD = CityTaxPayment.FindElements(By.TagName("td"));
                                if (CityTaxPaymentTD.Count != 0 && !CityTaxPayment.Text.Contains("Year"))
                                {
                                    City_Taxyear  = CityTaxPaymentTD[1].Text;
                                    City_Bill     = CityTaxPaymentTD[2].Text;
                                    CityBill_Type = CityTaxPaymentTD[3].Text;
                                    CityPro_Type  = CityTaxPaymentTD[4].Text;
                                    CityOwn_name  = CityTaxPaymentTD[5].Text;
                                    CityTol_Due   = CityTaxPaymentTD[6].Text;
                                    CityStatus    = CityTaxPaymentTD[7].Text;

                                    CityPayment_details = City_Taxyear + "~" + City_Bill + "~" + CityBill_Type + "~" + CityPro_Type + "~" + CityOwn_name + "~" + CityTol_Due + "~" + CityStatus;
                                    gc.CreatePdf(orderNumber, Parcel_ID, "CIty Tax History Details", driver, "TN", "Hamilton");
                                    gc.insert_date(orderNumber, Parcel_ID, 770, CityPayment_details, 1, DateTime.Now);
                                }
                            }
                        }
                        catch
                        { }

                        //City Info Details
                        List <string> CityInfoSearch = new List <string>();

                        try
                        {
                            IWebElement         CityInfo1TB = driver.FindElement(By.XPath("//*[@id='content']/div/div[1]/form/table[2]/tbody"));
                            IList <IWebElement> CityInfo1TR = CityInfo1TB.FindElements(By.TagName("tr"));
                            IList <IWebElement> CityInfo1TD;

                            int i = 0;
                            foreach (IWebElement CityInfo1 in CityInfo1TR)
                            {
                                if (i == 0 || i == 1 || i == 2)
                                {
                                    CityInfo1TD = CityInfo1.FindElements(By.TagName("td"));
                                    IWebElement CityInfo1_link = CityInfo1TD[0].FindElement(By.TagName("a"));
                                    string      CityInfo1url   = CityInfo1_link.GetAttribute("href");
                                    CityInfoSearch.Add(CityInfo1url);
                                }
                                i++;
                            }

                            foreach (string CityInfobill1 in CityInfoSearch)
                            {
                                driver.Navigate().GoToUrl(CityInfobill1);
                                Thread.Sleep(5000);

                                driver.SwitchTo().Window(driver.WindowHandles.Last());
                                Thread.Sleep(3000);

                                City_Flags       = driver.FindElement(By.XPath("//*[@id='ptaxweb-content']/table[1]/tbody/tr[1]/td[4]")).Text;
                                City_BillHash    = driver.FindElement(By.XPath("//*[@id='ptaxweb-content']/table[2]/tbody/tr/td[2]")).Text;
                                City_Bil_type    = driver.FindElement(By.XPath("//*[@id='ptaxweb-content']/table[3]/tbody/tr[1]/td[2]")).Text;
                                City_TaxBil_Year = driver.FindElement(By.XPath("//*[@id='ptaxweb-content']/table[3]/tbody/tr[1]/td[4]")).Text;
                                City_Bil_Status  = driver.FindElement(By.XPath("//*[@id='ptaxweb-content']/table[3]/tbody/tr[2]/td[2]")).Text;
                                City_Assessment  = driver.FindElement(By.XPath("//*[@id='ptaxweb-content']/table[3]/tbody/tr[4]/td[4]")).Text;

                                try
                                {
                                    IWebElement         Tax211TB = driver.FindElement(By.XPath("//*[@id='ptaxweb-content']/table[5]/tbody[2]"));
                                    IList <IWebElement> Tax211TR = Tax211TB.FindElements(By.TagName("tr"));
                                    IList <IWebElement> Tax211TD;
                                    foreach (IWebElement Tax211 in Tax211TR)
                                    {
                                        Tax211TD = Tax211.FindElements(By.TagName("td"));
                                        if (Tax211TD.Count != 0)
                                        {
                                            t_Inst = Tax211TD[0].Text;
                                            if (t_Inst.Contains("Taxes & Interest"))
                                            {
                                                Tax_Instr = Tax211TD[1].Text;
                                            }
                                            t_Water = Tax211TD[0].Text;
                                            if (t_Water.Contains("Water Quality Fee & Interest"))
                                            {
                                                Tax_Water = Tax211TD[1].Text;
                                            }
                                        }
                                    }
                                }
                                catch
                                { }

                                try
                                {
                                    IWebElement         Tax212TB = driver.FindElement(By.XPath("//*[@id='ptaxweb-content']/table[5]/tbody[2]"));
                                    IList <IWebElement> Tax212TR = Tax212TB.FindElements(By.TagName("tr"));
                                    IList <IWebElement> Tax212TD;
                                    foreach (IWebElement Tax212 in Tax212TR)
                                    {
                                        Tax212TD = Tax212.FindElements(By.TagName("td"));
                                        if (Tax212TD.Count != 0)
                                        {
                                            City_PaidDate   = Tax212TD[0].Text;
                                            City_PaidAmount = Tax212TD[1].Text;
                                        }
                                    }
                                }
                                catch
                                { }

                                try
                                {
                                    IWebElement         Tax21TB = driver.FindElement(By.XPath("//*[@id='ptaxweb-content']/table[6]/tbody[2]"));
                                    IList <IWebElement> Tax21TR = Tax21TB.FindElements(By.TagName("tr"));
                                    IList <IWebElement> Tax21TD;
                                    foreach (IWebElement Tax21 in Tax21TR)
                                    {
                                        Tax21TD = Tax21.FindElements(By.TagName("td"));
                                        if (Tax21TD.Count != 0)
                                        {
                                            City_PaidDate   = Tax21TD[0].Text;
                                            City_PaidAmount = Tax21TD[1].Text;
                                        }
                                    }
                                }
                                catch
                                { }

                                try
                                {
                                    IWebElement         Tax311TB = driver.FindElement(By.XPath("//*[@id='ptaxweb-content']/table[7]/tbody"));
                                    IList <IWebElement> Tax311TR = Tax311TB.FindElements(By.TagName("tr"));
                                    IList <IWebElement> Tax311TD;
                                    foreach (IWebElement Tax311 in Tax311TR)
                                    {
                                        Tax311TD = Tax311.FindElements(By.TagName("td"));
                                        if (Tax311TD.Count != 0)
                                        {
                                            tauth_Inst1 = Tax311TD[0].Text;
                                            if (tauth_Inst.Contains("Total Due"))
                                            {
                                                City_TotalDue = Tax311TD[1].Text;
                                            }
                                        }
                                    }
                                }
                                catch
                                { }

                                try
                                {
                                    IWebElement         Tax311TB = driver.FindElement(By.XPath("//*[@id='ptaxweb-content']/table[8]/tbody"));
                                    IList <IWebElement> Tax311TR = Tax311TB.FindElements(By.TagName("tr"));
                                    IList <IWebElement> Tax311TD;
                                    foreach (IWebElement Tax311 in Tax311TR)
                                    {
                                        Tax311TD = Tax311.FindElements(By.TagName("td"));
                                        if (Tax311TD.Count != 0)
                                        {
                                            tauth_Inst = Tax311TD[0].Text;
                                            if (tauth_Inst.Contains("Total Due"))
                                            {
                                                City_TotalDue = Tax311TD[1].Text;
                                            }
                                        }
                                    }
                                }
                                catch
                                { }

                                try
                                {
                                    CityTax_Authority = driver.FindElement(By.XPath("//*[@id='ptaxweb-content']/table[6]/tbody/tr/td")).Text;
                                    CityTax_Authority = WebDriverTest.After(CityTax_Authority, "MAKE CHECKS PAYABLE AND MAIL TO:");
                                }
                                catch
                                { }

                                try
                                {
                                    CityTax_Authority1 = driver.FindElement(By.XPath("//*[@id='ptaxweb-content']/table[7]/tbody/tr/td")).Text;
                                    CityTax_Authority1 = WebDriverTest.After(CityTax_Authority1, "MAKE CHECKS PAYABLE AND MAIL TO:");
                                }
                                catch
                                { }

                                CityTax_Deatils = City_Flags + "~" + City_BillHash + "~" + City_Bil_type + "~" + City_TaxBil_Year + "~" + City_Bil_Status + "~" + City_Assessment + "~" + City_PaidDate + "~" + City_PaidAmount + "~" + Tax_Instr + "~" + Tax_Water + "~" + City_TotalDue + "~" + CityTax_Authority + "~" + CityTax_Authority1;
                                gc.CreatePdf(orderNumber, Parcel_ID, "City Tax Details" + City_TaxBil_Year, driver, "TN", "Hamilton");
                                gc.insert_date(orderNumber, Parcel_ID, 771, CityTax_Deatils, 1, DateTime.Now);
                                City_PaidDate = ""; City_PaidAmount = ""; Tax_Instr = ""; Tax_Water = ""; City_TotalDue = "";

                                try
                                {
                                    IWebElement         CinfoTB = driver.FindElement(By.XPath("//*[@id='ptaxweb-content']/table[4]/tbody[2]"));
                                    IList <IWebElement> CinfoTR = CinfoTB.FindElements(By.TagName("tr"));
                                    IList <IWebElement> CinfoTD;
                                    foreach (IWebElement Cinfo in CinfoTR)
                                    {
                                        CinfoTD = Cinfo.FindElements(By.TagName("td"));
                                        if (CinfoTD.Count != 0)
                                        {
                                            Cinfo_Taxyear   = CinfoTD[0].Text;
                                            Cinfo_Transtype = CinfoTD[1].Text;
                                            Cinfo_Feetype   = CinfoTD[2].Text;
                                            Cinfo_Amount    = CinfoTD[3].Text;

                                            Cinfo_details = Cinfo_Taxyear + "~" + Cinfo_Transtype + "~" + Cinfo_Feetype + "~" + Cinfo_Amount;
                                            gc.insert_date(orderNumber, Parcel_ID, 772, Cinfo_details, 1, DateTime.Now);
                                        }
                                    }
                                }
                                catch
                                { }
                            }
                        }
                        catch { }
                    }
                    CitytaxTime = DateTime.Now.ToString("HH:mm:ss");

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

                    driver.Quit();
                    gc.mergpdf(orderNumber, "TN", "Hamilton");
                    return("Data Inserted Successfully");
                }
                catch (Exception ex)
                {
                    driver.Quit();
                    GlobalClass.LogError(ex, orderNumber);
                    throw;
                }
            }
        }
Esempio n. 12
0
        public string FTP_TXTravis(string streetno, string direction, string streetname, string city, string streettype, string unitnumber, string ownernm, string parcelNumber, string searchType, string orderNumber, string Account_id)
        {
            GlobalClass.global_orderNo             = orderNumber;
            HttpContext.Current.Session["orderNo"] = orderNumber;
            GlobalClass.global_parcelNo            = parcelNumber;

            string StartTime = "", AssessmentTime = "", TaxTime = "", CitytaxTime = "", LastEndTime = "";

            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");

                    if (searchType == "titleflex")
                    {
                        string titleaddress = streetno + " " + streetname + " " + unitnumber;
                        gc.TitleFlexSearch(orderNumber, parcelNumber, "", titleaddress, "TX", "Travis");
                        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_TXTravis"] = "Yes";
                            driver.Quit();
                            return("No Data Found");
                        }
                        parcelNumber = HttpContext.Current.Session["titleparcel"].ToString();
                        searchType   = "parcel";
                    }

                    if (searchType == "address")
                    {
                        driver.Navigate().GoToUrl("http://propaccess.traviscad.org/clientdb/?cid=1");
                        Thread.Sleep(2000);
                        //var Select1 = driver.FindElement(By.Id("propertySearchOptions_taxyear"));
                        //var selectElement11 = new SelectElement(Select1);
                        //selectElement11.SelectByIndex(1);
                        //Thread.Sleep(2000);
                        driver.FindElement(By.Id("propertySearchOptions_advanced")).Click();
                        Thread.Sleep(2000);

                        //Address = streetno + " " + streetname;
                        driver.FindElement(By.Id("propertySearchOptions_streetNumber")).SendKeys(streetno);
                        driver.FindElement(By.Id("propertySearchOptions_streetName")).SendKeys(streetname);
                        //driver.FindElement(By.Id("propertySearchOptions_searchText")).SendKeys(Address);
                        gc.CreatePdf_WOP(orderNumber, "address search", driver, "TX", "Travis");
                        driver.FindElement(By.Id("propertySearchOptions_searchAdv")).SendKeys(Keys.Enter);
                        Thread.Sleep(2000);

                        try
                        {
                            ChkMulti = driver.FindElement(By.XPath("//*[@id='pageTitle']/h2")).Text;
                            ChkMulti = WebDriverTest.Between(ChkMulti, "Property Search Results > ", " for");

                            if (ChkMulti == "1 - 1 of 1")
                            {
                                driver.FindElement(By.XPath("//*[@id='propertySearchResults_resultsTable']/tbody/tr[2]/td[10]/a")).Click();
                                Thread.Sleep(2000);
                                gc.CreatePdf_WOP(orderNumber, "Single Address search", driver, "TX", "Travis");
                            }
                            else
                            {
                                try
                                {
                                    IWebElement         MultiAddressTB = driver.FindElement(By.XPath("//*[@id='propertySearchResults_resultsTable']/tbody"));
                                    IList <IWebElement> MultiAddressTR = MultiAddressTB.FindElements(By.TagName("tr"));
                                    IList <IWebElement> MultiAddressTD;
                                    gc.CreatePdf_WOP(orderNumber, "Multi Address search", driver, "TX", "Travis");
                                    int AddressmaxCheck = 0;
                                    foreach (IWebElement MultiAddress in MultiAddressTR)
                                    {
                                        if (AddressmaxCheck <= 25 && MultiAddressTR.Count > 2)
                                        {
                                            MultiAddressTD = MultiAddress.FindElements(By.TagName("td"));
                                            if (MultiAddressTD.Count != 0 && !MultiAddress.Text.Contains("Mobile Home") && !MultiAddress.Text.Contains("     ") && !MultiAddress.Text.Contains("Page:   1"))
                                            {
                                                Parcelno         = MultiAddressTD[1].Text;
                                                Multi_Type       = MultiAddressTD[3].Text;
                                                Property_Address = MultiAddressTD[4].Text;
                                                Owner            = MultiAddressTD[6].Text;

                                                MultiAddress_details = Multi_Type + "~" + Property_Address + "~" + Owner;
                                                gc.insert_date(orderNumber, Parcelno, 1058, MultiAddress_details, 1, DateTime.Now);
                                            }
                                            AddressmaxCheck++;
                                        }
                                    }
                                    if (MultiAddressTR.Count <= 2)
                                    {
                                        HttpContext.Current.Session["Nodata_TXTravis"] = "Yes";
                                        driver.Quit();
                                        return("No Data Found");
                                    }
                                    if (MultiAddressTR.Count > 25)
                                    {
                                        HttpContext.Current.Session["multiParcel_TXTravis_Multicount"] = "Maximum";
                                    }
                                    else
                                    {
                                        HttpContext.Current.Session["multiParcel_TXTravis"] = "Yes";
                                    }
                                    driver.Quit();
                                    return("MultiParcel");
                                }
                                catch
                                { }
                            }
                        }
                        catch { }
                    }

                    if (searchType == "parcel")
                    {
                        driver.Navigate().GoToUrl("http://propaccess.traviscad.org/clientdb/?cid=1");
                        Thread.Sleep(2000);
                        //driver.FindElement(By.Id("propertySearchOptions_advanced")).Click();
                        //Thread.Sleep(2000);
                        driver.FindElement(By.Id("propertySearchOptions_searchText")).SendKeys(parcelNumber);
                        gc.CreatePdf(orderNumber, parcelNumber, "Parcel search", driver, "TX", "Travis");

                        driver.FindElement(By.Id("propertySearchOptions_search")).SendKeys(Keys.Enter);
                        Thread.Sleep(2000);
                        try
                        {
                            driver.FindElement(By.XPath("//*[@id='propertySearchResults_resultsTable']/tbody/tr[2]/td[10]/a")).Click();
                            Thread.Sleep(2000);
                        }
                        catch { }
                    }

                    if (searchType == "ownername")
                    {
                        driver.Navigate().GoToUrl("http://propaccess.traviscad.org/clientdb/?cid=1");
                        Thread.Sleep(2000);
                        driver.FindElement(By.Id("propertySearchOptions_advanced")).Click();
                        Thread.Sleep(2000);
                        driver.FindElement(By.Id("propertySearchOptions_ownerName")).SendKeys(ownernm);
                        gc.CreatePdf_WOP(orderNumber, "owner search", driver, "TX", "Travis");

                        driver.FindElement(By.Id("propertySearchOptions_searchAdv")).SendKeys(Keys.Enter);
                        Thread.Sleep(2000);
                        try
                        {
                            ChkMulti = driver.FindElement(By.XPath("//*[@id='pageTitle']/h2")).Text;
                            ChkMulti = WebDriverTest.Between(ChkMulti, "Property Search Results > ", " for");

                            if (ChkMulti == "1 - 1 of 1")
                            {
                                driver.FindElement(By.XPath("//*[@id='propertySearchResults_resultsTable']/tbody/tr[2]/td[10]/a")).Click();
                                Thread.Sleep(2000);
                                gc.CreatePdf_WOP(orderNumber, "Single Owner search", driver, "TX", "Travis");
                            }
                            else
                            {
                                try
                                {
                                    IWebElement         MultiAddressTB = driver.FindElement(By.XPath("//*[@id='propertySearchResults_resultsTable']/tbody"));
                                    IList <IWebElement> MultiAddressTR = MultiAddressTB.FindElements(By.TagName("tr"));
                                    IList <IWebElement> MultiAddressTD;
                                    gc.CreatePdf_WOP(orderNumber, "Multi Owner search", driver, "TX", "Travis");
                                    int AddressmaxCheck = 0;
                                    foreach (IWebElement MultiAddress in MultiAddressTR)
                                    {
                                        if (AddressmaxCheck <= 25)
                                        {
                                            MultiAddressTD = MultiAddress.FindElements(By.TagName("td"));
                                            if (MultiAddressTD.Count != 0 && !MultiAddress.Text.Contains("Mobile Home") && !MultiAddress.Text.Contains("     ") && !MultiAddress.Text.Contains("Page:   1"))
                                            {
                                                Parcelno         = MultiAddressTD[1].Text;
                                                Multi_Type       = MultiAddressTD[3].Text;
                                                Property_Address = MultiAddressTD[4].Text;
                                                Owner            = MultiAddressTD[6].Text;

                                                MultiAddress_details = Multi_Type + "~" + Property_Address + "~" + Owner;
                                                gc.insert_date(orderNumber, Parcelno, 1058, MultiAddress_details, 1, DateTime.Now);
                                            }
                                            AddressmaxCheck++;
                                        }
                                    }
                                    if (MultiAddressTR.Count > 25)
                                    {
                                        HttpContext.Current.Session["multiParcel_TXTravis_Multicount"] = "Maximum";
                                    }
                                    else
                                    {
                                        HttpContext.Current.Session["multiParcel_TXTravis"] = "Yes";
                                    }
                                    driver.Quit();
                                    return("MultiParcel");
                                }
                                catch
                                { }
                            }
                        }
                        catch { }
                    }

                    else if (searchType == "block")
                    {
                        driver.Navigate().GoToUrl("http://propaccess.traviscad.org/clientdb/?cid=1");
                        Thread.Sleep(2000);

                        driver.FindElement(By.Id("propertySearchOptions_searchText")).SendKeys(Account_id);
                        gc.CreatePdf_WOP(orderNumber, "Account Number Search ", driver, "TX", "Travis");

                        driver.FindElement(By.Id("propertySearchOptions_search")).SendKeys(Keys.Enter);
                        Thread.Sleep(2000);
                        try
                        {
                            driver.FindElement(By.XPath("//*[@id='propertySearchResults_resultsTable']/tbody/tr[2]/td[10]/a")).Click();
                            Thread.Sleep(2000);
                        }
                        catch { }
                    }

                    try
                    {
                        IWebElement INodata = driver.FindElement(By.Id("propertySearchResults_pageHeading"));
                        if (INodata.Text.Contains("None found"))
                        {
                            HttpContext.Current.Session["Nodata_TXTravis"] = "Yes";
                            driver.Quit();
                            return("No Data Found");
                        }
                    }
                    catch { }

                    //property details
                    try
                    {
                        fulltext         = driver.FindElement(By.XPath("//*[@id='propertyDetails']/table/tbody")).Text.Replace("\r\n", " ");
                        PropertyID       = gc.Between(fulltext, "Account Property ID: ", " Legal Description: ");
                        GeographicID     = gc.Between(fulltext, "Geographic ID: ", " Zoning: ");
                        Type             = gc.Between(fulltext, "Type: ", " Agent Code: ");
                        LegalDescription = gc.Between(fulltext, " Legal Description: ", " Geographic ID: ");
                        ProAddress       = gc.Between(fulltext, "Location Address: ", " Mapsco: ");
                        try
                        {
                            Neighborhood = gc.Between(fulltext, "Neighborhood: ", " Map ID: ");
                        }
                        catch
                        { }
                        NeighborhoodCD = gc.Between(fulltext, " Neighborhood CD: ", " Owner Name: ");
                        MapID          = gc.Between(fulltext, "Map ID: ", " Neighborhood CD: ");
                        Name           = gc.Between(fulltext, "Owner Name: ", " Owner ID: ");
                        MailingAddress = gc.Between(fulltext, "Mailing Address: ", " % Ownership:");
                        OwnerID        = gc.Between(fulltext, "Owner ID: ", " Mailing Address: ");
                        Exemptions     = GlobalClass.After(fulltext, "Exemptions: ");
                        gc.CreatePdf(orderNumber, PropertyID, "Property Info1", driver, "TX", "Travis");
                        try
                        {
                            driver.FindElement(By.XPath("//*[@id='improvementBuilding']")).Click();
                            Thread.Sleep(2000);
                            YearBuilt = driver.FindElement(By.XPath("//*[@id='improvementBuildingDetails']/table[2]/tbody/tr[2]/td[6]")).Text;
                            gc.CreatePdf(orderNumber, PropertyID, "Property Info2", driver, "TX", "Travis");
                        }
                        catch { }

                        try
                        {
                            driver.FindElement(By.Id("land")).Click();
                            Thread.Sleep(2000);
                            Acres = driver.FindElement(By.XPath("//*[@id='landDetails']/table/tbody/tr[2]/td[4]")).Text;
                            gc.CreatePdf(orderNumber, PropertyID, "Property Info3", driver, "TX", "Travis");
                        }
                        catch { }

                        property_details = GeographicID + "~" + Type + "~" + LegalDescription + "~" + ProAddress + "~" + Neighborhood + "~" + NeighborhoodCD + "~" + MapID + "~" + Name + "~" + MailingAddress + "~" + OwnerID + "~" + Exemptions + "~" + YearBuilt + "~" + Acres;
                        gc.insert_date(orderNumber, PropertyID, 1074, property_details, 1, DateTime.Now);
                    }
                    catch
                    { }

                    //Assessment Details
                    try
                    {
                        driver.FindElement(By.Id("values")).Click();
                        Thread.Sleep(2000);
                        gc.CreatePdf(orderNumber, PropertyID, "Value Info", driver, "TX", "Travis");
                        IWebElement         AssessmentTable = driver.FindElement(By.XPath("//*[@id='valuesDetails']/table/tbody"));
                        IList <IWebElement> AssessmentTR    = AssessmentTable.FindElements(By.TagName("tr"));
                        IList <IWebElement> AssessmentTD;
                        foreach (IWebElement Assessment in AssessmentTR)
                        {
                            AssessmentTD = Assessment.FindElements(By.TagName("td"));
                            if (AssessmentTD.Count != 0 && AssessmentTD[0].Text != " ")
                            {
                                ValueDetails = AssessmentTD[0].Text.Trim() + "~" + AssessmentTD[1].Text.Trim() + "~" + AssessmentTD[2].Text.Trim() + "~" + AssessmentTD[3].Text.Trim();
                                gc.insert_date(orderNumber, PropertyID, 1076, ValueDetails, 1, DateTime.Now);
                            }
                        }
                    }
                    catch
                    { }

                    //Taxing Jurisdiction Details
                    try
                    {
                        driver.FindElement(By.Id("taxingJurisdiction")).Click();
                        Thread.Sleep(2000);

                        fulltext1     = driver.FindElement(By.XPath("//*[@id='taxingJurisdictionDetails']/table[1]/tbody")).Text.Replace("\r\n", " ");
                        owner         = gc.Between(fulltext1, "Owner:", "% Ownership:");
                        Ownership     = gc.Between(fulltext1, "% Ownership:", "Total Value:");
                        TotalValue    = GlobalClass.After(fulltext1, "Total Value:");
                        ValueDetails1 = owner + "~" + Ownership + "~" + TotalValue + "~" + "" + "~" + "" + "~" + "" + "~" + "" + "~" + "" + "~" + "";
                        gc.insert_date(orderNumber, PropertyID, 1078, ValueDetails1, 1, DateTime.Now);
                        gc.CreatePdf(orderNumber, PropertyID, "Jurisdiction Info", driver, "TX", "Travis");
                        IWebElement         JurisdictionTable = driver.FindElement(By.XPath("//*[@id='taxingJurisdictionDetails']/table[2]/tbody"));
                        IList <IWebElement> JurisdictionTR    = JurisdictionTable.FindElements(By.TagName("tr"));
                        IList <IWebElement> JurisdictionTD;
                        foreach (IWebElement row in JurisdictionTR)
                        {
                            JurisdictionTD = row.FindElements(By.TagName("td"));
                            if (JurisdictionTD.Count != 0)
                            {
                                ValueDetails1 = " " + "~" + " " + "~" + " " + "~" + JurisdictionTD[0].Text.Trim() + "~" + JurisdictionTD[1].Text.Trim() + "~" + JurisdictionTD[2].Text.Trim() + "~" + JurisdictionTD[3].Text.Trim() + "~" + JurisdictionTD[4].Text.Trim() + "~" + JurisdictionTD[5].Text.Trim();
                                gc.insert_date(orderNumber, PropertyID, 1078, ValueDetails1, 1, DateTime.Now);
                            }
                        }
                    }
                    catch
                    { }

                    //Roll Value History Details
                    try
                    {
                        driver.FindElement(By.Id("rollHistory")).Click();
                        Thread.Sleep(2000);
                        IWebElement         RollTable = driver.FindElement(By.XPath("//*[@id='rollHistoryDetails']/table/tbody"));
                        IList <IWebElement> RollTR    = RollTable.FindElements(By.TagName("tr"));
                        IList <IWebElement> RollTD;

                        foreach (IWebElement Roll in RollTR)
                        {
                            RollTD = Roll.FindElements(By.TagName("td"));
                            if (RollTD.Count != 0)
                            {
                                rollDetails = RollTD[0].Text.Trim() + "~" + RollTD[1].Text.Trim() + "~" + RollTD[2].Text.Trim() + "~" + RollTD[3].Text.Trim() + "~" + RollTD[4].Text.Trim() + "~" + RollTD[5].Text.Trim() + "~" + RollTD[6].Text.Trim();
                                gc.insert_date(orderNumber, PropertyID, 1077, rollDetails, 1, DateTime.Now);
                                gc.CreatePdf(orderNumber, PropertyID, "Roll Info", driver, "TX", "Travis");
                            }
                        }
                    }
                    catch
                    { }
                    AssessmentTime = DateTime.Now.ToString("HH:mm:ss");

                    driver.Navigate().GoToUrl("https://travis.go2gov.net/cart/search/quickSearch.do");
                    Thread.Sleep(2000);

                    driver.FindElement(By.XPath("//*[@id='quickSearchForm']/input[6]")).SendKeys(GeographicID);
                    gc.CreatePdf(orderNumber, GeographicID, "Tax Search Info", driver, "TX", "Travis");
                    driver.FindElement(By.XPath("//*[@id='quickSearchForm']/button")).SendKeys(Keys.Enter);
                    Thread.Sleep(2000);

                    driver.FindElement(By.XPath("/html/body/div[3]/form[1]/div/table/tbody/tr/td/center/table/tbody/tr[3]/td[3]/span/a")).Click();
                    Thread.Sleep(2000);
                    gc.CreatePdf(orderNumber, GeographicID, "Tax Info", driver, "TX", "Travis");
                    try
                    {
                        //Tax Bill Details
                        Account       = driver.FindElement(By.XPath("//*[@id='accountSummarySubView:accountSummaryForm']/table/tbody/tr[1]/td/table/tbody/tr[2]/td/table/tbody/tr/td[1]")).Text;
                        Tax_Owner     = driver.FindElement(By.XPath("//*[@id='accountSummarySubView:accountSummaryForm']/table/tbody/tr[1]/td/table/tbody/tr[2]/td/table/tbody/tr/td[2]")).Text;
                        Tax_Mailing   = driver.FindElement(By.XPath("//*[@id='accountSummarySubView:accountSummaryForm']/table/tbody/tr[1]/td/table/tbody/tr[2]/td/table/tbody/tr/td[3]")).Text;
                        Tax_LegalDesp = driver.FindElement(By.XPath("//*[@id='accountSummarySubView:accountSummaryForm']/table/tbody/tr[1]/td/table/tbody/tr[2]/td/table/tbody/tr/td[4]")).Text;

                        try
                        {
                            Tax_Year        = driver.FindElement(By.XPath("//*[@id='accountSummarySubView:accountSummaryForm']/table/tbody/tr[4]/td/table/tbody/tr[2]/td/table/tbody/tr/td[1]")).Text;
                            Base_Due        = driver.FindElement(By.XPath("//*[@id='accountSummarySubView:accountSummaryForm']/table/tbody/tr[4]/td/table/tbody/tr[2]/td/table/tbody/tr/td[2]")).Text;
                            Penalty_Interst = driver.FindElement(By.XPath("//*[@id='accountSummarySubView:accountSummaryForm']/table/tbody/tr[4]/td/table/tbody/tr[2]/td/table/tbody/tr/td[3]")).Text;
                            OtherFee        = driver.FindElement(By.XPath("//*[@id='accountSummarySubView:accountSummaryForm']/table/tbody/tr[4]/td/table/tbody/tr[2]/td/table/tbody/tr/td[4]")).Text;
                            Tax_Total       = driver.FindElement(By.XPath("//*[@id='accountSummarySubView:accountSummaryForm']/table/tbody/tr[4]/td/table/tbody/tr[2]/td/table/tbody/tr/td[5]")).Text;
                        }
                        catch
                        { }

                        try
                        {
                            string Previous_Year = driver.FindElement(By.XPath("//*[@id='accountSummarySubView:accountSummaryForm']/table/tbody/tr[3]/td/table/thead/tr/th")).Text;
                            Previous_Year = WebDriverTest.After(Previous_Year, "Previous Tax Year ");

                            if (Previous_Year == "Taxes Due")
                            {
                                try
                                {
                                    Tax_Year        = driver.FindElement(By.XPath("//*[@id='accountSummarySubView:accountSummaryForm']/table/tbody/tr[5]/td/table/tbody/tr[2]/td/table/tbody/tr/td[1]")).Text;
                                    Base_Due        = driver.FindElement(By.XPath("//*[@id='accountSummarySubView:accountSummaryForm']/table/tbody/tr[5]/td/table/tbody/tr[2]/td/table/tbody/tr/td[2]")).Text;
                                    Penalty_Interst = driver.FindElement(By.XPath("//*[@id='accountSummarySubView:accountSummaryForm']/table/tbody/tr[5]/td/table/tbody/tr[2]/td/table/tbody/tr/td[3]")).Text;
                                    OtherFee        = driver.FindElement(By.XPath("//*[@id='accountSummarySubView:accountSummaryForm']/table/tbody/tr[5]/td/table/tbody/tr[2]/td/table/tbody/tr/td[4]")).Text;
                                    Tax_Total       = driver.FindElement(By.XPath("//*[@id='accountSummarySubView:accountSummaryForm']/table/tbody/tr[5]/td/table/tbody/tr[2]/td/table/tbody/tr/td[5]")).Text;
                                }
                                catch
                                { }

                                //Deliquent Details
                                driver.FindElement(By.XPath("//*[@id='accountSummarySubView:accountSummaryForm:_idJsp89']")).Click();
                                Thread.Sleep(2000);

                                IWebElement         DeliquentTB = driver.FindElement(By.XPath("//*[@id='accountYearDetailSubView:accountYearDetailForm:_idJsp81']/tbody"));
                                IList <IWebElement> DeliquentTR = DeliquentTB.FindElements(By.TagName("tr"));
                                IList <IWebElement> DeliquentTD;
                                gc.CreatePdf(orderNumber, GeographicID, "Deliquent Info", driver, "TX", "Travis");
                                foreach (IWebElement Deliquent in DeliquentTR)
                                {
                                    DeliquentTD = Deliquent.FindElements(By.TagName("td"));
                                    if (DeliquentTD.Count != 0)
                                    {
                                        Deliquent_Year    = DeliquentTD[0].Text;
                                        Deliquent_Base    = DeliquentTD[1].Text;
                                        Deliquent_Intrest = DeliquentTD[2].Text;
                                        Deliquent_Fees    = DeliquentTD[3].Text;
                                        Deliquent_Total   = DeliquentTD[4].Text;

                                        Deliquent_Details = Deliquent_Year + "~" + Deliquent_Base + "~" + Deliquent_Intrest + "~" + Deliquent_Fees + "~" + Deliquent_Total;
                                        gc.insert_date(orderNumber, GeographicID, 1095, Deliquent_Details, 1, DateTime.Now);
                                    }
                                }

                                IWebElement         DeliquentTB1 = driver.FindElement(By.XPath("//*[@id='accountYearDetailSubView:accountYearDetailForm:_idJsp81']/tfoot/tr/td/table/tbody/tr[2]/td/table/tbody"));
                                IList <IWebElement> DeliquentTR1 = DeliquentTB1.FindElements(By.TagName("tr"));
                                IList <IWebElement> DeliquentTD1;

                                foreach (IWebElement Deliquent1 in DeliquentTR1)
                                {
                                    DeliquentTD1 = Deliquent1.FindElements(By.TagName("td"));
                                    if (DeliquentTD1.Count != 0)
                                    {
                                        Deliquent_Year1    = DeliquentTD1[0].Text;
                                        Deliquent_Base1    = DeliquentTD1[1].Text;
                                        Deliquent_Intrest1 = DeliquentTD1[2].Text;
                                        Deliquent_Fees1    = DeliquentTD1[3].Text;
                                        Deliquent_Total1   = DeliquentTD1[4].Text;

                                        Deliquent_Details1 = Deliquent_Year1 + "~" + Deliquent_Base1 + "~" + Deliquent_Intrest1 + "~" + Deliquent_Fees1 + "~" + Deliquent_Total1;
                                        gc.insert_date(orderNumber, GeographicID, 1095, Deliquent_Details1, 1, DateTime.Now);
                                    }
                                }
                                driver.Navigate().Back();
                                Thread.Sleep(2000);
                            }

                            Deliquent_Comments = "For prior year tax amount due, you must call the Collector's Office.";
                        }
                        catch
                        { }
                    }
                    catch
                    { }

                    //Taxing Unit Details
                    try
                    {
                        driver.FindElement(By.XPath("//*[@id='accountSummarySubView:accountSummaryForm:_idJsp73']")).Click();
                        Thread.Sleep(2000);

                        try
                        {
                            Taxyear_detail  = driver.FindElement(By.XPath("//*[@id='accountYearDetailSubView:accountYearDetailForm']/table/tbody/tr[3]/td")).Text;
                            TaxYear_Details = Taxyear_detail + "~" + "" + "~" + "" + "~" + "" + "~" + "" + "~" + "" + "~" + "" + "~" + "";
                            gc.insert_date(orderNumber, GeographicID, 1089, TaxYear_Details, 1, DateTime.Now);
                        }
                        catch
                        { }
                        IWebElement         TaxUnitTB = driver.FindElement(By.XPath("//*[@id='accountYearDetailSubView:accountYearDetailForm:_idJsp83']/tbody"));
                        IList <IWebElement> TaxUnitTR = TaxUnitTB.FindElements(By.TagName("tr"));
                        IList <IWebElement> TaxUnitTD;
                        gc.CreatePdf(orderNumber, GeographicID, "Tax Unit Info", driver, "TX", "Travis");
                        foreach (IWebElement TaxUnit in TaxUnitTR)
                        {
                            TaxUnitTD = TaxUnit.FindElements(By.TagName("td"));
                            if (TaxUnitTD.Count != 0)
                            {
                                Tax_Unit    = TaxUnitTD[0].Text;
                                Assed_Value = TaxUnitTD[1].Text;
                                NetTaxb_Val = TaxUnitTD[2].Text;
                                Basedue_Val = TaxUnitTD[3].Text;
                                Penalty_Val = TaxUnitTD[4].Text;
                                Attrney_Val = TaxUnitTD[5].Text;
                                Total_Val   = TaxUnitTD[6].Text;

                                TaxUnit_Details = "" + "~" + Tax_Unit + "~" + Assed_Value + "~" + NetTaxb_Val + "~" + Basedue_Val + "~" + Penalty_Val + "~" + Attrney_Val + "~" + Total_Val;
                                gc.insert_date(orderNumber, GeographicID, 1089, TaxUnit_Details, 1, DateTime.Now);
                            }
                        }

                        IWebElement         TaxUnitTB1 = driver.FindElement(By.XPath("//*[@id='accountYearDetailSubView:accountYearDetailForm:_idJsp83']/tfoot/tr/td/table/tbody/tr[2]/td/table/tbody"));
                        IList <IWebElement> TaxUnitTR1 = TaxUnitTB1.FindElements(By.TagName("tr"));
                        IList <IWebElement> TaxUnitTD1;

                        foreach (IWebElement TaxUnit1 in TaxUnitTR1)
                        {
                            TaxUnitTD1 = TaxUnit1.FindElements(By.TagName("td"));
                            if (TaxUnitTD1.Count != 0)
                            {
                                Tax_Unit1    = TaxUnitTD1[0].Text;
                                Assed_Value1 = TaxUnitTD1[1].Text;
                                NetTaxb_Val1 = TaxUnitTD1[2].Text;
                                Basedue_Val1 = TaxUnitTD1[3].Text;
                                Penalty_Val1 = TaxUnitTD1[4].Text;
                                Attrney_Val1 = TaxUnitTD1[5].Text;
                                Total_Val1   = TaxUnitTD1[6].Text;

                                TaxUnit_Details1 = "" + "~" + Tax_Unit1 + "~" + Assed_Value1 + "~" + NetTaxb_Val1 + "~" + Basedue_Val1 + "~" + Penalty_Val1 + "~" + Attrney_Val1 + "~" + Total_Val1;
                                gc.insert_date(orderNumber, GeographicID, 1089, TaxUnit_Details1, 1, DateTime.Now);
                            }
                        }
                    }
                    catch
                    { }

                    //Tax Payment Details
                    try
                    {
                        driver.FindElement(By.XPath("//*[@id='quickSearchSubView:quickSearchForm:_idJsp38']")).Click();
                        Thread.Sleep(2000);

                        IWebElement         TaxPaymentTB = driver.FindElement(By.XPath("//*[@id='legalPaymentHistorySubView:legalPaymentHistoryForm:data']/tbody"));
                        IList <IWebElement> TaxPaymentTR = TaxPaymentTB.FindElements(By.TagName("tr"));
                        IList <IWebElement> TaxPaymentTD;
                        gc.CreatePdf(orderNumber, GeographicID, "Tax Payment Info", driver, "TX", "Travis");
                        foreach (IWebElement TaxPayment in TaxPaymentTR)
                        {
                            TaxPaymentTD = TaxPayment.FindElements(By.TagName("td"));
                            if (TaxPaymentTD.Count != 0)
                            {
                                Receipt               = TaxPaymentTD[0].Text;
                                Receipt_Taxyear       = TaxPaymentTD[1].Text;
                                Receipt_PaymentDate   = TaxPaymentTD[2].Text;
                                Receipt_PaymentAmount = TaxPaymentTD[3].Text;

                                TaxPayment_Details = Receipt + "~" + Receipt_Taxyear + "~" + Receipt_PaymentDate + "~" + Receipt_PaymentAmount;
                                gc.insert_date(orderNumber, GeographicID, 1094, TaxPayment_Details, 1, DateTime.Now);
                            }
                        }
                    }
                    catch
                    { }

                    List <string> ReceiptInfoTab = new List <string>();
                    try
                    {
                        var chromeOptions     = new ChromeOptions();
                        var downloadDirectory = ConfigurationManager.AppSettings["AutoPdf"];
                        chromeOptions.AddUserProfilePreference("download.default_directory", downloadDirectory);
                        chromeOptions.AddUserProfilePreference("download.prompt_for_download", false);
                        chromeOptions.AddUserProfilePreference("disable-popup-blocking", "true");
                        chromeOptions.AddUserProfilePreference("plugins.always_open_pdf_externally", true);
                        var driver1 = new ChromeDriver(chromeOptions);
                        driver1.Navigate().GoToUrl(driver.Url);

                        for (int j = 0; j < 3; j++)
                        {
                            IWebElement Receipttable = driver1.FindElement(By.XPath("//*[@id='legalPaymentHistorySubView:legalPaymentHistoryForm:data:" + j + ":_idJsp87']"));
                            string      BillTax2     = Receipttable.GetAttribute("href");
                            Receipttable.Click();
                            Thread.Sleep(3000);
                            var      files       = new DirectoryInfo(downloadDirectory).GetFiles("*.*");
                            string   latestfile  = "";
                            DateTime lastupdated = DateTime.MinValue;
                            foreach (FileInfo file in files)
                            {
                                if (file.LastWriteTime > lastupdated)
                                {
                                    lastupdated = file.LastWriteTime;
                                    latestfile  = file.Name;
                                }
                            }
                            gc.AutoDownloadFile(orderNumber, parcelNumber, "Travis", "TX", latestfile);
                        }

                        //Bill Download
                        try
                        {
                            IWebElement OriginalTaxBill = driver1.FindElement(By.Id("quickSearchSubView:quickSearchForm:_idJsp41"));
                            OriginalTax = OriginalTaxBill.GetAttribute("href");
                            string Original_Tax = gc.Between(OriginalTax, ".net/", "?").Trim();
                            OriginalTaxBill.Click();
                            Thread.Sleep(3000);
                            gc.AutoDownloadFileSpokane(orderNumber, parcelNumber, "Travis", "TX", Original_Tax + ".pdf");
                        }
                        catch
                        { }

                        try
                        {
                            IWebElement PriceTaxBill = driver1.FindElement(By.Id("quickSearchSubView:quickSearchForm:_idJsp47"));
                            PriceTax = PriceTaxBill.GetAttribute("href");
                            string priceTax_Bill = gc.Between(PriceTax, ".net/", "?").Trim();
                            PriceTaxBill.Click();
                            Thread.Sleep(3000);
                            gc.AutoDownloadFileSpokane(orderNumber, parcelNumber, "Travis", "TX", priceTax_Bill + ".pdf");
                        }
                        catch
                        { }

                        try
                        {
                            IWebElement CurrentTaxBill = driver1.FindElement(By.Id("quickSearchSubView:quickSearchForm:_idJsp50"));
                            CurrentTax = CurrentTaxBill.GetAttribute("href");
                            string Current_TaxBill = gc.Between(CurrentTax, ".net/", "?").Trim();
                            CurrentTaxBill.Click();
                            Thread.Sleep(3000);
                            gc.AutoDownloadFileSpokane(orderNumber, parcelNumber, "Travis", "TX", Current_TaxBill + ".pdf");
                        }
                        catch
                        { }

                        driver1.Quit();
                    }
                    catch
                    { }

                    try
                    {
                        driver.Navigate().GoToUrl("https://tax-office.traviscountytx.gov/contact");
                        Thread.Sleep(2000);

                        MainNumber = driver.FindElement(By.XPath("//*[@id='tab1']/div/div/p[1]")).Text;
                        MainNumber = WebDriverTest.Before(MainNumber, " Monday - Friday");

                        driver.FindElement(By.XPath("//*[@id='container']/div/div[2]/div/ul/li[2]/a")).Click();
                        Thread.Sleep(1000);
                        gc.CreatePdf(orderNumber, GeographicID, "Tax Authority", driver, "TX", "Travis");
                        Authotity     = driver.FindElement(By.XPath("//*[@id='tab2']/div/div/p[3]")).Text;
                        Tax_Authority = Authotity + " " + MainNumber;
                    }
                    catch
                    { }

                    ValueDetails1 = Tax_Year + "~" + Account + "~" + Tax_Owner + "~" + Tax_Mailing + "~" + Tax_LegalDesp + "~" + Base_Due + "~" + Penalty_Interst + "~" + OtherFee + "~" + Tax_Total + "~" + Tax_Authority + "~" + Deliquent_Comments;
                    gc.insert_date(orderNumber, GeographicID, 1079, ValueDetails1, 1, DateTime.Now);
                    TaxTime = DateTime.Now.ToString("HH:mm:ss");

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

                    driver.Quit();
                    gc.mergpdf(orderNumber, "TX", "Travis");
                    return("Data Inserted Successfully");
                }
                catch (Exception ex)
                {
                    driver.Quit();
                    GlobalClass.LogError(ex, orderNumber);
                    throw;
                }
            }
        }