예제 #1
0
        public string FTP_WaltonGA(string address, string parcelNumber, string searchType, string ownername, 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("https://qpublic.schneidercorp.com/Application.aspx?App=WaltonCountyGA&Layer=Parcels&PageType=Search");
                    Thread.Sleep(4000);
                    try
                    {
                        driver.FindElement(By.LinkText("Agree")).Click();
                        Thread.Sleep(1000);
                    }
                    catch { }
                    if (searchType == "titleflex")
                    {
                        string titleaddress = address;
                        gc.TitleFlexSearch(orderNumber, "", "", titleaddress, "GA", "Walton");
                        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_WaltonGA"] = "Yes";
                            driver.Quit();
                            return("No Data Found");
                        }
                        parcelNumber = HttpContext.Current.Session["titleparcel"].ToString();
                        searchType   = "parcel";
                    }

                    if (searchType == "address")
                    {
                        driver.FindElement(By.Id("ctlBodyPane_ctl01_ctl01_txtAddress")).SendKeys(address);
                        gc.CreatePdf_WOP(orderNumber, "Address search", driver, "GA", "Walton");
                        driver.FindElement(By.Id("ctlBodyPane_ctl01_ctl01_btnSearch")).SendKeys(Keys.Enter);
                        Thread.Sleep(4000);
                        gc.CreatePdf_WOP(orderNumber, "Address Search result", driver, "GA", "Walton");
                        try
                        {
                            int                 Max = 0;
                            string              strowner = "", strAddress = "", strCity = "";
                            IWebElement         multiaddress = driver.FindElement(By.XPath("//*[@id='ContentPlaceHolder1_gvSearchResults']/tbody"));
                            IList <IWebElement> multiRow     = multiaddress.FindElements(By.TagName("tr"));
                            IList <IWebElement> multiTD;
                            foreach (IWebElement multi in multiRow)
                            {
                                multiTD = multi.FindElements(By.TagName("td"));
                                if (multiTD.Count != 0 && multiRow.Count < 3)
                                {
                                    IWebElement IsearchClick = driver.FindElement(By.XPath("//*[@id='ContentPlaceHolder1_gvSearchResults']/tbody/tr[2]/td[1]/a"));
                                    IsearchClick.Click();
                                    Thread.Sleep(2000);
                                    Max++;
                                    break;
                                }
                                if (multiTD.Count != 0 && multiRow.Count > 25)
                                {
                                    HttpContext.Current.Session["multiparcel_WaltonGA_Maximum"] = "Maximum";
                                    driver.Quit();
                                    return("Maximum");
                                }
                                if (multiTD.Count != 0 && multiRow.Count > 2 && multiRow.Count <= 25)
                                {
                                    strowner   = multiTD[1].Text;
                                    strAddress = multiTD[2].Text;

                                    string multidetails = strowner + "~" + strAddress;
                                    gc.insert_date(orderNumber, multiTD[0].Text, 1431, multidetails, 1, DateTime.Now);
                                    Max++;
                                }
                            }
                            if (Max > 1 && Max < 26)
                            {
                                HttpContext.Current.Session["multiparcel_WaltonGA"] = "Yes";
                                driver.Quit();
                                return("MultiParcel");
                            }
                            if (Max == 0)
                            {
                                HttpContext.Current.Session["Nodata_WaltonGA"] = "Yes";
                                driver.Quit();
                                return("No Data Found");
                            }
                        }
                        catch { }
                    }

                    //else if (searchType == "ownername")
                    //{
                    //    try
                    //    {
                    //        driver.FindElement(By.Id("ContentPlaceHolder1_btnDisclaimerAccept")).Click();
                    //        Thread.Sleep(1000);
                    //    }
                    //    catch { }
                    //    try
                    //    {
                    //        driver.FindElement(By.LinkText("Owner")).Click();
                    //        Thread.Sleep(1000);
                    //    }
                    //    catch { }
                    //    string Lastname = "", Firstname = "";
                    //    try
                    //    {
                    //        var ownersplit = ownername.Trim().Split(' ');
                    //        Lastname = ownersplit[0];
                    //        Firstname = ownersplit[1];
                    //        driver.FindElement(By.Id("ContentPlaceHolder1_Owner_tbOwnerLastName")).SendKeys(Lastname);
                    //        driver.FindElement(By.Id("ContentPlaceHolder1_Owner_tbOwnerFirstName")).SendKeys(Firstname);
                    //        ownername = Lastname + " " + Firstname;
                    //    }
                    //    catch { }

                    //    gc.CreatePdf_WOP(orderNumber, "OwnerName Search", driver, "GA", "Walton");
                    //    driver.FindElement(By.Id("ContentPlaceHolder1_Owner_btnSearchOwner")).SendKeys(Keys.Enter);
                    //    Thread.Sleep(3000);
                    //    gc.CreatePdf_WOP(orderNumber, "OwnerName Search Results", driver, "GA", "Walton");
                    //    try
                    //    {
                    //        int Max = 0;
                    //        string strowner = "", strAddress = "", strCity = "";
                    //        IWebElement multiaddress = driver.FindElement(By.XPath("//*[@id='ContentPlaceHolder1_gvSearchResults']/tbody"));
                    //        IList<IWebElement> multiRow = multiaddress.FindElements(By.TagName("tr"));
                    //        IList<IWebElement> multiTD;
                    //        foreach (IWebElement multi in multiRow)
                    //        {
                    //            multiTD = multi.FindElements(By.TagName("td"));
                    //            if (multiTD.Count != 0 && multiRow.Count < 2)
                    //            {
                    //                IWebElement IsearchClick = driver.FindElement(By.XPath("//*[@id='ContentPlaceHolder1_gvSearchResults']/tbody/tr[2]/td[1]/a"));
                    //                IsearchClick.Click();
                    //                Thread.Sleep(2000);
                    //                break;
                    //            }
                    //            if (multiTD.Count != 0 && multiRow.Count > 25)
                    //            {
                    //                HttpContext.Current.Session["multiparcel_WayneOH_Maximum"] = "Maximum";
                    //                driver.Quit();
                    //                return "Maximum";
                    //            }
                    //            if (multiTD.Count != 0 && multiRow.Count > 2 && multiRow.Count <= 25)
                    //            {
                    //                strowner = multiTD[1].Text;
                    //                strAddress = multiTD[2].Text;

                    //                string multidetails = strowner + "~" + strAddress;
                    //                gc.insert_date(orderNumber, multiTD[0].Text, 1431, multidetails, 1, DateTime.Now);
                    //                Max++;
                    //            }
                    //        }
                    //        if (Max > 1 && Max < 26)
                    //        {
                    //            HttpContext.Current.Session["multiparcel_WayneOH"] = "Yes";
                    //            driver.Quit();
                    //            return "MultiParcel";
                    //        }
                    //        if (Max == 0)
                    //        {
                    //            HttpContext.Current.Session["Zero_Wayne"] = "Zero";
                    //            driver.Quit();
                    //            return "Zero";
                    //        }
                    //    }
                    //    catch { }
                    //}


                    else if (searchType == "parcel")
                    {
                        driver.FindElement(By.Id("ctlBodyPane_ctl02_ctl01_txtParcelID")).SendKeys(parcelNumber);
                        gc.CreatePdf(orderNumber, parcelNumber, "parcel search", driver, "GA", "Walton");
                        driver.FindElement(By.Id("ctlBodyPane_ctl02_ctl01_btnSearch")).SendKeys(Keys.Enter);
                        Thread.Sleep(3000);
                        // gc.CreatePdf(orderNumber, parcelNumber, "parcel search Result", driver, "GA", "Walton");
                        // driver.FindElement(By.XPath("//*[@id='ContentPlaceHolder1_gvSearchResults']/tbody/tr[2]/td[1]/a")).SendKeys(Keys.Enter);
                        // Thread.Sleep(3000);
                    }

                    try
                    {
                        IWebElement Inodata = driver.FindElement(By.Id("ctlBodyPane_noDataList_pnlNoResults"));
                        if (Inodata.Text.Contains("No results match"))
                        {
                            HttpContext.Current.Session["Nodata_WaltonGA"] = "Yes";
                            driver.Quit();
                            return("No Data Found");
                        }
                    }
                    catch { }
                    //property details
                    gc.CreatePdf(orderNumber, parcelNumber, "Property Details", driver, "GA", "Walton");
                    int                 i = 0, j = 0;
                    string              Loc_Addrs = "", Leg_Desp = "", Class = "", Tax_Dist = "", Milagerate = "", Acres = "", Neighberwood = "";
                    string              Homstd_Exmp = "", Zoning = "", Owner1 = "", Owner2 = "", Mailing_Address = "", Overall_OwnMailAdd = "";
                    string              Mailing_Address1 = "", Mailing_Address2 = "", yblt = "", Year_Built = "", Year1 = "", Year2 = "";
                    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)
                            {
                                parcelNumber = 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 == 8)
                            {
                                Tax_Dist = TDmulti11[1].Text;
                            }
                            if (i == 9)
                            {
                                Milagerate = TDmulti11[1].Text;
                            }
                            if (i == 10)
                            {
                                Acres = TDmulti11[1].Text;
                            }
                            if (i == 11)
                            {
                                Neighberwood = TDmulti11[1].Text;
                            }
                            if (i == 12)
                            {
                                Homstd_Exmp = TDmulti11[1].Text;
                            }
                            i++;
                        }
                    }

                    try
                    {
                        Zoning             = driver.FindElement(By.Id("ctlBodyPane_ctl00_ctl01_lblZoning")).Text;
                        Owner1             = driver.FindElement(By.Id("ctlBodyPane_ctl01_ctl01_lnkOwnerName_lblSearch")).Text;
                        Owner2             = driver.FindElement(By.Id("ctlBodyPane_ctl01_ctl01_lblAddress")).Text;
                        Mailing_Address    = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl01_ctl01_lblCityStateZip']")).Text;
                        Overall_OwnMailAdd = Owner1 + " " + Owner2 + " " + Mailing_Address;
                    }
                    catch
                    { }

                    try
                    {
                        Owner1             = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl01_ctl01_lnkOwnerName_lblSearch']")).Text;
                        Mailing_Address1   = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl01_ctl01_lblAddress']")).Text;
                        Mailing_Address2   = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl01_ctl01_lblCityStateZip']")).Text;
                        Overall_OwnMailAdd = Owner1 + " " + Mailing_Address1 + " " + Mailing_Address2;
                    }
                    catch
                    { }

                    try
                    {
                        IWebElement         Yeartb = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl04_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)
                            {
                                yblt = YearTD[0].Text;
                                if (yblt.Contains("Year Built"))
                                {
                                    Year_Built = YearTD[1].Text;
                                }
                            }
                        }
                    }
                    catch
                    { }

                    string property = Loc_Addrs + "~" + Leg_Desp + "~" + Class + "~" + Zoning + "~" + Tax_Dist + "~" + Milagerate + "~" + Acres + "~" + Neighberwood + "~" + Homstd_Exmp + "~" + Overall_OwnMailAdd + "~" + Year_Built;
                    gc.CreatePdf(orderNumber, parcelNumber, "Property Details", driver, "GA", "Walton");
                    gc.insert_date(orderNumber, parcelNumber, 1452, property, 1, DateTime.Now);

                    //Assessment Details
                    IWebElement         AssmThTb = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl12_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[2].Text;
                            Year2 = AssmTh[3].Text;
                        }
                    }

                    IWebElement         AssmTb = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl12_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);
                            }
                            else if (j == 1)
                            {
                                Land_Value.Add(AssmTd[2].Text);
                                Land_Value.Add(AssmTd[3].Text);
                            }
                            else if (j == 2)
                            {
                                Improvement_Value.Add(AssmTd[2].Text);
                                Improvement_Value.Add(AssmTd[3].Text);
                            }
                            else if (j == 3)
                            {
                                Accessory_Value.Add(AssmTd[2].Text);
                                Accessory_Value.Add(AssmTd[3].Text);
                            }
                            else if (j == 4)
                            {
                                Current_Value.Add(AssmTd[2].Text);
                                Current_Value.Add(AssmTd[3].Text);
                            }

                            j++;
                        }
                    }

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



                    // Tax Information
                    driver.Navigate().GoToUrl("https://waltoncountyga.governmentwindow.com/tax.html");
                    Thread.Sleep(4000);
                    string parcel1 = "", parcel2 = "";
                    parcel1 = parcelNumber.Substring(0, 5);

                    parcel2 = parcelNumber.Substring(5, 3);

                    parcelNumber = parcel1 + "-00000-" + parcel2 + "-000";

                    driver.FindElement(By.XPath("//*[@id='taxesSearchForm']/div[2]/div[2]/div/div/input[1]")).SendKeys(parcelNumber);
                    gc.CreatePdf(orderNumber, parcelNumber, "Tax Search", driver, "GA", "Walton");
                    driver.FindElement(By.XPath("//*[@id='taxesSearchForm']/div[2]/div[2]/div/div/input[2]")).Click();
                    Thread.Sleep(1000);
                    gc.CreatePdf(orderNumber, parcelNumber, "Tax Search Result", driver, "GA", "Walton");

                    IWebElement         taxinfo      = driver.FindElement(By.XPath("//*[@id='tbl_tax_results']"));
                    IList <IWebElement> TRtaxinfo    = taxinfo.FindElements(By.TagName("tr"));
                    IList <IWebElement> THtaxinfo    = taxinfo.FindElements(By.TagName("th"));
                    IList <IWebElement> TDtaxinfo;
                    foreach (IWebElement row in TRtaxinfo)
                    {
                        TDtaxinfo = row.FindElements(By.TagName("td"));

                        if (TDtaxinfo.Count != 0 && !row.Text.Contains("Property Address"))
                        {
                            string Taxhistorydetails = TDtaxinfo[0].Text + "~" + TDtaxinfo[1].Text + "~" + TDtaxinfo[2].Text + "~" + TDtaxinfo[3].Text + "~" + TDtaxinfo[4].Text + "~" + TDtaxinfo[5].Text + "~" + TDtaxinfo[6].Text + "~" + TDtaxinfo[7].Text + "~" + TDtaxinfo[8].Text;
                            gc.insert_date(orderNumber, parcelNumber, 1463, Taxhistorydetails, 1, DateTime.Now);
                        }
                    }

                    int                 Tax_Year     = DateTime.Now.Year;
                    List <string>       bililist     = new List <string>();
                    int                 I            = 0;
                    IWebElement         taxhistory   = driver.FindElement(By.XPath("//*[@id='tbl_tax_results']"));
                    IList <IWebElement> TRtaxhistory = taxhistory.FindElements(By.TagName("tr"));
                    IList <IWebElement> THtaxhistory = taxhistory.FindElements(By.TagName("th"));
                    IList <IWebElement> TDtaxhistory;
                    foreach (IWebElement row in TRtaxhistory)
                    {
                        TDtaxhistory = row.FindElements(By.TagName("td"));

                        if (TDtaxhistory.Count != 0 && !row.Text.Contains("Property Address") && bililist.Count < 4)
                        {
                            IWebElement Billlink = TDtaxhistory[1].FindElement(By.TagName("a"));
                            string      Billhref = Billlink.GetAttribute("href");
                            bililist.Add(Billhref);
                            Thread.Sleep(1000);
                            I++;
                        }
                        if (bililist.Count == 3)
                        {
                            break;
                        }
                    }
                    foreach (string Link in bililist)
                    {
                        // tax Bill Details
                        string taxyear = "";
                        driver.Navigate().GoToUrl(Link);
                        try
                        {
                            taxyear = driver.FindElement(By.XPath("//*[@id='tax_pay_bill']/div/div[2]/div[1]/div/h3/u")).Text;
                            taxyear = taxyear.Replace("Property Tax Statement", "").Trim();
                        }
                        catch { }
                        IWebElement         taxbill   = driver.FindElement(By.Id("tbl_tax_bill_total"));
                        IList <IWebElement> TRtaxbill = taxbill.FindElements(By.TagName("tr"));
                        IList <IWebElement> THtaxbill = taxbill.FindElements(By.TagName("th"));
                        IList <IWebElement> TDtaxbill;
                        foreach (IWebElement row in TRtaxbill)
                        {
                            TDtaxbill = row.FindElements(By.TagName("td"));

                            if (TDtaxbill.Count != 0 && !row.Text.Contains("Prior Payment"))
                            {
                                string TaxBilldetails = taxyear + "~" + TDtaxbill[0].Text + "~" + TDtaxbill[1].Text + "~" + TDtaxbill[2].Text + "~" + TDtaxbill[3].Text + "~" + TDtaxbill[4].Text + "~" + TDtaxbill[5].Text.Replace("Pay", "").Trim();
                                gc.insert_date(orderNumber, parcelNumber, 1461, TaxBilldetails, 1, DateTime.Now);
                            }
                        }

                        // Tax Breakdown Details Table:

                        IWebElement         taxbreakdown   = driver.FindElement(By.XPath("//*[@id='tbl_tax_positions']"));
                        IList <IWebElement> TRtaxbreakdown = taxbreakdown.FindElements(By.TagName("tr"));
                        IList <IWebElement> THtaxbreakdown = taxbreakdown.FindElements(By.TagName("th"));
                        IList <IWebElement> TDtaxbreakdown;
                        foreach (IWebElement row in TRtaxbreakdown)
                        {
                            TDtaxbreakdown = row.FindElements(By.TagName("td"));

                            if (TDtaxbreakdown.Count != 0 && !row.Text.Contains("Adjusted FMV") && !row.Text.Contains("TOTALS"))
                            {
                                string TaxBreakDowndetails = taxyear + "~" + TDtaxbreakdown[0].Text + "~" + TDtaxbreakdown[1].Text + "~" + TDtaxbreakdown[2].Text + "~" + TDtaxbreakdown[3].Text + "~" + TDtaxbreakdown[4].Text + "~" + TDtaxbreakdown[5].Text + "~" + TDtaxbreakdown[6].Text + "~" + TDtaxbreakdown[7].Text + "~" + TDtaxbreakdown[8].Text;
                                gc.insert_date(orderNumber, parcelNumber, 1462, TaxBreakDowndetails, 1, DateTime.Now);
                            }
                            if (TDtaxbreakdown.Count != 0 && !row.Text.Contains("Adjusted FMV") && row.Text.Contains("TOTALS"))
                            {
                                string TaxBreakDowndetails = taxyear + "~" + "" + "~" + "" + "~" + "" + "~" + "" + "~" + TDtaxbreakdown[0].Text + "~" + TDtaxbreakdown[1].Text + "~" + TDtaxbreakdown[2].Text + "~" + TDtaxbreakdown[3].Text + "~" + TDtaxbreakdown[4].Text;
                                gc.insert_date(orderNumber, parcelNumber, 1462, TaxBreakDowndetails, 1, DateTime.Now);
                            }
                        }

                        // Tax Information Details

                        string Taxstatus = driver.FindElement(By.XPath("//*[@id='tax_pay_bill']/div/div[3]/div[3]/table/tbody")).Text;
                        string Taxpayer = "", Mapcode = "", Description = "", Location = "", Billno = "", TaxAuth = "";
                        Taxpayer    = gc.Between(Taxstatus, "Tax Payer:", "Map Code:");
                        Mapcode     = gc.Between(Taxstatus, "Map Code:", "Description:").Trim();
                        Description = gc.Between(Taxstatus, "Description:", "Location:").Trim();
                        Location    = gc.Between(Taxstatus, "Location:", "Bill No:").Trim();
                        Billno      = GlobalClass.After(Taxstatus, "Bill No:").Replace("\r\n", "").Trim();
                        TaxAuth     = driver.FindElement(By.XPath("//*[@id='tax_pay_bill']/div/div[3]/div[1]/div")).Text.Replace("Tax Commissioner", "").Replace("\r\n", " ").Trim();

                        IWebElement         taxstatus = driver.FindElement(By.Id("tbl_tax_bill_item"));
                        IList <IWebElement> TRtaxstatus = taxstatus.FindElements(By.TagName("tr"));
                        IList <IWebElement> THtaxstatus = taxstatus.FindElements(By.TagName("th"));
                        IList <IWebElement> TDtaxstatus;
                        foreach (IWebElement row in TRtaxstatus)
                        {
                            TDtaxstatus = row.FindElements(By.TagName("td"));

                            if (TDtaxstatus.Count != 0 && !row.Text.Contains("Fair Market Value") && !row.Text.Contains("Billing Date"))
                            {
                                string Taxstatusdetails = taxyear + "~" + Taxpayer + "~" + Mapcode + "~" + Description + "~" + Location + "~" + Billno + "~" + TDtaxstatus[0].Text + "~" + TDtaxstatus[1].Text + "~" + TDtaxstatus[2].Text + "~" + TDtaxstatus[3].Text + "~" + TDtaxstatus[4].Text + "~" + TDtaxstatus[5].Text + "~" + TaxAuth;
                                gc.insert_date(orderNumber, parcelNumber, 1466, Taxstatusdetails, 1, DateTime.Now);
                            }
                        }

                        // Tax payment status Details
                        string valuetype = "", Amount = "";
                        valuetype += "Tax Year" + "~";
                        Amount    += Tax_Year + "~";
                        IWebElement         Assessmentdetails = driver.FindElement(By.XPath("//*[@id='tax_pay_bill']/div/div[5]/div[2]/table/tbody"));
                        IList <IWebElement> TRAssessmentdetails = Assessmentdetails.FindElements(By.TagName("tr"));
                        IList <IWebElement> THAssessmentdetails = Assessmentdetails.FindElements(By.TagName("th"));
                        IList <IWebElement> TDAssessmentdetails;
                        foreach (IWebElement row in TRAssessmentdetails)
                        {
                            TDAssessmentdetails = row.FindElements(By.TagName("td"));
                            if (row.Text.Trim() != "" && TDAssessmentdetails.Count == 2)
                            {
                                valuetype += TDAssessmentdetails[0].Text + "~";
                                Amount    += TDAssessmentdetails[1].Text + "~";
                            }
                        }


                        db.ExecuteQuery("update data_field_master set Data_Fields_Text='" + valuetype.Remove(valuetype.Length - 1, 1) + "' where Id = '" + 1467 + "'");
                        gc.insert_date(orderNumber, parcelNumber, 1467, Amount.Remove(Amount.Length - 1, 1), 1, DateTime.Now);
                        //Tax_Year--;
                    }
                    TaxTime = DateTime.Now.ToString("HH:mm:ss");

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

                    driver.Quit();
                    gc.mergpdf(orderNumber, "GA", "Walton");
                    return("Data Inserted Successfully");
                }

                catch (Exception ex)
                {
                    driver.Quit();
                    throw ex;
                }
            }
        }
