示例#1
0
        public ActionResult DeleteConfirmed(Guid id)
        {
            TaxPayment taxPayment = db.TaxPayments.Find(id);

            db.TaxPayments.Remove(taxPayment);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#2
0
 public ActionResult Edit([Bind(Include = "Id,PaymentDate,AmountPaid,ExpiryDate,VehicleId")] TaxPayment taxPayment)
 {
     if (ModelState.IsValid)
     {
         db.Entry(taxPayment).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.VehicleId = new SelectList(DataFilter.GetVehicles(TempData.Peek("Id") + ""), "Id", "RegistrationNumber", taxPayment.VehicleId);
     return(View(taxPayment));
 }
示例#3
0
        public void TaxPaymentFindByIdAsyncTest()
        {
            QueryService <TaxPayment> entityQuery = new QueryService <TaxPayment>(qboContextoAuth);
            List <TaxPayment>         entities    = entityQuery.ExecuteIdsQuery("SELECT * FROM TaxPayment").ToList <TaxPayment>();

            if (entities.Count > 0)
            {
                TaxPayment added = entities[0];
                TaxPayment found = Helper.FindByIdAsync <TaxPayment>(qboContextoAuth, added);
                QBOHelper.VerifyTaxPayment(found, added);
            }
        }
示例#4
0
        public ActionResult Create([Bind(Include = "Id,PaymentDate,AmountPaid,ExpiryDate,VehicleId")] TaxPayment taxPayment)
        {
            if (ModelState.IsValid)
            {
                taxPayment.Id = Guid.NewGuid();
                db.TaxPayments.Add(taxPayment);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.VehicleId = new SelectList(DataFilter.GetVehicles(TempData.Peek("Id") + ""), "Id", "RegistrationNumber", taxPayment.VehicleId);
            return(View(taxPayment));
        }
示例#5
0
        // GET: TaxPayments/Details/5
        public ActionResult Details(Guid?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TaxPayment taxPayment = db.TaxPayments.Find(id);

            if (taxPayment == null)
            {
                return(HttpNotFound());
            }
            return(View(taxPayment));
        }
示例#6
0
        // GET: TaxPayments/Edit/5
        public ActionResult Edit(Guid?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TaxPayment taxPayment = db.TaxPayments.Find(id);

            if (taxPayment == null)
            {
                return(HttpNotFound());
            }
            ViewBag.VehicleId = new SelectList(DataFilter.GetVehicles(TempData.Peek("Id") + ""), "Id", "RegistrationNumber", taxPayment.VehicleId);
            return(View(taxPayment));
        }
示例#7
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;
                }
            }
        }
        public string FTP_FLPalmBeach(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 = "";

            var driverService = PhantomJSDriverService.CreateDefaultService();

            driverService.HideCommandPromptWindow = true;
            string[] stringSeparators1 = new string[] { "\r\n" };
            // driver = new ChromeDriver();
            using (driver = new PhantomJSDriver())
            {
                try
                {
                    StartTime = DateTime.Now.ToString("HH:mm:ss");
                    if (searchType == "titleflex")
                    {
                        // string titleaddress = houseno + " " + housedir + " " + sname + " " + sttype + " " + unitno;
                        gc.TitleFlexSearch(orderNumber, "", "", address, "FL", "Palm Beach");
                        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_FLPalmBeach"] = "Yes";
                            driver.Quit();
                            return("No Data Found");
                        }
                        parcelNumber = HttpContext.Current.Session["titleparcel"].ToString();
                        searchType   = "parcel";
                    }

                    if (searchType == "address")
                    {
                        driver.Navigate().GoToUrl("http://www.pbcgov.com/PAPA/index.htm");
                        Thread.Sleep(4000);

                        IWebElement iframeElement = driver.FindElement(By.Id("master-search"));
                        Thread.Sleep(6000);
                        driver.SwitchTo().Frame(iframeElement);

                        driver.FindElement(By.Id("txtSearch")).SendKeys(address);
                        gc.CreatePdf_WOP(orderNumber, "Address search", driver, "FL", "Palm Beach");

                        driver.FindElement(By.XPath("//*[@id='form2']/div[3]/div[1]/div/button")).SendKeys(Keys.Enter);
                        Thread.Sleep(2000);

                        //MultiParcel
                        try
                        {
                            IWebElement         MultiTable = driver.FindElement(By.Id("gvSrchResults"));
                            IList <IWebElement> MultiTR    = MultiTable.FindElements(By.TagName("tr"));
                            IList <IWebElement> MultiTD;

                            int maxCheck = 0;

                            gc.CreatePdf_WOP(orderNumber, "MultiAddresssearch", driver, "FL", "Palm Beach");
                            foreach (IWebElement Multi in MultiTR)
                            {
                                MultiTD = Multi.FindElements(By.TagName("td"));
                                if (MultiTD.Count != 0 && !Multi.Text.Contains("Owner Name"))
                                {
                                    OwnerName    = MultiTD[0].Text;
                                    Location     = MultiTD[1].Text;
                                    Municipality = MultiTD[2].Text;
                                    parcelNumber = MultiTD[3].Text;

                                    Multidata = OwnerName + "~" + Location + "~" + Municipality;
                                    gc.insert_date(orderNumber, parcelNumber, 330, Multidata, 1, DateTime.Now);
                                }
                                maxCheck++;
                            }


                            if (maxCheck <= 25)
                            {
                                HttpContext.Current.Session["multiParcel_FLPalmBeach"] = "Yes";
                                GlobalClass.multiParcel_FLPalmBeach = "Yes";
                                driver.Quit();
                                return("MultiParcel");
                            }
                            if (MultiTR.Count > 25)
                            {
                                HttpContext.Current.Session["multiParcel_FLPalmBeach_Multicount"] = "Maximum";
                                GlobalClass.multiParcel_FLPalmBeach_Multicount = "Maximum";
                                driver.Quit();
                                return("Maximum");
                            }
                        }
                        catch
                        { }
                    }
                    else if (searchType == "parcel")
                    {
                        driver.Navigate().GoToUrl("http://www.pbcgov.com/PAPA/index.htm");
                        Thread.Sleep(2000);

                        IWebElement iframeElement = driver.FindElement(By.Id("master-search"));
                        Thread.Sleep(6000);
                        driver.SwitchTo().Frame(iframeElement);

                        driver.FindElement(By.Id("txtSearch")).SendKeys(parcelNumber);
                        gc.CreatePdf(orderNumber, parcelNumber, "ParcelSearch", driver, "FL", "Palm Beach");

                        driver.FindElement(By.XPath("//*[@id='form2']/div[3]/div[1]/div/button")).SendKeys(Keys.Enter);
                        Thread.Sleep(2000);
                    }
                    else if (searchType == "ownername")
                    {
                        driver.Navigate().GoToUrl("http://www.pbcgov.com/PAPA/index.htm");
                        Thread.Sleep(2000);

                        IWebElement iframeElement = driver.FindElement(By.Id("master-search"));
                        Thread.Sleep(6000);
                        driver.SwitchTo().Frame(iframeElement);

                        driver.FindElement(By.Id("txtSearch")).SendKeys(ownername);
                        gc.CreatePdf(orderNumber, parcelNumber, "OwnerSearch", driver, "FL", "Palm Beach");

                        driver.FindElement(By.XPath("//*[@id='form2']/div[3]/div[1]/div/button")).SendKeys(Keys.Enter);
                        Thread.Sleep(2000);

                        //MultiParcel
                        try
                        {
                            IWebElement         MultiTable = driver.FindElement(By.Id("gvSrchResults"));
                            IList <IWebElement> MultiTR    = MultiTable.FindElements(By.TagName("tr"));
                            IList <IWebElement> MultiTD;

                            int maxCheck = 0;

                            gc.CreatePdf_WOP(orderNumber, "MultiOwnersearch", driver, "FL", "Palm Beach");
                            foreach (IWebElement Multi in MultiTR)
                            {
                                if (maxCheck <= 25)
                                {
                                    MultiTD = Multi.FindElements(By.TagName("td"));
                                    if (MultiTD.Count != 0 && !Multi.Text.Contains("Owner Name"))
                                    {
                                        OwnerName    = MultiTD[0].Text;
                                        Location     = MultiTD[1].Text;
                                        Municipaliti = MultiTD[2].Text;
                                        parcelNumber = MultiTD[3].Text;

                                        Multidata = OwnerName + "~" + Location + "~" + Municipaliti;
                                        gc.insert_date(orderNumber, parcelNumber, 330, Multidata, 1, DateTime.Now);
                                    }
                                    maxCheck++;
                                }
                            }
                            HttpContext.Current.Session["multiParcel_FLPalmBeach"] = "Yes";
                            if (MultiTR.Count > 25)
                            {
                                HttpContext.Current.Session["multiParcel_FLPalmBeach_Multicount"] = "Maximum";
                                return("Maximum");
                            }
                            driver.Quit();
                            return("MultiParcel");
                        }
                        catch
                        { }
                    }

                    try
                    {
                        string Nodata = driver.FindElement(By.Id("MainContent_lblMsg")).Text;
                        if (Nodata == "No Results matched your search criteria. Please modify your search and try again.")
                        {
                            HttpContext.Current.Session["Nodata_FLPalmBeach"] = "Yes";
                            driver.Quit();
                            return("No Data Found");
                        }
                    }
                    catch
                    { }

                    //Scraped Data
                    Location_Address = driver.FindElement(By.XPath("//*[@id='tdDetail']/table/tbody/tr[2]/td[2]")).Text;
                    Municipality     = driver.FindElement(By.XPath("//*[@id='tdDetail']/table/tbody/tr[3]/td[2]")).Text;
                    ParcelNo         = driver.FindElement(By.XPath("//*[@id='tdDetail']/table/tbody/tr[4]/td[2]")).Text;
                    amck.TaxId       = ParcelNo;
                    gc.CreatePdf(orderNumber, ParcelNo, "Property Result", driver, "FL", "Palm Beach");
                    try
                    {
                        SubDivision       = driver.FindElement(By.XPath("//*[@id='tdDetail']/table/tbody/tr[5]/td[2]")).Text;
                        Legal_Description = driver.FindElement(By.XPath("//*[@id='tdDetail']/table/tbody/tr[8]/td[2]")).Text;

                        IWebElement         Acrestable = driver.FindElement(By.XPath("//*[@id='propertyInformationDiv']/fieldset/table[1]/tbody/tr[2]/td[1]/table[2]/tbody"));
                        IList <IWebElement> AcresTR    = Acrestable.FindElements(By.TagName("tr"));
                        IList <IWebElement> AcresTD;

                        foreach (IWebElement Acre in AcresTR)
                        {
                            AcresTD = Acre.FindElements(By.TagName("td"));
                            if (AcresTD.Count != 0 && Acre.Text.Contains("Acres"))
                            {
                                Acres = AcresTD[1].Text;
                            }
                        }

                        IWebElement         Yeartable = driver.FindElement(By.XPath("//*[@id='propertyInformationDiv']/fieldset/table[1]/tbody/tr[2]/td[2]/table/tbody"));
                        IList <IWebElement> YearTR    = Yeartable.FindElements(By.TagName("tr"));
                        IList <IWebElement> YearTD;

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

                        IWebElement         OwnerTable = driver.FindElement(By.XPath("//*[@id='ownerInformationDiv']/fieldset/table/tbody/tr[2]/td[1]/table/tbody"));
                        IList <IWebElement> OwnerTR    = OwnerTable.FindElements(By.TagName("tr"));
                        IList <IWebElement> OwnerTD;

                        foreach (IWebElement Owner in OwnerTR)
                        {
                            OwnerTD = Owner.FindElements(By.TagName("td"));
                            if (OwnerTD.Count != 0 && !Owner.Text.Contains("Owner(s)"))
                            {
                                Owner_Name += OwnerTD[0].Text + " ";
                            }
                        }
                        string Mailaddress1     = driver.FindElement(By.Id("MainContent_lblAddrLine3")).Text;
                        string Mailing_Address2 = driver.FindElement(By.XPath("//*[@id='ownerInformationDiv']/fieldset/table/tbody/tr[2]/td[2]/table/tbody/tr[2]/td")).Text;
                        Mailing_Address = Mailing_Address2 + " " + Mailaddress1;
                    }
                    catch
                    { }
                    Property_Details = Location_Address + "~" + Municipality + "~" + SubDivision + "~" + Legal_Description + "~" + Acres + "~" + Year_Built + "~" + Owner_Name + "~" + Mailing_Address;
                    gc.insert_date(orderNumber, ParcelNo, 338, Property_Details, 1, DateTime.Now);

                    //Appraisals Details
                    try
                    {
                        IWebElement         AppraisalsTable = driver.FindElement(By.XPath("//*[@id='tblApprsal']/tbody"));
                        IList <IWebElement> AppraisalsTR    = AppraisalsTable.FindElements(By.TagName("tr"));
                        IList <IWebElement> AppraisalsTD;

                        List <string> Tax_Year          = new List <string>();
                        List <string> Improvement_Value = new List <string>();
                        List <string> Land_Value        = new List <string>();
                        List <string> TotalMarket_Value = new List <string>();

                        int i = 1;
                        foreach (IWebElement Appraisals in AppraisalsTR)
                        {
                            AppraisalsTD = Appraisals.FindElements(By.TagName("td"));
                            if (!Appraisals.Text.Contains("Show 5 year"))
                            {
                                if (i == 1)
                                {
                                    Tax_Year.Add(AppraisalsTD[1].Text);
                                    Tax_Year.Add(AppraisalsTD[2].Text);
                                    Tax_Year.Add(AppraisalsTD[3].Text);
                                    Tax_Year.Add(AppraisalsTD[4].Text);
                                    Tax_Year.Add(AppraisalsTD[5].Text);
                                }
                                else if (i == 2)
                                {
                                    Improvement_Value.Add(AppraisalsTD[1].Text);
                                    Improvement_Value.Add(AppraisalsTD[2].Text);
                                    Improvement_Value.Add(AppraisalsTD[3].Text);
                                    Improvement_Value.Add(AppraisalsTD[4].Text);
                                    Improvement_Value.Add(AppraisalsTD[5].Text);
                                }
                                else if (i == 3)
                                {
                                    Land_Value.Add(AppraisalsTD[1].Text);
                                    Land_Value.Add(AppraisalsTD[2].Text);
                                    Land_Value.Add(AppraisalsTD[3].Text);
                                    Land_Value.Add(AppraisalsTD[4].Text);
                                    Land_Value.Add(AppraisalsTD[5].Text);
                                }
                                else if (i == 4)
                                {
                                    TotalMarket_Value.Add(AppraisalsTD[1].Text);
                                    TotalMarket_Value.Add(AppraisalsTD[2].Text);
                                    TotalMarket_Value.Add(AppraisalsTD[3].Text);
                                    TotalMarket_Value.Add(AppraisalsTD[4].Text);
                                    TotalMarket_Value.Add(AppraisalsTD[5].Text);
                                }
                                i++;
                            }
                        }
                        Appraisals_details1 = Tax_Year[0] + "~" + Improvement_Value[0] + "~" + Land_Value[0] + "~" + TotalMarket_Value[0];
                        Appraisals_details2 = Tax_Year[1] + "~" + Improvement_Value[1] + "~" + Land_Value[1] + "~" + TotalMarket_Value[1];
                        Appraisals_details3 = Tax_Year[2] + "~" + Improvement_Value[2] + "~" + Land_Value[2] + "~" + TotalMarket_Value[2];
                        Appraisals_details4 = Tax_Year[3] + "~" + Improvement_Value[3] + "~" + Land_Value[3] + "~" + TotalMarket_Value[3];
                        Appraisals_details5 = Tax_Year[4] + "~" + Improvement_Value[4] + "~" + Land_Value[4] + "~" + TotalMarket_Value[4];
                        //gc.CreatePdf(orderNumber, ParcelNo, "Appraisls Details", driver, "FL", "Palm Beach");
                        gc.insert_date(orderNumber, ParcelNo, 342, Appraisals_details1, 1, DateTime.Now);
                        gc.insert_date(orderNumber, ParcelNo, 342, Appraisals_details2, 1, DateTime.Now);
                        gc.insert_date(orderNumber, ParcelNo, 342, Appraisals_details3, 1, DateTime.Now);
                        gc.insert_date(orderNumber, ParcelNo, 342, Appraisals_details4, 1, DateTime.Now);
                        gc.insert_date(orderNumber, ParcelNo, 342, Appraisals_details5, 1, DateTime.Now);
                    }
                    catch
                    { }

                    //Assessed Details
                    try
                    {
                        IWebElement         AssessedTable = driver.FindElement(By.XPath("//*[@id='tblAssVal']/tbody"));
                        IList <IWebElement> AssessedTR    = AssessedTable.FindElements(By.TagName("tr"));
                        IList <IWebElement> AssessedTD;

                        List <string> Tax_Year         = new List <string>();
                        List <string> Assessed_Value   = new List <string>();
                        List <string> Exemption_Amount = new List <string>();
                        List <string> Taxable_Value    = new List <string>();

                        int j = 1;
                        foreach (IWebElement Assessed in AssessedTR)
                        {
                            AssessedTD = Assessed.FindElements(By.TagName("td"));
                            if (!Assessed.Text.Contains("Show 5 year"))
                            {
                                if (j == 1)
                                {
                                    Tax_Year.Add(AssessedTD[1].Text);
                                    Tax_Year.Add(AssessedTD[2].Text);
                                    Tax_Year.Add(AssessedTD[3].Text);
                                    Tax_Year.Add(AssessedTD[4].Text);
                                    Tax_Year.Add(AssessedTD[5].Text);
                                }
                                else if (j == 2)
                                {
                                    Assessed_Value.Add(AssessedTD[1].Text);
                                    Assessed_Value.Add(AssessedTD[2].Text);
                                    Assessed_Value.Add(AssessedTD[3].Text);
                                    Assessed_Value.Add(AssessedTD[4].Text);
                                    Assessed_Value.Add(AssessedTD[5].Text);
                                }
                                else if (j == 3)
                                {
                                    Exemption_Amount.Add(AssessedTD[1].Text);
                                    Exemption_Amount.Add(AssessedTD[2].Text);
                                    Exemption_Amount.Add(AssessedTD[3].Text);
                                    Exemption_Amount.Add(AssessedTD[4].Text);
                                    Exemption_Amount.Add(AssessedTD[5].Text);
                                }
                                else if (j == 4)
                                {
                                    Taxable_Value.Add(AssessedTD[1].Text);
                                    Taxable_Value.Add(AssessedTD[2].Text);
                                    Taxable_Value.Add(AssessedTD[3].Text);
                                    Taxable_Value.Add(AssessedTD[4].Text);
                                    Taxable_Value.Add(AssessedTD[5].Text);
                                }
                                j++;
                            }
                        }
                        Assessed_details1 = Tax_Year[0] + "~" + Assessed_Value[0] + "~" + Exemption_Amount[0] + "~" + Taxable_Value[0];
                        Assessed_details2 = Tax_Year[1] + "~" + Assessed_Value[1] + "~" + Exemption_Amount[1] + "~" + Taxable_Value[1];
                        Assessed_details3 = Tax_Year[2] + "~" + Assessed_Value[2] + "~" + Exemption_Amount[2] + "~" + Taxable_Value[2];
                        Assessed_details4 = Tax_Year[3] + "~" + Assessed_Value[3] + "~" + Exemption_Amount[3] + "~" + Taxable_Value[3];
                        Assessed_details5 = Tax_Year[4] + "~" + Assessed_Value[4] + "~" + Exemption_Amount[4] + "~" + Taxable_Value[4];
                        //gc.CreatePdf(orderNumber, ParcelNo, "Assessed Details", driver, "FL", "Palm Beach");
                        gc.insert_date(orderNumber, ParcelNo, 348, Assessed_details1, 1, DateTime.Now);
                        gc.insert_date(orderNumber, ParcelNo, 348, Assessed_details2, 1, DateTime.Now);
                        gc.insert_date(orderNumber, ParcelNo, 348, Assessed_details3, 1, DateTime.Now);
                        gc.insert_date(orderNumber, ParcelNo, 348, Assessed_details4, 1, DateTime.Now);
                        gc.insert_date(orderNumber, ParcelNo, 348, Assessed_details5, 1, DateTime.Now);
                    }
                    catch
                    { }
                    AssessmentTime = DateTime.Now.ToString("HH:mm:ss");

                    //TaxesValue Details
                    try
                    {
                        IWebElement         TaxesValueTable = driver.FindElement(By.XPath("//*[@id='tblTaxes']/tbody"));
                        IList <IWebElement> TaxesValueTR    = TaxesValueTable.FindElements(By.TagName("tr"));
                        IList <IWebElement> TaxesValueTD;

                        List <string> Tax_Year      = new List <string>();
                        List <string> Ad_Valorem    = new List <string>();
                        List <string> NonAd_Valorem = new List <string>();
                        List <string> Total_tax     = new List <string>();

                        int k = 1;
                        foreach (IWebElement TaxesValue in TaxesValueTR)
                        {
                            TaxesValueTD = TaxesValue.FindElements(By.TagName("td"));
                            if (!TaxesValue.Text.Contains("Show 5 year"))
                            {
                                if (k == 1)
                                {
                                    Tax_Year.Add(TaxesValueTD[1].Text);
                                    Tax_Year.Add(TaxesValueTD[2].Text);
                                    Tax_Year.Add(TaxesValueTD[3].Text);
                                    Tax_Year.Add(TaxesValueTD[4].Text);
                                    Tax_Year.Add(TaxesValueTD[5].Text);
                                }
                                else if (k == 2)
                                {
                                    Ad_Valorem.Add(TaxesValueTD[1].Text);
                                    Ad_Valorem.Add(TaxesValueTD[2].Text);
                                    Ad_Valorem.Add(TaxesValueTD[3].Text);
                                    Ad_Valorem.Add(TaxesValueTD[4].Text);
                                    Ad_Valorem.Add(TaxesValueTD[5].Text);
                                }
                                else if (k == 3)
                                {
                                    NonAd_Valorem.Add(TaxesValueTD[1].Text);
                                    NonAd_Valorem.Add(TaxesValueTD[2].Text);
                                    NonAd_Valorem.Add(TaxesValueTD[3].Text);
                                    NonAd_Valorem.Add(TaxesValueTD[4].Text);
                                    NonAd_Valorem.Add(TaxesValueTD[5].Text);
                                }
                                else if (k == 4)
                                {
                                    Total_tax.Add(TaxesValueTD[1].Text);
                                    Total_tax.Add(TaxesValueTD[2].Text);
                                    Total_tax.Add(TaxesValueTD[3].Text);
                                    Total_tax.Add(TaxesValueTD[4].Text);
                                    Total_tax.Add(TaxesValueTD[5].Text);
                                }
                                k++;
                            }
                        }
                        TaxesValue_details1 = Tax_Year[0] + "~" + Ad_Valorem[0] + "~" + NonAd_Valorem[0] + "~" + Total_tax[0];
                        TaxesValue_details2 = Tax_Year[1] + "~" + Ad_Valorem[1] + "~" + NonAd_Valorem[1] + "~" + Total_tax[1];
                        TaxesValue_details3 = Tax_Year[2] + "~" + Ad_Valorem[2] + "~" + NonAd_Valorem[2] + "~" + Total_tax[2];
                        TaxesValue_details4 = Tax_Year[3] + "~" + Ad_Valorem[3] + "~" + NonAd_Valorem[3] + "~" + Total_tax[3];
                        TaxesValue_details5 = Tax_Year[4] + "~" + Ad_Valorem[4] + "~" + NonAd_Valorem[4] + "~" + Total_tax[4];
                        //gc.CreatePdf(orderNumber, ParcelNo, "TaxValues Details", driver, "FL", "Palm Beach");
                        gc.insert_date(orderNumber, ParcelNo, 349, TaxesValue_details1, 1, DateTime.Now);
                        gc.insert_date(orderNumber, ParcelNo, 349, TaxesValue_details2, 1, DateTime.Now);
                        gc.insert_date(orderNumber, ParcelNo, 349, TaxesValue_details3, 1, DateTime.Now);
                        gc.insert_date(orderNumber, ParcelNo, 349, TaxesValue_details4, 1, DateTime.Now);
                        gc.insert_date(orderNumber, ParcelNo, 349, TaxesValue_details5, 1, DateTime.Now);
                    }
                    catch
                    { }

                    //Tax Information Details
                    driver.Navigate().GoToUrl("https://pbctax.manatron.com/Tabs/PropertyTax.aspx");
                    Thread.Sleep(2000);

                    var SelectParcel    = driver.FindElement(By.Id("selSearchBy"));
                    var SelectParcelTax = new SelectElement(SelectParcel);
                    SelectParcelTax.SelectByText("Property Control Number");

                    driver.FindElement(By.Id("fldInput")).SendKeys(ParcelNo);
                    driver.FindElement(By.Id("btnsearch")).SendKeys(Keys.Enter);
                    Thread.Sleep(2000);

                    gc.CreatePdf(orderNumber, ParcelNo, "ParcelTax Details", driver, "FL", "Palm Beach");
                    driver.FindElement(By.XPath("//*[@id='grm-search']/tbody/tr[2]/td[6]/a")).Click();
                    Thread.Sleep(2000);
                    gc.CreatePdf(orderNumber, ParcelNo, "Tax Summary Details", driver, "FL", "Palm Beach");

                    Real_Property    = driver.FindElement(By.XPath("//*[@id='lxT506']/table/tbody/tr[2]/td[2]")).Text;
                    property_Address = driver.FindElement(By.XPath("//*[@id='lxT506']/table/tbody/tr[3]/td/table/tbody/tr[1]/td[2]")).Text;
                    property_Address = WebDriverTest.After(property_Address, "Property Address:").Trim();
                    string[] linesName = property_Address.Split(stringSeparators1, StringSplitOptions.None);
                    OwnerOf_record = driver.FindElement(By.XPath("//*[@id='lxT506']/table/tbody/tr[3]/td/table/tbody/tr[2]/td[1]")).Text;
                    OwnerOf_record = WebDriverTest.After(OwnerOf_record, "Owner of Record").Trim();
                    string[] linesName1 = OwnerOf_record.Split(stringSeparators1, StringSplitOptions.None);
                    driver.Navigate().GoToUrl("https://www.pbctax.com/content/help");
                    Thread.Sleep(2000);
                    Tax_Authority = driver.FindElement(By.XPath("//*[@id='content-area']/div/div/div/div[1]/p")).Text.Replace("Mailing Address", "").Trim();
                    gc.CreatePdf(orderNumber, ParcelNo, "Tax Authority", driver, "FL", "Palm Beach");
                    driver.Navigate().Back();
                    Thread.Sleep(2000);
                    TaxBill_Details = Real_Property + "~" + property_Address + "~" + OwnerOf_record + "~" + Tax_Authority;
                    gc.insert_date(orderNumber, ParcelNo, 357, TaxBill_Details, 1, DateTime.Now);

                    //Tax Payment History Details
                    List <string> billinfo = new List <string>();
                    try
                    {
                        IWebElement         TaxPaymentTB = driver.FindElement(By.XPath("//*[@id='508']/table/tbody"));
                        IList <IWebElement> TaxPaymentTR = TaxPaymentTB.FindElements(By.TagName("tr"));
                        IList <IWebElement> TaxPaymentTD;
                        int a = 0;
                        //gc.CreatePdf(orderNumber, ParcelNo, "Tax Payment Details", driver, "FL", "Palm Beach");
                        foreach (IWebElement TaxPayment in TaxPaymentTR)
                        {
                            TaxPaymentTD = TaxPayment.FindElements(By.TagName("td"));
                            if (TaxPaymentTD.Count != 0)
                            {
                                if (a < 3)
                                {
                                    if (TaxPaymentTD.Count != 0 && !TaxPayment.Text.Contains("Bill Year"))
                                    {
                                        IWebElement value1  = TaxPaymentTD[0].FindElement(By.TagName("a"));
                                        string      addview = value1.GetAttribute("href");
                                        billinfo.Add(addview);
                                    }
                                    a++;
                                }
                                Bill_Year         = TaxPaymentTD[0].Text;
                                Bill_Type         = TaxPaymentTD[1].Text;
                                Bill_Number       = TaxPaymentTD[2].Text;
                                Gross_Tax         = TaxPaymentTD[3].Text;
                                Penalty_Fees      = TaxPaymentTD[4].Text;
                                Interest          = TaxPaymentTD[5].Text;
                                Discount          = TaxPaymentTD[6].Text;
                                Amount_Due        = TaxPaymentTD[7].Text;
                                TaxpaymentDetails = Bill_Year + "~" + Bill_Type + "~" + Bill_Number + "~" + Gross_Tax + "~" + Penalty_Fees + "~" + Interest + "~" + Discount + "~" + Amount_Due;
                                gc.insert_date(orderNumber, ParcelNo, 359, TaxpaymentDetails, 1, DateTime.Now);
                            }
                        }
                    }
                    catch
                    { }
                    //Tax Bill
                    int s = 0;
                    foreach (string taxinfoclick in billinfo)
                    {
                        try
                        {
                            driver.Navigate().GoToUrl(taxinfoclick);
                            Thread.Sleep(2000);
                            gc.CreatePdf(orderNumber, ParcelNo, "TaxBill_priorYear" + s, driver, "FL", "Palm Beach");
                            Billtaxyear = driver.FindElement(By.XPath("//*[@id='lxT538']/h1")).Text.Replace("Bill Detail", "").Trim();
                            //Tax And Assement Details//
                            IWebElement         TaxAssementTB = driver.FindElement(By.XPath("//*[@id='dnn_ContentPane']/div[4]"));
                            IList <IWebElement> TaxAssementTR = TaxAssementTB.FindElements(By.TagName("tr"));
                            IList <IWebElement> TaxAssementTD;
                            int taxrowcount = TaxAssementTR.Count;
                            int b           = 1; /*string pathid = "";*/
                            foreach (IWebElement TaxAssement in TaxAssementTR)
                            {
                                TaxAssementTD = TaxAssement.FindElements(By.TagName("td"));
                                if (TaxAssement.Text.Contains("Ad Valorem"))
                                {
                                    Tax_Type = "Ad Valorem";
                                }
                                if (TaxAssement.Text.Contains("Non Ad Valorem"))
                                {
                                    Tax_Type = "Non Ad Valorem";
                                }

                                if (TaxAssementTD.Count != 0 && !TaxAssement.Text.Contains("Ad Valorem") && TaxAssement.Text != "" && TaxAssementTD.Count != 1 && !TaxAssement.Text.Contains("Non Ad Valorem"))
                                {
                                    if (TaxAssementTD.Count == 4 && !TaxAssement.Text.Contains("Total Tax"))
                                    {
                                        Description         = "Sub Total";
                                        TaxGross_Tax        = TaxAssementTD[0].Text;
                                        Credit              = TaxAssementTD[1].Text;
                                        Net_Tax             = TaxAssementTD[2].Text;
                                        Savings             = TaxAssementTD[3].Text;
                                        TaxAssement_Details = Billtaxyear + "~" + Tax_Type + "~" + Description + "~" + TaxGross_Tax + "~" + Credit + "~" + Net_Tax + "~" + Savings;
                                        gc.insert_date(orderNumber, ParcelNo, 363, TaxAssement_Details, 1, DateTime.Now);
                                    }
                                    else
                                    {
                                        if (b % 2 == 0 && b != taxrowcount)
                                        {
                                            try
                                            {
                                                //pathid = driver.FindElement(By.XPath("//*[@id='lxT512']/table/tbody/tr["+ b +"]/td[1]")).GetAttribute("tb");
                                                driver.FindElement(By.XPath("//*[@id='lxT512']/table/tbody/tr[" + b + "]/td[1]/a")).SendKeys(Keys.Enter);
                                                Thread.Sleep(2000);
                                                //gc.CreatePdf(orderNumber, ParcelNo, "Ad Valorem and Non Ad Valorem" + b, driver, "FL", "Palm Beach");
                                            }
                                            catch
                                            {
                                            }
                                            Description         = TaxAssementTD[0].Text;
                                            TaxGross_Tax        = TaxAssementTD[1].Text;
                                            Credit              = TaxAssementTD[2].Text;
                                            Net_Tax             = TaxAssementTD[3].Text;
                                            Savings             = TaxAssementTD[4].Text;
                                            TaxAssement_Details = Billtaxyear + "~" + Tax_Type + "~" + Description + "~" + TaxGross_Tax + "~" + Credit + "~" + Net_Tax + "~" + Savings;
                                            gc.insert_date(orderNumber, ParcelNo, 363, TaxAssement_Details, 1, DateTime.Now);
                                            Description = ""; TaxGross_Tax = ""; Credit = ""; Net_Tax = ""; Savings = "";
                                        }
                                    }
                                    if (TaxAssement.Text.Contains("Total Tax") && !TaxAssement.Text.Contains("Sub Total"))
                                    {
                                        Description  = "Total Tax";
                                        TaxGross_Tax = TaxAssementTD[0].Text;
                                        Credit       = TaxAssementTD[1].Text;
                                        Net_Tax      = TaxAssementTD[2].Text;
                                        if (Tax_Type == "Non Ad Valorem")
                                        {
                                            amck.Instamount1 = Net_Tax;
                                        }
                                        Savings             = TaxAssementTD[3].Text;
                                        TaxAssement_Details = Billtaxyear + "~" + Tax_Type + "~" + Description + "~" + TaxGross_Tax + "~" + Credit + "~" + Net_Tax + "~" + Savings;
                                        gc.insert_date(orderNumber, ParcelNo, 363, TaxAssement_Details, 1, DateTime.Now);
                                    }
                                }
                                b++;
                            }
                        }
                        catch { }
                        gc.CreatePdf(orderNumber, ParcelNo, "Ad Valorem and Non Ad Valorem" + Billtaxyear, driver, "FL", "Palm Beach");
                        //Tax Installment Details

                        try
                        {
                            IWebElement         TaxInstallmentTB = driver.FindElement(By.XPath("//*[@id='dnn_ContentPane']/div[5]"));
                            IList <IWebElement> TaxInstallmentTR = TaxInstallmentTB.FindElements(By.TagName("tr"));
                            IList <IWebElement> TaxInstallmentTD;

                            foreach (IWebElement TaxInstallment in TaxInstallmentTR)
                            {
                                TaxInstallmentTD = TaxInstallment.FindElements(By.TagName("td"));

                                if (TaxInstallmentTD.Count != 0 && !TaxInstallment.Text.Contains("Period"))
                                {
                                    if (TaxInstallmentTD[0].Text.Trim() == "Total Due:")
                                    {
                                        Period     = "";
                                        BillNumber = "";
                                        Due_Date   = "";
                                        BillYear   = TaxInstallmentTD[0].Text;
                                        Tax        = TaxInstallmentTD[1].Text;
                                        Discount1  = TaxInstallmentTD[2].Text;
                                        Penality   = TaxInstallmentTD[3].Text;
                                        Interest1  = TaxInstallmentTD[4].Text;
                                        Total_Due  = TaxInstallmentTD[5].Text;
                                        if (s == 0)
                                        {
                                            if (TaxInstallmentTR.Count == 3)
                                            {
                                                if (Total_Due == "$0.00")
                                                {
                                                    amck.IsDelinquent = "No";
                                                    amck.InstPaidDue1 = "Paid";
                                                    gc.InsertAmrockTax(orderNumber, amck.TaxId, amck.Instamount1, amck.Instamount2, amck.Instamount3, amck.Instamount4, amck.Instamountpaid1, amck.Instamountpaid2, amck.Instamountpaid3, amck.Instamountpaid4, amck.InstPaidDue1, amck.InstPaidDue2, amck.instPaidDue3, amck.instPaidDue4, amck.IsDelinquent);
                                                }
                                                else if (Total_Due != "$0.00" && Interest1 != "$0.00")
                                                {
                                                    amck.IsDelinquent = "Yes";
                                                    amck.InstPaidDue1 = "Due";
                                                    gc.InsertAmrockTax(orderNumber, amck.TaxId, amck.Instamount1, amck.Instamount2, amck.Instamount3, amck.Instamount4, amck.Instamountpaid1, amck.Instamountpaid2, amck.Instamountpaid3, amck.Instamountpaid4, amck.InstPaidDue1, amck.InstPaidDue2, amck.instPaidDue3, amck.instPaidDue4, amck.IsDelinquent);
                                                }
                                            }
                                        }
                                    }
                                    else
                                    {
                                        Period     = TaxInstallmentTD[0].Text;
                                        BillNumber = TaxInstallmentTD[1].Text;
                                        Due_Date   = TaxInstallmentTD[2].Text;
                                        BillYear   = TaxInstallmentTD[3].Text;
                                        if (BillYear != "")
                                        {
                                            amck.TaxYear = BillYear;
                                        }
                                        Tax       = TaxInstallmentTD[4].Text;
                                        Discount1 = TaxInstallmentTD[5].Text;
                                        Penality  = TaxInstallmentTD[6].Text;
                                        Interest1 = TaxInstallmentTD[7].Text;
                                        Total_Due = TaxInstallmentTD[8].Text;
                                    }

                                    TaxInstallmentDetails = Period + "~" + BillNumber + "~" + Due_Date + "~" + BillYear + "~" + Tax + "~" + Discount1 + "~" + Penality + "~" + Interest1 + "~" + Total_Due;
                                    gc.insert_date(orderNumber, ParcelNo, 361, TaxInstallmentDetails, 1, DateTime.Now);
                                }
                            }
                        }
                        catch
                        { }
                        //Tax Payment details
                        try
                        {
                            IWebElement         PaymentTB = driver.FindElement(By.XPath("//*[@id='dnn_ContentPane']/div[7]"));
                            IList <IWebElement> PaymentTR = PaymentTB.FindElements(By.TagName("tr"));
                            IList <IWebElement> PaymentTD;

                            foreach (IWebElement Payment in PaymentTR)
                            {
                                PaymentTD = Payment.FindElements(By.TagName("td"));

                                if (PaymentTD.Count != 0 && !Payment.Text.Contains("Bill Year"))
                                {
                                    Payment_BillYear   = PaymentTD[0].Text;
                                    Payment_BillNumber = PaymentTD[1].Text;
                                    Receipt_Number     = PaymentTD[2].Text;
                                    Amount_Paid        = PaymentTD[3].Text;
                                    if (Amount_Paid != "")
                                    {
                                        amck.Instamountpaid1 = Amount_Paid;
                                    }
                                    Last_Paid = PaymentTD[4].Text;
                                    Paid_By   = PaymentTD[5].Text;

                                    Payment_Details = Payment_BillYear + "~" + Payment_BillNumber + "~" + Receipt_Number + "~" + Amount_Paid + "~" + Last_Paid + "~" + Paid_By;
                                    gc.insert_date(orderNumber, ParcelNo, 362, Payment_Details, 1, DateTime.Now);
                                }
                            }
                        }
                        catch
                        { }
                        //Tax Bill Dowload
                        try
                        {
                            IWebElement         taxinfotable = driver.FindElement(By.XPath("//*[@id='lxT538']/p"));
                            IList <IWebElement> viwetaxbill  = taxinfotable.FindElements(By.TagName("a"));
                            foreach (IWebElement taxyearelement in viwetaxbill)
                            {
                                if (taxyearelement.Text.Contains("Print Tax Bill"))
                                {
                                    string viewhref = taxyearelement.GetAttribute("href");
                                    gc.downloadfile(viewhref, orderNumber, ParcelNo, "ViewTaxBill.pdf" + s, "FL", "Palm Beach");
                                }
                            }
                            s++;
                        }
                        catch { }
                    }
                    TaxTime     = DateTime.Now.ToString("HH:mm:ss");
                    LastEndTime = DateTime.Now.ToString("HH:mm:ss");


                    gc.insert_TakenTime(orderNumber, "FL", "Palm Beach", StartTime, AssessmentTime, TaxTime, CitytaxTime, LastEndTime);

                    driver.Quit();
                    //megrge pdf files
                    gc.mergpdf(orderNumber, "FL", "Palm Beach");
                    return("Data Inserted Successfully");
                }
                catch (Exception ex)
                {
                    driver.Quit();
                    throw ex;
                }
            }
        }
        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;
                }
            }
        }