예제 #2
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;
                }
            }
        }
예제 #3
0
        public string FTP_GAFayette(string address, string assessment_id, string parcelNumber, string searchType, string orderNumber, string directParcel, string ownername)
        {
            string Parcelno = "", Owner = "", Property_Address = "", Legal_Desp = "", MultiOwner_details = "", MultiAddress_details = "";
            string Parcel_ID = "", Location = "", Legal = "", Property_Class = "", Nighbrhod = "", Tax_Dis = "", Zoing = "", Acres = "", Homestd = "", Exemption = "", Overall_OwnMailAdd = "", Year_Built = "";
            string property = "", yblt = "", Mailing_Address2 = "", Mailing_Address1 = "", Owner1 = "", Owner2 = "", Exemp = "", Home = "", Acrs = "", Zone = "", tx_Dis = "", Nhg = "", Pro_Cls = "", Lg_Des = "", Loc = "", Par = "";
            string Year1 = "", Year2 = "", Year3 = "", Year4 = "", Assemnt_Details1 = "", Assemnt_Details2 = "", Assemnt_Details3 = "", Assemnt_Details4 = "", total = "", Total_Payments = "", Convey = "", Convey_Fee = "", Paid = "", Total_Paid = "", TaxPayment_details1 = "", TaxPayment_details = "", Balnce_Due = "", Tax_Bill = "", Tax_year = "";
            string Taxy = "", Total_DUE = "", Last_PAYDATE = "", Tax_P = "", Tax_Payer = "", Map = "", Map_Code = "", Desk = "", Desk_Pro = "", Locy = "", Tax_Location = "", Bl_No = "", Tax_Billno = "", Disti = "", Tax_Dist = "", Build_Val = "", Land_Val = "", Tax_Acres = "", FrMkt_Val = "", Tax_DueDate = "", Tax_Exmpions = "", TaxInfo_Details = "";
            string Cu_Du = "", Penalt = "", In_Tx = "", Oth_Fe = "", Pre_Pay = "", Bc_Tx = "", Tl_Du = "", Cur_Due = "", Tax_Penalty = "", Int_Rest = "", Other_Fees = "", Previous_Payments = "", Back_Taxes = "", TaxToal_Due = "", DueTaxInfo_Details = "";
            string Entity = "", FMV = "", Net_Assmnt = "", Exmpl = "", Taxble_Value = "", Millage_Rate = "", Grs_Tax = "", Cretit = "", NetTax = "", CityPayment_details = "", Taxble_Value1 = "", Millage_Rate1 = "", Grs_Tax1 = "", Cretit1 = "", NetTax1 = "";
            string Tax_Auth1 = "", Tax_Auth2 = "", Tax_Authotiry = "", TaxAuthority_Details = "";

            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())
            {
                try
                {
                    StartTime = DateTime.Now.ToString("HH:mm:ss");

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

                        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_GAFayette"] = "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?AppID=942&LayerID=18406&PageTypeID=2&PageID=8204");
                        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_txtAddress")).SendKeys(address);
                        gc.CreatePdf_WOP(orderNumber, "Address search", driver, "GA", "Fayette");
                        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", "Fayette");
                            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[2].Text;
                                        Property_Address = MultiAddressTD[3].Text;
                                        Legal_Desp       = MultiAddressTD[4].Text;

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

                    if (searchType == "parcel")
                    {
                        driver.Navigate().GoToUrl("https://qpublic.schneidercorp.com/Application.aspx?AppID=942&LayerID=18406&PageTypeID=2&PageID=8204");
                        Thread.Sleep(2000);
                        try
                        {
                            driver.FindElement(By.XPath("//*[@id='appBody']/div[4]/div/div/div[3]/a[1]")).Click();
                            Thread.Sleep(2000);
                        }
                        catch { }

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

                        string CommonParcel = parcelNumber;

                        if (CommonParcel.Length == 9)
                        {
                            driver.FindElement(By.Id("ctlBodyPane_ctl02_ctl01_txtParcelID")).SendKeys(parcelNumber);
                            gc.CreatePdf(orderNumber, parcelNumber, "ParcelSearch", driver, "GA", "Fayette");
                            driver.FindElement(By.Id("ctlBodyPane_ctl02_ctl01_btnSearch")).SendKeys(Keys.Enter);
                            Thread.Sleep(2000);
                        }

                        if (CommonParcel.Length == 7)
                        {
                            driver.FindElement(By.Id("ctlBodyPane_ctl02_ctl01_txtParcelID")).SendKeys(parcelNumber);
                            gc.CreatePdf(orderNumber, parcelNumber, "ParcelSearch", driver, "GA", "Fayette");
                            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?AppID=942&LayerID=18406&PageTypeID=2&PageID=8204");
                        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_ctl00_ctl01_txtName")).SendKeys(ownername);
                        gc.CreatePdf_WOP(orderNumber, "Owner search", driver, "GA", "Fayette");
                        driver.FindElement(By.Id("ctlBodyPane_ctl00_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, "GA", "Fayette");
                            int AddressmaxCheck = 0;
                            foreach (IWebElement MultiOwner in MultiOwnerTR)
                            {
                                if (AddressmaxCheck <= 25)
                                {
                                    MultiOwnerTD = MultiOwner.FindElements(By.TagName("td"));
                                    if (MultiOwnerTD.Count != 0)
                                    {
                                        Parcelno         = MultiOwnerTD[1].Text;
                                        Owner            = MultiOwnerTD[2].Text;
                                        Property_Address = MultiOwnerTD[3].Text;
                                        Legal_Desp       = MultiOwnerTD[4].Text;

                                        MultiOwner_details = Owner + "~" + Property_Address + "~" + Legal_Desp;
                                        gc.insert_date(orderNumber, Parcelno, 784, MultiOwner_details, 1, DateTime.Now);
                                    }
                                    AddressmaxCheck++;
                                }
                            }
                            if (MultiOwnerTR.Count > 25)
                            {
                                HttpContext.Current.Session["multiParcel_GAFayette_Multicount"] = "Maximum";
                            }
                            else
                            {
                                HttpContext.Current.Session["multiparcel_GAFayette"] = "Yes";
                            }
                            driver.Quit();

                            return("MultiParcel");
                        }
                        catch
                        { }
                    }

                    try
                    {
                        IWebElement Inodata = driver.FindElement(By.Id("ctlBodyPane_noDataList_pnlNoResults"));
                        if (Inodata.Text.Contains("No results match your search criteria"))
                        {
                            HttpContext.Current.Session["Nodata_GAFayette"] = "Yes";
                            driver.Quit();
                            return("No Data Found");
                        }
                    }
                    catch { }
                    //Property Details
                    IWebElement         PropertyTB = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl00_mSection']/div/table[1]/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 Number"))
                            {
                                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("Legal Description"))
                            {
                                Legal = PropertyTD[1].Text;
                            }

                            Pro_Cls = PropertyTD[0].Text;
                            if (Pro_Cls.Contains("Property Class"))
                            {
                                Property_Class = PropertyTD[1].Text;
                            }

                            Nhg = PropertyTD[0].Text;
                            if (Nhg.Contains("Neighborhood"))
                            {
                                Nighbrhod = PropertyTD[1].Text;
                            }

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

                            Zone = PropertyTD[0].Text;
                            if (Zone.Contains("Zoning"))
                            {
                                Zoing = PropertyTD[1].Text;
                            }

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

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

                            Exemp = PropertyTD[0].Text;
                            if (Exemp.Contains("Exemptions"))
                            {
                                Exemption = PropertyTD[1].Text;
                            }
                        }
                    }

                    try
                    {
                        Owner1             = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl01_ctl01_lnkOwnerName1_lblSearch']")).Text;
                        Owner2             = driver.FindElement(By.Id("ctlBodyPane_ctl01_ctl01_lblOwnerName2")).Text;
                        Mailing_Address1   = driver.FindElement(By.Id("ctlBodyPane_ctl01_ctl01_lblAddress1")).Text;
                        Mailing_Address2   = driver.FindElement(By.Id("ctlBodyPane_ctl01_ctl01_lblCityStZip")).Text;
                        Overall_OwnMailAdd = Owner1 + " " + Owner2 + " & " + Mailing_Address1 + " " + Mailing_Address2;
                    }
                    catch
                    { }

                    try
                    {
                        Owner1             = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl01_ctl01_lnkOwnerName1_lblSearch']")).Text;
                        Mailing_Address1   = driver.FindElement(By.Id("ctlBodyPane_ctl01_ctl01_lblAddress1")).Text;
                        Mailing_Address2   = driver.FindElement(By.Id("ctlBodyPane_ctl01_ctl01_lblCityStZip")).Text;
                        Overall_OwnMailAdd = Owner1 + " & " + Mailing_Address1 + " " + Mailing_Address2;
                    }
                    catch
                    { }

                    try
                    {
                        Owner1             = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl01_ctl01_lnkOwnerName1_lnkSearch']")).Text;
                        Mailing_Address1   = driver.FindElement(By.Id("ctlBodyPane_ctl01_ctl01_lblAddress1")).Text;
                        Mailing_Address2   = driver.FindElement(By.Id("ctlBodyPane_ctl01_ctl01_lblCityStZip")).Text;
                        Overall_OwnMailAdd = Owner1 + " & " + Mailing_Address1 + " " + Mailing_Address2;
                    }
                    catch
                    { }

                    try
                    {
                        IWebElement         Yeartb = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl04_mSection']/div/div/div[1]/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)
                            {
                                yblt = YearTD[0].Text;
                                if (yblt.Contains("Year Built"))
                                {
                                    Year_Built = YearTD[1].Text;
                                }
                            }
                        }
                    }
                    catch
                    { }

                    property = Location + "~" + Legal + "~" + Property_Class + "~" + Nighbrhod + "~" + Tax_Dis + "~" + Zoing + "~" + Acres + "~" + Homestd + "~" + Exemption + "~" + Overall_OwnMailAdd + "~" + Year_Built;
                    gc.CreatePdf(orderNumber, Parcel_ID, "Property Details", driver, "GA", "Fayette");
                    gc.insert_date(orderNumber, Parcel_ID, 785, property, 1, DateTime.Now);

                    //Assessment Details
                    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> LUC         = new List <string>();
                    List <string> Class       = new List <string>();
                    List <string> Land_Value  = new List <string>();
                    List <string> Build_Value = new List <string>();
                    List <string> Total_Value = new List <string>();
                    List <string> Assed_Value = new List <string>();

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

                        if (AssmTd.Count != 0)
                        {
                            if (j == 0)
                            {
                                LUC.Add(AssmTd[2].Text);
                                LUC.Add(AssmTd[3].Text);
                                LUC.Add(AssmTd[4].Text);
                                LUC.Add(AssmTd[5].Text);
                            }
                            else if (j == 1)
                            {
                                Class.Add(AssmTd[2].Text);
                                Class.Add(AssmTd[3].Text);
                                Class.Add(AssmTd[4].Text);
                                Class.Add(AssmTd[5].Text);
                            }
                            else if (j == 2)
                            {
                                Land_Value.Add(AssmTd[2].Text);
                                Land_Value.Add(AssmTd[3].Text);
                                Land_Value.Add(AssmTd[4].Text);
                                Land_Value.Add(AssmTd[5].Text);
                            }
                            else if (j == 3)
                            {
                                Build_Value.Add(AssmTd[2].Text);
                                Build_Value.Add(AssmTd[3].Text);
                                Build_Value.Add(AssmTd[4].Text);
                                Build_Value.Add(AssmTd[5].Text);
                            }
                            else if (j == 4)
                            {
                                Total_Value.Add(AssmTd[2].Text);
                                Total_Value.Add(AssmTd[3].Text);
                                Total_Value.Add(AssmTd[4].Text);
                                Total_Value.Add(AssmTd[5].Text);
                            }
                            else if (j == 6)
                            {
                                Assed_Value.Add(AssmTd[2].Text);
                                Assed_Value.Add(AssmTd[3].Text);
                                Assed_Value.Add(AssmTd[4].Text);
                                Assed_Value.Add(AssmTd[5].Text);
                            }

                            j++;
                        }
                    }

                    Assemnt_Details1 = Year1 + "~" + LUC[0] + "~" + Class[0] + "~" + Land_Value[0] + "~" + Build_Value[0] + "~" + Total_Value[0] + "~" + Assed_Value[0];
                    Assemnt_Details2 = Year2 + "~" + LUC[1] + "~" + Class[1] + "~" + Land_Value[1] + "~" + Build_Value[1] + "~" + Total_Value[1] + "~" + Assed_Value[1];
                    Assemnt_Details3 = Year3 + "~" + LUC[2] + "~" + Class[2] + "~" + Land_Value[2] + "~" + Build_Value[2] + "~" + Total_Value[2] + "~" + Assed_Value[2];
                    Assemnt_Details4 = Year4 + "~" + LUC[3] + "~" + Class[3] + "~" + Land_Value[3] + "~" + Build_Value[3] + "~" + Total_Value[3] + "~" + Assed_Value[3];
                    gc.insert_date(orderNumber, Parcel_ID, 791, Assemnt_Details1, 1, DateTime.Now);
                    gc.insert_date(orderNumber, Parcel_ID, 791, Assemnt_Details2, 1, DateTime.Now);
                    gc.insert_date(orderNumber, Parcel_ID, 791, Assemnt_Details3, 1, DateTime.Now);
                    gc.insert_date(orderNumber, Parcel_ID, 791, Assemnt_Details4, 1, DateTime.Now);
                    AssessmentTime = DateTime.Now.ToString("HH:mm:ss");

                    try
                    {
                        //Tax Details
                        driver.Navigate().GoToUrl("http://www.fayettecountytaxcomm.com/taxbillsearch.aspx");

                        driver.FindElement(By.Id("Body_MapParcelID1")).SendKeys(Parcel_ID);
                        Thread.Sleep(2000);

                        gc.CreatePdf(orderNumber, Parcel_ID, "Tax Parcel Search", driver, "GA", "Fayette");
                        driver.FindElement(By.Id("Body_MapParcelIDGo")).SendKeys(Keys.Enter);
                        Thread.Sleep(2000);

                        gc.CreatePdf(orderNumber, Parcel_ID, "Tax Site", driver, "GA", "Fayette");
                        driver.FindElement(By.XPath("//*[@id='Body_GridView1']/tbody/tr[2]/td[1]/a")).Click();
                        Thread.Sleep(2000);

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

                        //Tax Payment Details
                        try
                        {
                            IWebElement         TaxPaymentTB = driver.FindElement(By.XPath("//*[@id='Body_GridView1']/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 && !TaxPayment.Text.Contains("Year"))
                                {
                                    Tax_year   = TaxPaymentTD[0].Text;
                                    Tax_Bill   = TaxPaymentTD[1].Text;
                                    Balnce_Due = TaxPaymentTD[2].Text;

                                    TaxPayment_details = Tax_year + "~" + Tax_Bill + "~" + Balnce_Due;
                                    gc.CreatePdf(orderNumber, Parcel_ID, "Tax Payment Details", driver, "GA", "Fayette");
                                    gc.insert_date(orderNumber, Parcel_ID, 792, TaxPayment_details, 1, DateTime.Now);
                                }
                            }
                        }
                        catch
                        { }

                        try
                        {
                            IWebElement         Tax2TB = driver.FindElement(By.XPath("//*[@id='form1']/div[3]/div/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)
                                {
                                    total = Tax2TD[0].Text;
                                    if (total.Contains("Total Payments Pending:"))
                                    {
                                        Total_Payments = Tax2TD[1].Text;
                                    }
                                    Convey = Tax2TD[0].Text;
                                    if (Convey.Contains("Convenience Fee:"))
                                    {
                                        Convey_Fee = Tax2TD[1].Text;
                                    }
                                    Paid = Tax2TD[0].Text;
                                    if (Paid.Contains("Total Amount to be paid:"))
                                    {
                                        Total_Paid = Tax2TD[1].Text;
                                    }
                                }
                            }

                            TaxPayment_details1 = "" + "~" + "" + "~" + "" + "~" + Total_Payments + "~" + Convey_Fee + "~" + Total_Paid;
                            gc.insert_date(orderNumber, Parcel_ID, 792, TaxPayment_details1, 1, DateTime.Now);
                        }
                        catch
                        { }
                        //Tax Info Details

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

                        IWebElement         TaxInfoTB = driver.FindElement(By.XPath("//*[@id='Body_GridView1']/tbody"));
                        IList <IWebElement> TaxInfoTR = TaxInfoTB.FindElements(By.TagName("tr"));
                        TaxInfoTR.Reverse();

                        int rows_count = TaxInfoTR.Count;

                        for (int row = 0; row < rows_count; row++)
                        {
                            if (row == rows_count - 1 || row == rows_count - 2 || row == rows_count - 3)
                            {
                                IList <IWebElement> Columns_row = TaxInfoTR[row].FindElements(By.TagName("td"));

                                int columns_count = Columns_row.Count;

                                for (int column = 0; column < columns_count; column++)
                                {
                                    if (column == columns_count - 2)
                                    {
                                        IWebElement ParcelBill_link = Columns_row[1].FindElement(By.TagName("a"));
                                        string      Parcelurl       = ParcelBill_link.GetAttribute("href");
                                        TaxInfoSearch.Add(Parcelurl);
                                    }
                                }
                            }
                        }

                        foreach (string TaxInfobill in TaxInfoSearch)
                        {
                            driver.Navigate().GoToUrl(TaxInfobill);
                            Thread.Sleep(3000);
                            driver.SwitchTo().Window(driver.WindowHandles.Last());
                            Thread.Sleep(2000);
                            try
                            {
                                Taxy         = driver.FindElement(By.Id("PropertyTaxLabel")).Text;
                                Taxy         = WebDriverTest.Before(Taxy, " Property Tax Statement");
                                Total_DUE    = driver.FindElement(By.Id("TotalDueTopText")).Text;
                                Last_PAYDATE = driver.FindElement(By.Id("LastPaymentTopText")).Text;
                                Last_PAYDATE = WebDriverTest.After(Last_PAYDATE, "Last payment made on: ");
                            }
                            catch
                            { }

                            try
                            {
                                IWebElement         IntrestTB = driver.FindElement(By.XPath("//*[@id='TaxPayerInfo']/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)
                                    {
                                        Tax_P = IntrestTD[0].Text;
                                        if (Tax_P.Contains("Tax Payer:"))
                                        {
                                            Tax_Payer = IntrestTD[1].Text;
                                        }
                                        Map = IntrestTD[0].Text;
                                        if (Map.Contains("Map Code:"))
                                        {
                                            Map_Code = IntrestTD[1].Text;
                                        }
                                        Desk = IntrestTD[0].Text;
                                        if (Desk.Contains("Description:"))
                                        {
                                            Desk_Pro = IntrestTD[1].Text;
                                        }
                                        Locy = IntrestTD[0].Text;
                                        if (Locy.Contains("Location:"))
                                        {
                                            Tax_Location = IntrestTD[1].Text;
                                        }
                                        Bl_No = IntrestTD[0].Text;
                                        if (Bl_No.Contains("Bill No:"))
                                        {
                                            Tax_Billno = IntrestTD[1].Text;
                                        }
                                        Disti = IntrestTD[0].Text;
                                        if (Disti.Contains("District:"))
                                        {
                                            Tax_Dist = IntrestTD[1].Text;
                                        }
                                    }
                                }
                            }
                            catch
                            { }

                            try
                            {
                                IWebElement         CinfoTB = driver.FindElement(By.XPath("//*[@id='BottomTable']/tbody"));
                                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.Text.Contains("Building Value") && Cinfo.Text != "")
                                    {
                                        Build_Val    = CinfoTD[0].Text;
                                        Land_Val     = CinfoTD[1].Text;
                                        Tax_Acres    = CinfoTD[2].Text;
                                        FrMkt_Val    = CinfoTD[3].Text;
                                        Tax_DueDate  = CinfoTD[4].Text;
                                        Tax_Exmpions = CinfoTD[7].Text;
                                    }
                                }
                            }
                            catch
                            { }

                            gc.CreatePdf(orderNumber, Parcel_ID, "Tax Info Details" + " " + Taxy, driver, "GA", "Fayette");

                            TaxInfo_Details = Taxy + "~" + Tax_Payer + "~" + Map_Code + "~" + Desk_Pro + "~" + Tax_Location + "~" + Tax_Billno + "~" + Tax_Dist + "~" + Last_PAYDATE + "~" + Build_Val + "~" + Land_Val + "~" + Tax_Acres + "~" + FrMkt_Val + "~" + Tax_Exmpions + "~" + Tax_DueDate + "~" + Total_DUE;
                            gc.insert_date(orderNumber, Parcel_ID, 793, TaxInfo_Details, 1, DateTime.Now);
                            Tax_Payer = ""; Map_Code = ""; Desk_Pro = ""; Tax_Location = ""; Tax_Billno = ""; Tax_Dist = ""; Last_PAYDATE = ""; Build_Val = ""; Land_Val = ""; Tax_Acres = ""; FrMkt_Val = ""; Tax_Exmpions = ""; Tax_DueDate = ""; Total_DUE = "";

                            try
                            {
                                IWebElement         DueTaxTB = driver.FindElement(By.XPath("//*[@id='CurrentDueTable']/tbody"));
                                IList <IWebElement> DueTaxTR = DueTaxTB.FindElements(By.TagName("tr"));
                                IList <IWebElement> DueTaxTD;

                                foreach (IWebElement DueTax in DueTaxTR)
                                {
                                    DueTaxTD = DueTax.FindElements(By.TagName("td"));
                                    if (DueTaxTD.Count != 0 && DueTaxTD.Count != 1 && DueTaxTD.Count != 8 && DueTaxTD.Count != 9)
                                    {
                                        Cu_Du = DueTaxTD[1].Text;
                                        if (Cu_Du.Contains("Current Due"))
                                        {
                                            Cur_Due = DueTaxTD[2].Text;
                                        }
                                        Penalt = DueTaxTD[1].Text;
                                        if (Penalt.Contains("Penalty"))
                                        {
                                            Tax_Penalty = DueTaxTD[2].Text;
                                        }
                                        In_Tx = DueTaxTD[1].Text;
                                        if (In_Tx.Contains("Interest"))
                                        {
                                            Int_Rest = DueTaxTD[2].Text;
                                        }
                                        Oth_Fe = DueTaxTD[1].Text;
                                        if (Oth_Fe.Contains("Other Fees"))
                                        {
                                            Other_Fees = DueTaxTD[2].Text;
                                        }
                                        Pre_Pay = DueTaxTD[1].Text;
                                        if (Pre_Pay.Contains("Previous Payments"))
                                        {
                                            Previous_Payments = DueTaxTD[2].Text;
                                        }
                                        Bc_Tx = DueTaxTD[1].Text;
                                        if (Bc_Tx.Contains("Back Taxes"))
                                        {
                                            Back_Taxes = DueTaxTD[2].Text;
                                        }
                                        Tl_Du = DueTaxTD[1].Text;
                                        if (Tl_Du.Contains("Total Due"))
                                        {
                                            TaxToal_Due = DueTaxTD[2].Text;
                                        }
                                    }
                                }

                                DueTaxInfo_Details = Taxy + "~" + Cur_Due + "~" + Tax_Penalty + "~" + Int_Rest + "~" + Other_Fees + "~" + Previous_Payments + "~" + Back_Taxes + "~" + TaxToal_Due;
                                gc.insert_date(orderNumber, Parcel_ID, 802, DueTaxInfo_Details, 1, DateTime.Now);
                            }
                            catch
                            { }

                            try
                            {
                                IWebElement         CityTaxPaymentTB = driver.FindElement(By.XPath("//*[@id='EntityTable']/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("Entity") && !CityTaxPayment.Text.Contains("Totals: "))
                                    {
                                        Entity       = CityTaxPaymentTD[0].Text;
                                        FMV          = CityTaxPaymentTD[1].Text;
                                        Net_Assmnt   = CityTaxPaymentTD[2].Text;
                                        Exmpl        = CityTaxPaymentTD[3].Text;
                                        Taxble_Value = CityTaxPaymentTD[4].Text;
                                        Millage_Rate = CityTaxPaymentTD[5].Text;
                                        Grs_Tax      = CityTaxPaymentTD[6].Text;
                                        Cretit       = CityTaxPaymentTD[7].Text;
                                        NetTax       = CityTaxPaymentTD[8].Text;

                                        CityPayment_details = Entity + "~" + FMV + "~" + Net_Assmnt + "~" + Exmpl + "~" + Taxble_Value + "~" + Millage_Rate + "~" + Grs_Tax + "~" + Cretit + "~" + NetTax;
                                        gc.insert_date(orderNumber, Parcel_ID, 803, CityPayment_details, 1, DateTime.Now);
                                    }
                                }
                            }
                            catch
                            { }

                            try
                            {
                                IWebElement         CityTaxPaymentTB1 = driver.FindElement(By.XPath("//*[@id='EntityTable']/tbody"));
                                IList <IWebElement> CityTaxPaymentTR1 = CityTaxPaymentTB1.FindElements(By.TagName("tr"));
                                IList <IWebElement> CityTaxPaymentTD1;

                                foreach (IWebElement CityTaxPayment1 in CityTaxPaymentTR1)
                                {
                                    CityTaxPaymentTD1 = CityTaxPayment1.FindElements(By.TagName("td"));
                                    if (CityTaxPaymentTD1.Count != 0 && CityTaxPayment1.Text.Contains("Totals: "))
                                    {
                                        Taxble_Value1 = CityTaxPaymentTD1[0].Text;
                                        Millage_Rate1 = CityTaxPaymentTD1[1].Text;
                                        Grs_Tax1      = CityTaxPaymentTD1[2].Text;
                                        Cretit1       = CityTaxPaymentTD1[3].Text;
                                        NetTax1       = CityTaxPaymentTD1[4].Text;

                                        CityPayment_details = "" + "~" + "" + "~" + "" + "~" + "" + "~" + Taxble_Value1 + "~" + Millage_Rate1 + "~" + Grs_Tax1 + "~" + Cretit1 + "~" + NetTax1;
                                        gc.insert_date(orderNumber, Parcel_ID, 803, CityPayment_details, 1, DateTime.Now);
                                    }
                                }
                            }
                            catch
                            { }
                        }
                    }
                    catch
                    { }

                    //Tax Avthority
                    driver.Navigate().GoToUrl("http://www.fayettecountytaxcomm.com/");
                    Thread.Sleep(2000);

                    Tax_Auth1     = driver.FindElement(By.XPath("/html/body/div/table/tbody/tr[3]/td[3]/p[19]")).Text.Replace("Suite 109 (Motor Vehicles)", "");
                    Tax_Auth2     = driver.FindElement(By.XPath("/html/body/div/table/tbody/tr[3]/td[3]/p[15]")).Text;
                    Tax_Authotiry = Tax_Auth1 + " & " + Tax_Auth2;

                    TaxAuthority_Details = Tax_Authotiry;
                    gc.CreatePdf(orderNumber, Parcel_ID, "Tax Authority Details", driver, "GA", "Fayette");
                    gc.insert_date(orderNumber, Parcel_ID, 804, TaxAuthority_Details, 1, DateTime.Now);

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

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

                    driver.Quit();
                    gc.mergpdf(orderNumber, "GA", "Fayette");
                    return("Data Inserted Successfully");
                }
                catch (Exception ex)
                {
                    driver.Quit();
                    GlobalClass.LogError(ex, orderNumber);
                    throw;
                }
            }
        }
예제 #4
0
        public string FTP_ForsythGA(string Address, string ownername, string parcelNumber, 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 = "";
            string Parcelno = "", Owner = "", Property_Address = "", Legal_Desp = "", MultiOwner_details = "", MultiAddress_details = "";
            string Parcel_ID = "", Location = "", Legal = "", Property_Class = "", Nighbrhod = "", Tax_Dis = "", Zoing = "", Acres = "", Homestd = "", Exemption = "", Overall_OwnMailAdd = "", Year_Built = "";
            string property = "", yblt = "", Mailing_Address2 = "", Mailing_Address1 = "", Owner1 = "", Owner2 = "", Exemp = "", Home = "", Acrs = "", Zone = "", tx_Dis = "", Nhg = "", Pro_Cls = "", Lg_Des = "", Loc = "", Par = "";
            string Year1 = "", Year5 = "", Year6 = "", Year2 = "", Year3 = "", Year4 = "", Assemnt_Details1 = "", Assemnt_Details2 = "", Assemnt_Details3 = "", Assemnt_Details4 = "", total = "", Total_Payments = "", Convey = "", Convey_Fee = "", Paid = "", Total_Paid = "", TaxPayment_details1 = "", TaxPayment_details = "", Balnce_Due = "", Tax_Bill = "", Tax_year = "";
            string Taxy = "", Total_DUE = "", Last_PAYDATE = "", Tax_P = "", Tax_Payer = "", Map = "", Map_Code = "", Desk = "", Desk_Pro = "", Locy = "", Tax_Location = "", Bl_No = "", Tax_Billno = "", Disti = "", Tax_Dist = "", Build_Val = "", Land_Val = "", Tax_Acres = "", FrMkt_Val = "", Tax_DueDate = "", Tax_Exmpions = "", TaxInfo_Details = "";
            string Cu_Du = "", Penalt = "", In_Tx = "", Oth_Fe = "", Pre_Pay = "", Bc_Tx = "", Tl_Du = "", Cur_Due = "", Tax_Penalty = "", Int_Rest = "", Other_Fees = "", Previous_Payments = "", Back_Taxes = "", TaxToal_Due = "", DueTaxInfo_Details = "";
            string Entity = "", FMV = "", Net_Assmnt = "", Exmpl = "", Taxble_Value = "", Millage_Rate = "", Grs_Tax = "", Cretit = "", NetTax = "", CityPayment_details = "", Taxble_Value1 = "", Millage_Rate1 = "", Grs_Tax1 = "", Cretit1 = "", NetTax1 = "";
            string Tax_Auth1 = "", Tax_Auth2 = "", Tax_Authotiry = "", TaxAuthority_Details = "";
            var    driverService = PhantomJSDriverService.CreateDefaultService();

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

                    if (searchType == "titleflex")
                    {
                        string titleaddress = Address;
                        gc.TitleFlexSearch(orderNumber, "", "", titleaddress, "GA", "Forsyth");
                        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_ForsythGA"] = "Yes";
                            driver.Quit();
                            return("No Data Found");
                        }
                        parcelNumber = HttpContext.Current.Session["titleparcel"].ToString();
                        searchType   = "parcel";
                    }
                    driver.Navigate().GoToUrl("http://qpublic9.qpublic.net/ga_search_dw.php?county=ga_forsyth");
                    Thread.Sleep(2000);
                    if (searchType == "address")
                    {
                        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_txtAddress")).SendKeys(Address);
                        gc.CreatePdf_WOP(orderNumber, "Address search", driver, "GA", "Forsyth");
                        driver.FindElement(By.Id("ctlBodyPane_ctl01_ctl01_btnSearch")).SendKeys(Keys.Enter);
                        Thread.Sleep(2000);

                        try
                        {
                            int                 AddressmaxCheck = 0;
                            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", "Forsyth");

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

                                        MultiAddress_details = Owner + "~" + Property_Address + "~" + Legal_Desp;
                                        gc.insert_date(orderNumber, Parcelno, 1364, MultiAddress_details, 1, DateTime.Now);
                                        AddressmaxCheck++;
                                    }
                                }
                            }
                            if (AddressmaxCheck > 25)
                            {
                                HttpContext.Current.Session["multiParcel_GAForsyth_Multicount"] = "Maximum";
                            }
                            else
                            {
                                HttpContext.Current.Session["multiparcel_GAForsyth"] = "Yes";
                            }
                            driver.Quit();
                            return("MultiParcel");
                        }
                        catch
                        { }
                    }

                    if (searchType == "parcel")
                    {
                        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);
                        driver.FindElement(By.Id("ctlBodyPane_ctl02_ctl01_btnSearch")).Click();
                        Thread.Sleep(2000);
                    }

                    if (searchType == "ownername")
                    {
                        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_txtName")).SendKeys(ownername);
                        gc.CreatePdf_WOP(orderNumber, "Owner search", driver, "GA", "Forsyth");
                        driver.FindElement(By.Id("ctlBodyPane_ctl00_ctl01_btnSearch")).SendKeys(Keys.Enter);
                        Thread.Sleep(2000);

                        try
                        {
                            int                 AddressmaxCheck = 0;
                            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", "Forsyth");

                            foreach (IWebElement MultiAddress in MultiAddressTR)
                            {
                                if (AddressmaxCheck <= 25)
                                {
                                    MultiAddressTD = MultiAddress.FindElements(By.TagName("td"));
                                    if (MultiAddressTD.Count != 0)
                                    {
                                        Parcelno             = MultiAddressTD[1].Text;
                                        Owner                = MultiAddressTD[2].Text;
                                        Property_Address     = MultiAddressTD[3].Text;
                                        Legal_Desp           = MultiAddressTD[5].Text;
                                        MultiAddress_details = Owner + "~" + Property_Address + "~" + Legal_Desp;
                                        gc.insert_date(orderNumber, Parcelno, 1364, MultiAddress_details, 1, DateTime.Now);
                                        AddressmaxCheck++;
                                    }
                                }
                            }
                            if (AddressmaxCheck > 25)
                            {
                                HttpContext.Current.Session["multiParcel_GAForsyth_Multicount"] = "Maximum";
                            }
                            else
                            {
                                HttpContext.Current.Session["multiparcel_GAForsyth"] = "Yes";
                            }
                            driver.Quit();
                            return("MultiParcel");
                        }
                        catch
                        { }
                    }
                    try
                    {
                        IWebElement Inodata = driver.FindElement(By.Id("ctlBodyPane_noDataList_pnlNoResults"));
                        if (Inodata.Text.Contains("No results match your search criteria"))
                        {
                            HttpContext.Current.Session["Nodata_ForsythGA"] = "Yes";
                            driver.Quit();
                            return("No Data Found");
                        }
                    }
                    catch { }
                    //Property Details
                    IWebElement         PropertyTB = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl00_mSection']/div/table[1]/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 Number"))
                            {
                                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("Legal Description"))
                            {
                                Legal = PropertyTD[1].Text;
                            }

                            Pro_Cls = PropertyTD[0].Text;
                            if (Pro_Cls.Contains("Property Class"))
                            {
                                Property_Class = PropertyTD[1].Text;
                            }

                            Nhg = PropertyTD[0].Text;
                            if (Nhg.Contains("Neighborhood"))
                            {
                                Nighbrhod = PropertyTD[1].Text;
                            }

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

                            Zone = PropertyTD[0].Text;
                            if (Zone.Contains("Zoning"))
                            {
                                Zoing = PropertyTD[1].Text;
                            }

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

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

                            Exemp = PropertyTD[0].Text;
                            if (Exemp.Contains("Exemptions"))
                            {
                                Exemption = PropertyTD[1].Text;
                            }
                        }
                    }

                    try
                    {                                        //  ctlBodyPane_ctl01_ctl01_lnkOwnerName1_lnkSearch
                                                             //ctlBodyPane_ctl01_ctl01_lnkOwnerName1_lblSearch
                        try
                        {
                            Owner1 = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl01_ctl01_lnkOwnerName1_lblSearch']")).Text;
                        }
                        catch
                        {
                            Owner1 = driver.FindElement(By.Id("ctlBodyPane_ctl01_ctl01_lnkOwnerName1_lnkSearch")).Text;
                        }
                        Owner2             = driver.FindElement(By.Id("ctlBodyPane_ctl01_ctl01_lblOwnerName2")).Text;
                        Mailing_Address1   = driver.FindElement(By.Id("ctlBodyPane_ctl01_ctl01_lblAddress1")).Text;
                        Mailing_Address2   = driver.FindElement(By.Id("ctlBodyPane_ctl01_ctl01_lblCityStZip")).Text;
                        Overall_OwnMailAdd = Owner1 + " " + Owner2 + " & " + Mailing_Address1 + " " + Mailing_Address2;
                    }
                    catch
                    { }

                    if (Owner2.Trim() == "")
                    {
                        try
                        {
                            Owner1 = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl01_ctl01_lnkOwnerName1_lblSearch']")).Text;
                        }
                        catch
                        {
                            Owner1 = driver.FindElement(By.Id("ctlBodyPane_ctl01_ctl01_lnkOwnerName1_lnkSearch")).Text;
                        }
                        Mailing_Address1   = driver.FindElement(By.Id("ctlBodyPane_ctl01_ctl01_lblAddress1")).Text;
                        Mailing_Address2   = driver.FindElement(By.Id("ctlBodyPane_ctl01_ctl01_lblCityStZip")).Text;
                        Overall_OwnMailAdd = Owner1 + " & " + Mailing_Address1 + " " + Mailing_Address2;
                    }
                    try
                    {
                        IWebElement         Yeartb = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl06_mSection']/div/div/div[1]/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 && Tax4.Text.Contains("Year Built"))
                            {
                                Year_Built = YearTD[1].Text;
                            }
                        }
                    }
                    catch
                    { }

                    property = Location + "~" + Legal + "~" + Property_Class + "~" + Nighbrhod + "~" + Tax_Dis + "~" + Zoing + "~" + Acres + "~" + Homestd + "~" + Exemption + "~" + Overall_OwnMailAdd + "~" + Year_Built;
                    gc.insert_date(orderNumber, Parcel_ID, 1243, property, 1, DateTime.Now);

                    //Assessment Details
                    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)
                        {
                            try
                            {
                                Year1 = AssmTh[0].Text;
                                Year2 = AssmTh[1].Text;
                                Year3 = AssmTh[2].Text;
                                Year4 = AssmTh[3].Text;
                                Year5 = AssmTh[4].Text;
                                Year6 = AssmTh[5].Text;
                            }
                            catch { }
                        }
                    }

                    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> LUC         = new List <string>();
                    List <string> Class       = new List <string>();
                    List <string> Land_Value  = new List <string>();
                    List <string> Build_Value = new List <string>();
                    List <string> Total_Value = new List <string>();
                    List <string> Assed_Value = new List <string>();

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

                        if (AssmTd.Count != 0)
                        {
                            if (j == 0)
                            {
                                LUC.Add(AssmTd[2].Text);
                                LUC.Add(AssmTd[3].Text);
                            }
                            else if (j == 1)
                            {
                                Class.Add(AssmTd[2].Text);
                                Class.Add(AssmTd[3].Text);
                            }
                            else if (j == 2)
                            {
                                Land_Value.Add(AssmTd[2].Text);
                                Land_Value.Add(AssmTd[3].Text);
                            }
                            else if (j == 3)
                            {
                                Build_Value.Add(AssmTd[2].Text);
                                Build_Value.Add(AssmTd[3].Text);
                            }
                            else if (j == 4)
                            {
                                Total_Value.Add(AssmTd[2].Text);
                                Total_Value.Add(AssmTd[3].Text);
                            }
                            else if (j == 6)
                            {
                                Assed_Value.Add(AssmTd[2].Text);
                                Assed_Value.Add(AssmTd[3].Text);
                            }

                            j++;
                        }
                    }

                    Assemnt_Details1 = Year1 + "~" + LUC[0] + "~" + Class[0] + "~" + Land_Value[0] + "~" + Build_Value[0] + "~" + Total_Value[0] + "~" + Assed_Value[0];
                    Assemnt_Details2 = Year2 + "~" + LUC[1] + "~" + Class[1] + "~" + Land_Value[1] + "~" + Build_Value[1] + "~" + Total_Value[1] + "~" + Assed_Value[1];
                    //Assemnt_Details3 = Year3 + "~" + LUC[2] + "~" + Class[2] + "~" + Land_Value[2] + "~" + Build_Value[2] + "~" + Total_Value[2] + "~" + Assed_Value[2];
                    //Assemnt_Details4 = Year4 + "~" + LUC[3] + "~" + Class[3] + "~" + Land_Value[3] + "~" + Build_Value[3] + "~" + Total_Value[3] + "~" + Assed_Value[3];
                    //string Assemnt_Details5 = Year5 + "~" + LUC[4] + "~" + Class[4] + "~" + Land_Value[4] + "~" + Build_Value[4] + "~" + Total_Value[4] + "~" + Assed_Value[4];
                    //string Assemnt_Details6 = Year6 + "~" + LUC[5] + "~" + Class[5] + "~" + Land_Value[5] + "~" + Build_Value[5] + "~" + Total_Value[5] + "~" + Assed_Value[5];
                    gc.insert_date(orderNumber, Parcel_ID, 1244, Assemnt_Details1, 1, DateTime.Now);
                    gc.insert_date(orderNumber, Parcel_ID, 1244, Assemnt_Details2, 1, DateTime.Now);
                    //gc.insert_date(orderNumber, Parcel_ID, 1244, Assemnt_Details3, 1, DateTime.Now);
                    //gc.insert_date(orderNumber, Parcel_ID, 1244, Assemnt_Details4, 1, DateTime.Now);
                    //gc.insert_date(orderNumber, Parcel_ID, 1244, Assemnt_Details5, 1, DateTime.Now);
                    //gc.insert_date(orderNumber, Parcel_ID, 1244, Assemnt_Details6, 1, DateTime.Now);
                    gc.CreatePdf(orderNumber, Parcel_ID, "Property Details", driver, "GA", "Forsyth");
                    AssessmentTime = DateTime.Now.ToString("HH:mm:ss");
                    //tax site
                    driver.Navigate().GoToUrl("https://www1.forsythco.com/PayPropertyTax/TaxBillSearch.aspx");
                    string p_no       = Parcel_ID.Trim();
                    string parcel     = p_no.Split(' ')[0];
                    string parcel_num = p_no.Split(' ')[1];

                    driver.FindElement(By.Id("Body_MapParcelID1")).SendKeys(parcel);
                    driver.FindElement(By.Id("Body_MapParcelID2")).SendKeys(parcel_num);
                    gc.CreatePdf(orderNumber, Parcel_ID, "Tax Parcel", driver, "GA", "Forsyth");
                    driver.FindElement(By.Id("Body_MapParcelIDGo")).Click();
                    Thread.Sleep(2000);
                    gc.CreatePdf(orderNumber, Parcel_ID, "Tax Parcel click", driver, "GA", "Forsyth");
                    IWebElement Percelhref = driver.FindElement(By.XPath("//*[@id='Body_GridView1']/tbody/tr[2]/td[1]/a"));
                    string      Hrefclick  = Percelhref.GetAttribute("href");
                    driver.Navigate().GoToUrl(Hrefclick);
                    Thread.Sleep(1000);
                    List <string> ParcelSearch = new List <string>();
                    try
                    {
                        gc.CreatePdf(orderNumber, Parcel_ID, "Tax Information click", driver, "GA", "Forsyth");
                        IWebElement         ParcelTB = driver.FindElement(By.XPath("//*[@id='Body_GridView1']/tbody"));
                        IList <IWebElement> ParcelTR = ParcelTB.FindElements(By.TagName("tr"));
                        ParcelTR.Reverse();
                        int rows_count = ParcelTR.Count;

                        for (int row = 0; row < rows_count; row++)
                        {
                            if (row == rows_count - 3 || row == rows_count - 1 || row == rows_count - 2)
                            {
                                IList <IWebElement> Columns_row = ParcelTR[row].FindElements(By.TagName("td"));
                                int columns_count = Columns_row.Count;
                                if (columns_count != 0)
                                {
                                    IWebElement ParcelBill_link = Columns_row[1].FindElement(By.TagName("a"));
                                    string      Parcelurl       = ParcelBill_link.GetAttribute("href");
                                    ParcelSearch.Add(Parcelurl);
                                }
                            }
                        }
                    }
                    catch { }
                    string              bodyowner          = driver.FindElement(By.Id("Body_Owners")).Text;
                    IWebElement         taxbillnumbertable = driver.FindElement(By.XPath("//*[@id='Body_GridView1']/tbody"));
                    IList <IWebElement> taxbillnumberrow   = taxbillnumbertable.FindElements(By.TagName("tr"));
                    IList <IWebElement> taxbillnumberid;
                    foreach (IWebElement Currenttax1 in taxbillnumberrow)
                    {
                        taxbillnumberid = Currenttax1.FindElements(By.TagName("td"));
                        if (taxbillnumberid.Count == 4 && taxbillnumberid[1].Text.Trim() != "")
                        {
                            string taxbillnumberresult = bodyowner + "~" + taxbillnumberid[0].Text + "~" + taxbillnumberid[1].Text + "~" + taxbillnumberid[2].Text;
                            gc.insert_date(orderNumber, Parcel_ID, 1250, taxbillnumberresult, 1, DateTime.Now);
                        }
                    }

                    gc.CreatePdf(orderNumber, Parcel_ID, "Tax Click after", driver, "GA", "Forsyth");
                    string TotalPaymenthead     = driver.FindElement(By.Id("Body_TotalPaymentsPendingLabel")).Text;
                    string Toatalpaymentpending = driver.FindElement(By.Id("Body_TotalPaymentsPending")).Text;
                    gc.insert_date(orderNumber, Parcel_ID, 1250, "~" + "~" + TotalPaymenthead + "~" + Toatalpaymentpending, 1, DateTime.Now);
                    string ConvenFeehead = driver.FindElement(By.Id("Body_Label1")).Text;
                    string convenfeebody = driver.FindElement(By.Id("Body_ConvenienceFee")).Text;
                    gc.insert_date(orderNumber, Parcel_ID, 1250, "~" + "~" + ConvenFeehead + "~" + convenfeebody, 1, DateTime.Now);
                    string Totalbodyhead = driver.FindElement(By.Id("Body_Label2")).Text;
                    string Totalamtbody  = driver.FindElement(By.Id("Body_TotalAmountToBePaid")).Text;
                    gc.insert_date(orderNumber, Parcel_ID, 1250, "~" + "~" + Totalbodyhead + "~" + Totalamtbody, 1, DateTime.Now);
                    int i = 0;
                    foreach (string taxlink in ParcelSearch)
                    {
                        driver.Navigate().GoToUrl(taxlink);
                        string Taxyear1      = driver.FindElement(By.Id("PropertyTaxLabel")).Text;
                        string Taxyear       = GlobalClass.Before(Taxyear1, "Property Tax").Trim();
                        string Taxpayer      = driver.FindElement(By.Id("TaxPayerText")).Text;
                        string Discription   = driver.FindElement(By.Id("DescriptionText")).Text;
                        string LocationTax   = driver.FindElement(By.Id("LocationText")).Text;
                        string Billnumber    = driver.FindElement(By.Id("BillNoText")).Text;
                        string district      = driver.FindElement(By.Id("DistrictText")).Text;
                        string Builiding     = driver.FindElement(By.Id("BuildingValueText")).Text;
                        string Lanvalue      = driver.FindElement(By.Id("LandValueText")).Text;
                        string Arces         = driver.FindElement(By.Id("AcresText")).Text;
                        string FairMarket    = driver.FindElement(By.Id("FairMarketValueText")).Text;
                        string Duedate       = driver.FindElement(By.Id("DueDateText")).Text;
                        string Exemptions    = driver.FindElement(By.Id("ExemptionsText")).Text;
                        string Topduedaate   = driver.FindElement(By.Id("DueDateTopText")).Text;
                        string Totaldue      = driver.FindElement(By.Id("TotalDueTopText")).Text;
                        string Lastpayerid   = driver.FindElement(By.Id("LastPaymentTopText")).Text;
                        string Lastpayername = GlobalClass.After(Lastpayerid, "Last payment made on:");
                        Tax_Auth1     = driver.FindElement(By.Id("title")).Text;
                        Tax_Auth2     = driver.FindElement(By.Id("streetAddress")).Text;
                        Tax_Authotiry = driver.FindElement(By.Id("cityStateZip")).Text;
                        string Tax_Auth3 = driver.FindElement(By.XPath("//*[@id='commissionerData']/tbody/tr[8]/td")).Text;
                        TaxAuthority_Details = Tax_Auth1 + " " + Tax_Auth2 + " " + Tax_Authotiry + " " + Tax_Auth3;
                        string TaxDetailresult = Taxyear + "~" + Taxpayer + "~" + Discription + "~" + LocationTax + "~" + Billnumber + "~" + district + "~" + Builiding + "~" + Lanvalue + "~" + Arces + "~" + FairMarket + "~" + Duedate + "~" + Exemptions + "~" + Totaldue + "~" + Lastpayername + "~" + TaxAuthority_Details;
                        gc.insert_date(orderNumber, Parcel_ID, 1247, TaxDetailresult, 1, DateTime.Now);
                        IWebElement         CurrenttaxTable = driver.FindElement(By.XPath("//*[@id='EntityTable']/tbody"));
                        IList <IWebElement> Currenttaxrow   = CurrenttaxTable.FindElements(By.TagName("tr"));
                        IList <IWebElement> Currenttaxid;
                        foreach (IWebElement Currenttax in Currenttaxrow)
                        {
                            Currenttaxid = Currenttax.FindElements(By.TagName("td"));
                            if (Currenttaxid.Count == 9 && !Currenttax.Text.Contains("Entity"))
                            {
                                string Currentresult = Taxyear + "~" + Currenttaxid[0].Text + "~" + Currenttaxid[1].Text + "~" + Currenttaxid[2].Text + "~" + Currenttaxid[3].Text + "~" + Currenttaxid[4].Text + "~" + Currenttaxid[5].Text + "~" + Currenttaxid[6].Text + "~" + Currenttaxid[7].Text + "~" + Currenttaxid[8].Text;
                                gc.insert_date(orderNumber, Parcel_ID, 1248, Currentresult, 1, DateTime.Now);
                            }
                            if (Currenttaxid.Count == 5 && !Currenttax.Text.Contains("Entity"))
                            {
                                string Currentresult = Taxyear + "~" + " " + "~" + "~" + "~" + "~" + Currenttaxid[0].Text + "~" + Currenttaxid[1].Text + "~" + Currenttaxid[2].Text + "~" + Currenttaxid[3].Text + "~" + Currenttaxid[4].Text;
                                gc.insert_date(orderNumber, Parcel_ID, 1248, Currentresult, 1, DateTime.Now);
                            }
                        }
                        gc.CreatePdf(orderNumber, Parcel_ID, "Property Tax statment" + i, driver, "GA", "Forsyth");
                        IWebElement         CurrenttaxTable1 = driver.FindElement(By.XPath("//*[@id='CurrentDueTable']/tbody"));
                        IList <IWebElement> Currenttaxrow1   = CurrenttaxTable1.FindElements(By.TagName("tr"));
                        IList <IWebElement> Currenttaxid1;
                        foreach (IWebElement Currenttax1 in Currenttaxrow1)
                        {
                            Currenttaxid1 = Currenttax1.FindElements(By.TagName("td"));
                            if (Currenttaxid1.Count == 3 && Currenttaxid1[1].Text.Trim() != "")
                            {
                                string Currentresult = Taxyear + "~" + Currenttaxid1[1].Text + "~" + Currenttaxid1[2].Text;
                                gc.insert_date(orderNumber, Parcel_ID, 1361, Currentresult, 1, DateTime.Now);
                            }
                        }
                        i++;
                    }
                    driver.Quit();
                    gc.mergpdf(orderNumber, "GA", "Forsyth");
                    return("Data Inserted Successfully");
                }
                catch (Exception ex)
                {
                    driver.Quit();
                    GlobalClass.LogError(ex, orderNumber);
                    throw ex;
                }
            }
        }
예제 #5
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;
                }
            }
        }