示例#10
0
        public string FTP_TXHays(string streetno, string direction, string streetname, string city, string streettype, string unitnumber, string ownernm, string parcelNumber, string searchType, string orderNumber, string directParcel)
        {
            GlobalClass.global_orderNo             = orderNumber;
            HttpContext.Current.Session["orderNo"] = orderNumber;
            GlobalClass.global_parcelNo            = parcelNumber;

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

            var driverService = PhantomJSDriverService.CreateDefaultService();

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

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

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

                        IJavaScriptExecutor js2 = driver as IJavaScriptExecutor;
                        IWebElement         ParcelLinkSearch1 = driver.FindElement(By.XPath("//*[@id='home-page-tabs']/li[3]/a"));
                        js2.ExecuteScript("arguments[0].click();", ParcelLinkSearch1);
                        Thread.Sleep(2000);

                        driver.FindElement(By.XPath("//*[@id='StreetNumber']")).SendKeys(streetno);
                        driver.FindElement(By.XPath("//*[@id='StreetName']")).SendKeys(streetname);

                        driver.FindElement(By.XPath("//*[@id='index-search']/div[4]/div/div/button")).SendKeys(Keys.Enter);
                        Thread.Sleep(5000);

                        aaa    = driver.FindElement(By.XPath("//*[@id='page-header']")).Text;
                        parcel = gc.Between(aaa, "Page 1 of 1 - ", " (").Trim();

                        if (parcel == "Total: 1")
                        {
                            gc.CreatePdf_WOP(orderNumber, "Owner", driver, "TX", "Hays");
                            var chDriver = new ChromeDriver();
                            chDriver.Navigate().GoToUrl(driver.Url);
                            Thread.Sleep(4000);

                            IWebElement         Multiaddresstable = chDriver.FindElement(By.XPath("//*[@id='grid']/div[2]/table/tbody"));
                            IList <IWebElement> multiaddressrow   = Multiaddresstable.FindElements(By.TagName("tr"));
                            IList <IWebElement> Multiaddressid;
                            foreach (IWebElement Multiaddress in multiaddressrow)
                            {
                                Multiaddressid = Multiaddress.FindElements(By.TagName("td"));
                                if (Multiaddressid.Count != 0)
                                {
                                    parcel = Multiaddressid[1].Text;
                                }
                            }
                            gc.CreatePdf_WOP(orderNumber, "Owner Address search1", driver, "TX", "Hays");
                            //ByVisibleElement(chDriver.FindElement(By.Id("DownloadResults")));
                            gc.CreatePdf_WOP(orderNumber, "Owner Address search2", driver, "TX", "Hays");
                            driver.Navigate().GoToUrl("http://esearch.hayscad.com/Property/View/" + parcel + "");
                            Thread.Sleep(2000);
                            gc.CreatePdf_WOP(orderNumber, "Owner Address search1", driver, "TX", "Hays");
                            chDriver.Quit();
                        }

                        else
                        {
                            try
                            {
                                var chDriver = new ChromeDriver();
                                chDriver.Navigate().GoToUrl(driver.Url);
                                Thread.Sleep(4000);

                                IWebElement         MultiAddressTB = chDriver.FindElement(By.XPath("//*[@id='grid']/div[2]/table/tbody"));
                                IList <IWebElement> MultiAddressTR = MultiAddressTB.FindElements(By.TagName("tr"));
                                IList <IWebElement> MultiAddressTD;
                                gc.CreatePdf_WOP(orderNumber, "Multi Address search", driver, "TX", "Hays");
                                int AddressmaxCheck = 0;
                                foreach (IWebElement MultiAddress in MultiAddressTR)
                                {
                                    if (AddressmaxCheck <= 25)
                                    {
                                        MultiAddressTD = MultiAddress.FindElements(By.TagName("td"));
                                        if (MultiAddressTD.Count != 0 && !MultiAddress.Text.Contains("Mobile Home"))
                                        {
                                            Parcelno         = MultiAddressTD[1].Text;
                                            Multi_Type       = MultiAddressTD[5].Text;
                                            Owner            = MultiAddressTD[6].Text;
                                            Property_Address = MultiAddressTD[7].Text;

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

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

                        IJavaScriptExecutor js1 = driver as IJavaScriptExecutor;
                        IWebElement         ParcelLinkSearch = driver.FindElement(By.XPath("//*[@id='home-page-tabs']/li[4]/a"));
                        js1.ExecuteScript("arguments[0].click();", ParcelLinkSearch);
                        Thread.Sleep(2000);

                        driver.FindElement(By.Id("PropertyId")).SendKeys(parcelNumber);
                        gc.CreatePdf(orderNumber, parcelNumber, "ParcelSearch", driver, "TX", "Hays");
                        driver.FindElement(By.XPath("//*[@id='index-search']/div[4]/div/div/button")).SendKeys(Keys.Enter);
                        Thread.Sleep(2000);

                        driver.FindElement(By.XPath("//*[@id='grid']/div[2]/table/tbody/tr/td[2]")).Click();
                        Thread.Sleep(5000);
                        gc.CreatePdf(orderNumber, parcelNumber, "ParcelSearch1", driver, "TX", "Hays");
                    }

                    if (searchType == "ownername")
                    {
                        driver.Navigate().GoToUrl("http://esearch.hayscad.com/");
                        Thread.Sleep(2000);

                        IJavaScriptExecutor js3 = driver as IJavaScriptExecutor;
                        IWebElement         ParcelLinkSearch2 = driver.FindElement(By.XPath("//*[@id='home-page-tabs']/li[2]/a"));
                        js3.ExecuteScript("arguments[0].click();", ParcelLinkSearch2);
                        Thread.Sleep(2000);

                        driver.FindElement(By.Id("OwnerName")).SendKeys(ownernm);
                        gc.CreatePdf_WOP(orderNumber, "Owner search", driver, "TX", "Hays");
                        driver.FindElement(By.XPath("//*[@id='index-search']/div[4]/div/div/button")).SendKeys(Keys.Enter);
                        Thread.Sleep(2000);

                        aaa    = driver.FindElement(By.XPath("//*[@id='page-header']")).Text;
                        parcel = gc.Between(aaa, "Page 1 of 1 - ", " (").Trim();

                        if (parcel == "Total: 1")
                        {
                            gc.CreatePdf_WOP(orderNumber, "Owner", driver, "TX", "Hays");
                            var chDriver = new ChromeDriver();
                            chDriver.Navigate().GoToUrl(driver.Url);
                            Thread.Sleep(4000);

                            IWebElement         Multiaddresstable = chDriver.FindElement(By.XPath("//*[@id='grid']/div[2]/table/tbody"));
                            IList <IWebElement> multiaddressrow   = Multiaddresstable.FindElements(By.TagName("tr"));
                            IList <IWebElement> Multiaddressid;
                            foreach (IWebElement Multiaddress in multiaddressrow)
                            {
                                Multiaddressid = Multiaddress.FindElements(By.TagName("td"));
                                if (Multiaddressid.Count != 0)
                                {
                                    parcel = Multiaddressid[1].Text;
                                }
                            }
                            gc.CreatePdf_WOP(orderNumber, "Owner search1", driver, "TX", "Hays");
                            //ByVisibleElement(chDriver.FindElement(By.Id("DownloadResults")));
                            gc.CreatePdf_WOP(orderNumber, "Owner Search2", driver, "TX", "Hays");
                            driver.Navigate().GoToUrl("http://esearch.hayscad.com/Property/View/" + parcel + "");
                            Thread.Sleep(2000);
                            gc.CreatePdf_WOP(orderNumber, "Owner search3", driver, "TX", "Hays");
                            chDriver.Quit();
                        }

                        else
                        {
                            try
                            {
                                var chDriver = new ChromeDriver();
                                chDriver.Navigate().GoToUrl(driver.Url);
                                Thread.Sleep(4000);

                                IWebElement         MultiAddressTB = chDriver.FindElement(By.XPath("//*[@id='grid']/div[2]/table/tbody"));
                                IList <IWebElement> MultiAddressTR = MultiAddressTB.FindElements(By.TagName("tr"));
                                IList <IWebElement> MultiAddressTD;
                                gc.CreatePdf_WOP(orderNumber, "Multi Address search", driver, "TX", "Hays");
                                int AddressmaxCheck = 0;
                                foreach (IWebElement MultiAddress in MultiAddressTR)
                                {
                                    if (AddressmaxCheck <= 25)
                                    {
                                        MultiAddressTD = MultiAddress.FindElements(By.TagName("td"));
                                        if (MultiAddressTD.Count != 0 && !MultiAddress.Text.Contains("Mobile Home"))
                                        {
                                            Parcelno         = MultiAddressTD[1].Text;
                                            Multi_Type       = MultiAddressTD[5].Text;
                                            Owner            = MultiAddressTD[6].Text;
                                            Property_Address = MultiAddressTD[7].Text;

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

                    try
                    {
                        IWebElement INodata = driver.FindElement(By.Id("results-page"));
                        if (INodata.Text.Contains("Page 1 of 0 - Total: 0"))
                        {
                            HttpContext.Current.Session["Nodata_TXHays"] = "Yes";
                            driver.Quit();
                            return("No Data Found");
                        }
                    }
                    catch { }

                    //Property Details
                    try
                    {
                        IList <IWebElement> tables1 = driver.FindElements(By.XPath("//*[@id='detail-page']/div/div[1]/div/table"));
                        int count1 = tables1.Count;
                        foreach (IWebElement tab1 in tables1)
                        {
                            if (tab1.Text.Contains("Account"))
                            {
                                IList <IWebElement> ProTR = tab1.FindElements(By.TagName("tr"));
                                IList <IWebElement> ProTD;
                                IList <IWebElement> ProTH;
                                foreach (IWebElement Pro in ProTR)
                                {
                                    ProTD = Pro.FindElements(By.TagName("td"));
                                    ProTH = Pro.FindElements(By.TagName("th"));
                                    if (!Pro.Text.Contains("Account") && !Pro.Text.Contains("Location") && !Pro.Text.Contains("% Ownership:") && !Pro.Text.Contains("Agent Code:"))
                                    {
                                        Parcel = ProTH[0].Text;
                                        if (Parcel.Contains("Property ID:"))
                                        {
                                            Parcel_ID = ProTD[0].Text;
                                        }
                                        Legal = ProTH[0].Text;
                                        if (Legal.Contains("Legal Description:"))
                                        {
                                            Legal_Desp = ProTD[0].Text;
                                        }
                                        Graphic = ProTH[0].Text;
                                        if (Graphic.Contains("Geographic ID:"))
                                        {
                                            Graphic_Id = ProTD[0].Text;
                                        }
                                        Tap = ProTH[0].Text;
                                        if (Tap.Contains("Type:"))
                                        {
                                            Type = ProTD[0].Text;
                                        }
                                        Adds = ProTH[0].Text;
                                        if (Adds.Contains("Address:"))
                                        {
                                            Pro_Addrs = ProTD[0].Text;
                                        }
                                        Maps = ProTH[0].Text;
                                        if (Maps.Contains("Map ID:"))
                                        {
                                            Map = ProTD[0].Text;
                                        }
                                        Nighber = ProTH[0].Text;
                                        if (Nighber.Contains("Neighborhood CD:"))
                                        {
                                            Nighberhood = ProTD[0].Text;
                                        }
                                        Own_Id = ProTH[0].Text;
                                        if (Own_Id.Contains("Owner ID:"))
                                        {
                                            Owner_Id = ProTD[0].Text;
                                        }
                                        Nam = ProTH[0].Text;
                                        if (Nam.Contains("Name:"))
                                        {
                                            Name = ProTD[0].Text;
                                        }
                                        Mailing_Addrs = ProTH[0].Text;
                                        if (Mailing_Addrs.Contains("Mailing Address:"))
                                        {
                                            Mailing_Address = ProTD[0].Text;
                                        }
                                        Exmp = ProTH[0].Text;
                                        if (Exmp.Contains("Exemptions:"))
                                        {
                                            Excemptions = ProTD[0].Text;
                                        }
                                    }
                                }

                                try
                                {
                                    Year_Built = driver.FindElement(By.XPath("//*[@id='detail-page']/div[5]/div[2]/table[1]/tbody/tr[2]/td[4]")).Text;
                                    Acres      = driver.FindElement(By.XPath("//*[@id='detail-page']/div[6]/div[2]/table/tbody/tr[2]/td[3]")).Text;
                                }
                                catch
                                { }

                                Property_Details = Legal_Desp + "~" + Graphic_Id + "~" + Type + "~" + Pro_Addrs + "~" + Map + "~" + Nighberhood + "~" + Owner_Id + "~" + Name + "~" + Mailing_Address + "~" + Excemptions + "~" + Acres + "~" + Year_Built;
                                gc.CreatePdf(orderNumber, Parcel_ID, "Property Details", driver, "TX", "Hays");
                                gc.insert_date(orderNumber, Parcel_ID, 1003, Property_Details, 1, DateTime.Now);
                            }
                        }
                    }
                    catch
                    { }

                    //Values Details
                    try
                    {
                        IList <IWebElement> tables2 = driver.FindElements(By.XPath("//*[@id='detail-page']/div/div[2]/div/table"));
                        int count2 = tables2.Count;
                        foreach (IWebElement tab2 in tables2)
                        {
                            if (tab2.Text.Contains("Improvement Homesite Value:"))
                            {
                                IList <IWebElement> AssemntTR = tab2.FindElements(By.TagName("tr"));
                                IList <IWebElement> AssemntTD;
                                IList <IWebElement> AssemntTH;
                                foreach (IWebElement Assemnt in AssemntTR)
                                {
                                    AssemntTD = Assemnt.FindElements(By.TagName("td"));
                                    AssemntTH = Assemnt.FindElements(By.TagName("th"));

                                    if (Assemnt.Text != " ")
                                    {
                                        Imp_Home = AssemntTH[0].Text;
                                        if (Imp_Home.Contains("Improvement Homesite Value:"))
                                        {
                                            Imp_Homesite = AssemntTD[0].Text;
                                        }

                                        Imp_NonHome = AssemntTH[0].Text;
                                        if (Imp_NonHome.Contains("Improvement Non-Homesite Value:"))
                                        {
                                            Imp_NonHomesite = AssemntTD[0].Text;
                                        }

                                        Land = AssemntTH[0].Text;
                                        if (Land.Contains("Land Homesite Value:"))
                                        {
                                            Land_Homesite = AssemntTD[0].Text;
                                        }

                                        Non_Land = AssemntTH[0].Text;
                                        if (Non_Land.Contains("Land Non-Homesite Value:"))
                                        {
                                            Land_NonHomesite = AssemntTD[0].Text;
                                        }

                                        Agricutr = AssemntTH[0].Text;
                                        if (Agricutr.Contains("Agricultural Market Valuation:"))
                                        {
                                            Agri_Markt = AssemntTD[0].Text;
                                        }

                                        Mrkt = AssemntTH[0].Text;
                                        if (Mrkt.Contains("Market Value:"))
                                        {
                                            Mrkt_Value = AssemntTD[0].Text;
                                        }

                                        Ag_Value = AssemntTH[0].Text;
                                        if (Ag_Value.Contains("Ag Use Value:"))
                                        {
                                            AgUse_Value = AssemntTD[0].Text;
                                        }

                                        App_Value = AssemntTH[0].Text;
                                        if (App_Value.Contains("Appraised Value:"))
                                        {
                                            Appraised_Value = AssemntTD[0].Text;
                                        }

                                        Home_Cap = AssemntTH[0].Text;
                                        if (Home_Cap.Contains("Homestead Cap Loss:"))
                                        {
                                            Homested_Cap = AssemntTD[0].Text;
                                        }

                                        Assd_Value = AssemntTH[0].Text;
                                        if (Assd_Value.Contains("Assessed Value:"))
                                        {
                                            Assessed_Value = AssemntTD[0].Text;
                                        }
                                    }
                                }
                                Assessment_Details = Imp_Homesite + "~" + Imp_NonHomesite + "~" + Land_Homesite + "~" + Land_NonHomesite + "~" + Agri_Markt + "~" + Mrkt_Value + "~" + AgUse_Value + "~" + Appraised_Value + "~" + Homested_Cap + "~" + Assessed_Value;
                                gc.insert_date(orderNumber, Parcel_ID, 1006, Assessment_Details, 1, DateTime.Now);
                            }
                        }
                    }
                    catch
                    { }
                    AssessmentTime = DateTime.Now.ToString("HH:mm:ss");

                    //Jurisdiction Details

                    try
                    {
                        IWebElement         JurisdictionTB = driver.FindElement(By.XPath("//*[@id='detail-page']/div[4]/div[2]/table/tbody"));
                        IList <IWebElement> JurisdictionTR = JurisdictionTB.FindElements(By.TagName("tr"));
                        IList <IWebElement> JurisdictionTD;

                        foreach (IWebElement Jurisdiction in JurisdictionTR)
                        {
                            JurisdictionTD = Jurisdiction.FindElements(By.TagName("td"));
                            if (JurisdictionTD.Count != 0 && !Jurisdiction.Text.Contains("Entity"))
                            {
                                Entity      = JurisdictionTD[0].Text;
                                Desp        = JurisdictionTD[1].Text;
                                Mrket_Value = JurisdictionTD[2].Text;
                                Txble_Value = JurisdictionTD[3].Text;

                                Jurisdiction_details = Entity + "~" + Desp + "~" + Mrket_Value + "~" + Txble_Value;
                                gc.insert_date(orderNumber, Parcel_ID, 1007, Jurisdiction_details, 1, DateTime.Now);
                            }
                        }
                    }
                    catch
                    { }

                    //RollValue Details
                    try
                    {
                        IList <IWebElement> tables4 = driver.FindElements(By.XPath("//*[@id='detail-page']/div/div[2]/table"));
                        int count4 = tables4.Count;
                        foreach (IWebElement tab4 in tables4)
                        {
                            if (tab4.Text.Contains("HS Cap Loss"))
                            {
                                IList <IWebElement> RollValueTR = tab4.FindElements(By.TagName("tr"));
                                IList <IWebElement> RollValueTD;

                                foreach (IWebElement RollValue in RollValueTR)
                                {
                                    RollValueTD = RollValue.FindElements(By.TagName("td"));
                                    if (RollValueTD.Count != 0 && !RollValue.Text.Contains("Year"))
                                    {
                                        Year        = RollValueTD[0].Text;
                                        Improv      = RollValueTD[1].Text;
                                        lnd_Mrkt    = RollValueTD[2].Text;
                                        Ag_Valution = RollValueTD[3].Text;
                                        Appraised   = RollValueTD[4].Text;
                                        HS_Cap      = RollValueTD[5].Text;
                                        Pro_Assed   = RollValueTD[6].Text;

                                        RollValue_details = Year + "~" + Improv + "~" + lnd_Mrkt + "~" + Ag_Valution + "~" + Appraised + "~" + HS_Cap + "~" + Pro_Assed;
                                        gc.insert_date(orderNumber, Parcel_ID, 1008, RollValue_details, 1, DateTime.Now);
                                    }
                                }
                            }
                        }
                    }
                    catch
                    { }

                    //Tax Details
                    driver.Navigate().GoToUrl("https://hayscountytax.com/taxes.html#/WildfireSearch");
                    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(Parcel_ID);
                    Thread.Sleep(5000);

                    //TaxPayment 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;
                                Quiref_Id     = TaxPaymentTD[2].Text;
                                Situs_Address = TaxPaymentTD[3].Text;
                                Status        = TaxPaymentTD[4].Text;

                                Payment_details = Owners + "~" + year + "~" + Quiref_Id + "~" + Situs_Address + "~" + Status;
                                gc.CreatePdf(orderNumber, Parcel_ID, "Tax Payment Details", driver, "TX", "Hays");
                                gc.insert_date(orderNumber, Parcel_ID, 1009, Payment_details, 1, DateTime.Now);
                            }
                        }
                    }
                    catch
                    { }

                    //Tax Info Details
                    int                p1 = 0, p2 = 0, p3 = 0;
                    List <string>      strTaxRealestate  = new List <string>();
                    List <IWebElement> strTaxRealestate1 = new List <IWebElement>();
                    IWebElement        ITaxReal1         = null;
                    try
                    {
                        ITaxReal1 = driver.FindElement(By.XPath("//*[@id='avalon']/div/div[3]/div[2]/table/tbody"));
                    }
                    catch { }
                    try
                    {
                        if (ITaxReal1 == null)
                        {
                            ITaxReal1 = driver.FindElement(By.XPath("//*[@id='avalon']/div/div[4]/div[2]/table/tbody"));
                        }
                    }
                    catch { }
                    IList <IWebElement> ITaxRealRow1 = ITaxReal1.FindElements(By.TagName("tr"));
                    IList <IWebElement> ITaxRealTd1;

                    foreach (IWebElement row in ITaxRealRow1)
                    {
                        ITaxRealTd1 = row.FindElements(By.TagName("td"));
                        if (row.Text.Contains("Unpaid"))
                        {
                            p1++;
                            p2++;
                        }
                        if (row.Text.Contains("Paid") && p2 < 3)
                        {
                            p3++;
                            p2++;
                        }
                    }
                    int p4 = p1 + p3;

                    for (int p5 = 1; p5 <= p4; p5++)
                    {
                        try
                        {
                            try
                            {
                                driver.FindElement(By.XPath("//*[@id='avalon']/div/div[3]/div[2]/table/tbody/tr[" + p5 + "]/td[7]/button")).Click();
                            }
                            catch { }
                            try
                            {
                                driver.FindElement(By.XPath("//*[@id='avalon']/div/div[4]/div[2]/table/tbody/tr[" + p5 + "]/td[7]/button")).Click();
                            }
                            catch { }
                            Thread.Sleep(6000);

                            IWebElement         TaxTB = driver.FindElement(By.XPath("//*[@id='avalon']/div/div/div/div[1]/div[1]/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)
                                {
                                    Own_Nm = TaxTD[0].Text;
                                    if (Own_Nm.Contains("Owner Name"))
                                    {
                                        Tax_Owner = TaxTD[1].Text;
                                    }
                                    Tx_year = TaxTD[0].Text;
                                    if (Tx_year.Contains("Tax Year"))
                                    {
                                        Taxy_Year = TaxTD[1].Text;
                                    }
                                    Sta = TaxTD[0].Text;
                                    if (Sta.Contains("Status"))
                                    {
                                        taxy_sta = TaxTD[1].Text;
                                    }
                                    Ba_Tx = TaxTD[0].Text;
                                    if (Ba_Tx.Contains("Base Tax"))
                                    {
                                        Taxy_Base = TaxTD[1].Text;
                                    }
                                    Tl_Pay = TaxTD[0].Text;
                                    if (Tl_Pay.Contains("Total Payments"))
                                    {
                                        Tl_Taxy = TaxTD[1].Text;
                                    }
                                    Due = TaxTD[0].Text;
                                    if (Due.Contains("Total Due"))
                                    {
                                        TaxyTl_Due = TaxTD[1].Text;
                                    }
                                }
                            }
                            gc.CreatePdf(orderNumber, Parcel_ID, "Tax Overview Details" + Taxy_Year, driver, "TX", "Hays");

                            IWebElement         TaxTB1 = driver.FindElement(By.XPath("//*[@id='avalon']/div/div/div/div[1]/div[1]/div[2]/table/tbody"));
                            IList <IWebElement> TaxTR1 = TaxTB1.FindElements(By.TagName("tr"));
                            IList <IWebElement> TaxTD1;
                            foreach (IWebElement Tax1 in TaxTR1)
                            {
                                TaxTD1 = Tax1.FindElements(By.TagName("td"));
                                if (TaxTD1.Count != 0)
                                {
                                    Own_Addr = TaxTD1[0].Text;
                                    if (Own_Addr.Contains("Owner Address"))
                                    {
                                        Tax_OwnerAddress = TaxTD1[1].Text;
                                    }
                                    Tx_Parcel = TaxTD1[0].Text;
                                    if (Tx_Parcel.Contains("Parcel ID"))
                                    {
                                        Taxy_Parcel = TaxTD1[1].Text;
                                    }
                                    Quick = TaxTD1[0].Text;
                                    if (Quick.Contains("Quick Reference ID"))
                                    {
                                        taxy_QuickID = TaxTD1[1].Text;
                                    }
                                    Lega = TaxTD1[0].Text;
                                    if (Lega.Contains("Legal Description"))
                                    {
                                        Taxy_LglDes = TaxTD1[1].Text;
                                    }
                                }
                            }

                            if (TaxyTl_Due == "Please call tax office for total due")
                            {
                                TaxSale_Comments = "You must call the Collector's Office.";
                            }
                            Tax_Deatils = Taxy_Year + "~" + Tax_OwnerAddress + "~" + Taxy_Parcel + "~" + taxy_QuickID + "~" + Taxy_LglDes + "~" + Tax_Owner + "~" + taxy_sta + "~" + Taxy_Base + "~" + Tl_Taxy + "~" + TaxyTl_Due + "~" + TaxSale_Comments;
                            gc.insert_date(orderNumber, Parcel_ID, 1011, Tax_Deatils, 1, DateTime.Now);

                            //Tax Breakdown
                            try
                            {
                                IWebElement         BreakdownTB = driver.FindElement(By.XPath("//*[@id='avalon']/div/div/div/div[1]/div[2]/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)
                                    {
                                        Jurisdiction = BreakdownTD[0].Text;
                                        T_Year       = BreakdownTD[1].Text;
                                        Base_Tax     = BreakdownTD[2].Text;
                                        tax_Penalty  = BreakdownTD[3].Text;
                                        Tax_Inst     = BreakdownTD[4].Text;
                                        attroney_Fee = BreakdownTD[5].Text;
                                        Payments     = BreakdownTD[6].Text;
                                        Balnce       = BreakdownTD[7].Text;

                                        Breakdown_details = Jurisdiction + "~" + T_Year + "~" + Base_Tax + "~" + tax_Penalty + "~" + Tax_Inst + "~" + attroney_Fee + "~" + Payments + "~" + Balnce;
                                        gc.insert_date(orderNumber, Parcel_ID, 1010, Breakdown_details, 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, Parcel_ID, "Tax Bill Details" + Taxy_Year, driver, "TX", "Hays");
                            }
                            catch
                            { }
                            try
                            {
                                driver.FindElement(By.XPath("//*[@id='avalon']/div/div/ul/li[3]/a")).Click();
                                Thread.Sleep(4000);

                                gc.CreatePdf(orderNumber, Parcel_ID, "Tax Receipt Details" + Taxy_Year, driver, "TX", "Hays");
                            }
                            catch
                            { }
                            try
                            {
                                driver.FindElement(By.XPath("//*[@id='avalon']/div/div/ul/li[4]/a")).Click();
                                Thread.Sleep(4000);

                                gc.CreatePdf(orderNumber, Parcel_ID, "Tax Summary Details" + Taxy_Year, driver, "TX", "Hays");
                            }
                            catch
                            { }

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

                    //Tax Authority
                    driver.Navigate().GoToUrl("https://hayscountytax.com/#/contact");
                    Thread.Sleep(2000);
                    try
                    {
                        Taxing = "712 S Stagecoach Trail San Marcos, Texas 78666";
                        Phone  = "Phone: (512) 393-5545";
                        Fax    = "Fax: (512) 393-5547";

                        gc.CreatePdf(orderNumber, Parcel_ID, "Tax Authority Details", driver, "TX", "Hays");
                        Taxing_Authority = Taxing + " " + Phone + " " + Fax;

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

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

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

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

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

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

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

            var driverService = PhantomJSDriverService.CreateDefaultService();

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

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


                    if (searchType == "titleflex")
                    {
                        string address = "";
                        if (direction != "")
                        {
                            address = streetno + " " + streetname + " " + direction;
                        }
                        else
                        {
                            address = streetno + " " + streetname;
                        }
                        gc.TitleFlexSearch(orderNumber, parcelNumber, ownername, address.Trim(), "WA", "Cowlitz");
                        if ((HttpContext.Current.Session["TitleFlex_Search"] != null && HttpContext.Current.Session["TitleFlex_Search"].ToString() == "Yes"))
                        {
                            driver.Quit();
                            return("MultiParcel");
                        }
                        else if (HttpContext.Current.Session["titleparcel"].ToString() == "")
                        {
                            HttpContext.Current.Session["Cowlitz_Zero"] = "Zero";
                            driver.Quit();
                            return("No Data Found");
                        }
                        parcelNumber = HttpContext.Current.Session["titleparcel"].ToString().Replace("-", "");
                        searchType   = "parcel";
                    }


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        //Assessment Details

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

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

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

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

                        //Tax Payment Details

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

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

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

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

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

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


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



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

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

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

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

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

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

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

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

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

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

                    // Assessment Details table

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

                    //IList<IWebElement> TDmulti;
                    //foreach (IWebElement row in TRmulti)
                    //{

                    //    TDmulti = row.FindElements(By.TagName("td"));
                    //    if (TDmulti.Count == 7 && !row.Text.Contains("Assessment\r\nYear"))
                    //    {
                    //        string multi1 = TDmulti[0].Text + "~" + TDmulti[1].Text + "~" + TDmulti[2].Text + "~" + TDmulti[3].Text + "~" + TDmulti[4].Text + "~" + TDmulti[5].Text;
                    //        gc.insert_date(orderNumber, Parcel_Id, 765, multi1, 1, DateTime.Now);
                    //    }
                    //}

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

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

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

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

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

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


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

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

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

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

                    //    }
                    //}

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

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

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

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

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

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

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

            var driverService = PhantomJSDriverService.CreateDefaultService();

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

                    if (searchType == "titleflex")
                    {
                        string titleaddress = streetno + " " + streetname + " " + unitnumber;
                        gc.TitleFlexSearch(orderNumber, parcelNumber, "", titleaddress, "TX", "Travis");
                        if ((HttpContext.Current.Session["TitleFlex_Search"] != null && HttpContext.Current.Session["TitleFlex_Search"].ToString() == "Yes"))
                        {
                            driver.Quit();
                            return("MultiParcel");
                        }
                        else if (HttpContext.Current.Session["titleparcel"].ToString() == "")
                        {
                            HttpContext.Current.Session["Nodata_TXTravis"] = "Yes";
                            driver.Quit();
                            return("No Data Found");
                        }
                        parcelNumber = HttpContext.Current.Session["titleparcel"].ToString();
                        searchType   = "parcel";
                    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        driver1.Quit();
                    }
                    catch
                    { }

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

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

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

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

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

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