public string FTP_YorkSC(string streetNo, string streetName, string direction, string streetType, string accountNo, string parcelNumber, string ownerName, string searchType, string orderNumber) { GlobalClass.global_orderNo = orderNumber; HttpContext.Current.Session["orderNo"] = orderNumber; GlobalClass.global_parcelNo = parcelNumber; IJavaScriptExecutor js = driver as IJavaScriptExecutor; string strmulti = "", Taxy = ""; string StartTime = "", AssessmentTime = "", TaxTime = "", CitytaxTime = "", LastEndTime = "", accountnumber = ""; 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"); driver.Navigate().GoToUrl("https://qpublic.schneidercorp.com/Application.aspx?App=YorkCountySC&Layer=Parcels&PageType=Search"); try { driver.FindElement(By.XPath("//*[@id='appBody']/div[4]/div/div/div[3]/a[1]")).SendKeys(Keys.Enter); Thread.Sleep(2000); } catch { } try { driver.FindElement(By.XPath("//*[@id='appBody']/div[5]/div/div/div[3]/a")).SendKeys(Keys.Enter); Thread.Sleep(2000); } catch { } //Thread.Sleep(3000); if (searchType == "titleflex") { string address = streetNo + " " + direction + " " + streetName + " " + streetType + " " + accountNo; gc.TitleFlexSearch(orderNumber, "", "", address.Trim(), "SC", "York"); if (HttpContext.Current.Session["TitleFlex_Search"] != null && HttpContext.Current.Session["TitleFlex_Search"].Equals("Yes")) { driver.Quit(); return("MultiParcel"); } else if (HttpContext.Current.Session["titleparcel"].ToString() == "") { HttpContext.Current.Session["Nodata_YorkSC"] = "Yes"; driver.Quit(); return("No Data Found"); } parcelNumber = HttpContext.Current.Session["titleparcel"].ToString(); searchType = "parcel"; } if (searchType == "address") { driver.FindElement(By.Id("ctlBodyPane_ctl01_ctl01_txtAddress")).SendKeys(streetNo + " " + streetName); gc.CreatePdf_WOP(orderNumber, "Address Search Before", driver, "SC", "York"); driver.FindElement(By.Id("ctlBodyPane_ctl01_ctl01_btnSearch")).SendKeys(Keys.Enter); Thread.Sleep(2000); gc.CreatePdf_WOP(orderNumber, "Address Search After", driver, "SC", "York"); try { strmulti = GlobalClass.Before(driver.FindElement(By.Id("ctlBodyPane_ctl00_txtResultCount")).Text.Trim(), " Results"); if (Convert.ToInt32(strmulti) > 25) { HttpContext.Current.Session["multiParcel_YorkSC_Maximum"] = "Maximum"; return("Maximum"); } IWebElement Imultitable = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl00_ctl01_gvwParcelResults']/tbody")); IList <IWebElement> ImutiRow = Imultitable.FindElements(By.TagName("tr")); IList <IWebElement> ImultiTD; foreach (IWebElement multi in ImutiRow) { ImultiTD = multi.FindElements(By.TagName("td")); if (ImultiTD.Count != 0 && !multi.Text.Contains("Address")) { string strmultiDetails = ImultiTD[2].Text + "~" + ImultiTD[3].Text; gc.insert_date(orderNumber, ImultiTD[1].Text, 1541, strmultiDetails, 1, DateTime.Now); } } HttpContext.Current.Session["multiParcel_YorkSC"] = "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_YorkSC"] = "Yes"; driver.Quit(); return("No Data Found"); } } catch { } } if (searchType == "parcel") { driver.FindElement(By.Id("ctlBodyPane_ctl02_ctl01_txtParcelID")).SendKeys(parcelNumber); gc.CreatePdf(orderNumber, parcelNumber, "Parcel Before Search", driver, "SC", "York"); driver.FindElement(By.Id("ctlBodyPane_ctl02_ctl01_btnSearch")).SendKeys(Keys.Enter); Thread.Sleep(2000); gc.CreatePdf(orderNumber, parcelNumber, "Parcel Aftere Pdf", driver, "SC", "York"); 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_YorkSC"] = "Yes"; driver.Quit(); return("No Data Found"); } } catch { } } else if (searchType == "ownername") { driver.FindElement(By.Id("ctlBodyPane_ctl00_ctl01_txtName")).SendKeys(ownerName); gc.CreatePdf_WOP(orderNumber, "OwnerName Search Before", driver, "SC", "York"); driver.FindElement(By.Id("ctlBodyPane_ctl00_ctl01_btnSearch")).SendKeys(Keys.Enter); Thread.Sleep(2000); gc.CreatePdf_WOP(orderNumber, "OwnerName Search After", driver, "SC", "York"); try { strmulti = GlobalClass.Before(driver.FindElement(By.Id("ctlBodyPane_ctl00_txtResultCount")).Text.Trim(), " Results"); if (Convert.ToInt32(strmulti) > 25) { HttpContext.Current.Session["multiParcel_Paulding_Maximum"] = "Maximum"; return("Maximum"); } IWebElement Imultitable = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl00_ctl01_gvwParcelResults']/tbody")); IList <IWebElement> ImutiRow = Imultitable.FindElements(By.TagName("tr")); IList <IWebElement> ImultiTD; foreach (IWebElement multi in ImutiRow) { ImultiTD = multi.FindElements(By.TagName("td")); if (ImultiTD.Count != 0 && !multi.Text.Contains("Address")) { string strmultiDetails = ImultiTD[2].Text + "~" + ImultiTD[3].Text; gc.insert_date(orderNumber, ImultiTD[1].Text, 1541, strmultiDetails, 1, DateTime.Now); } } HttpContext.Current.Session["multiParcel_YorkSC"] = "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_YorkSC"] = "Yes"; driver.Quit(); return("No Data Found"); } } catch { } } //Property Details string Owner = "", ParcelNumber = "", Propertyaddress = "", Mailingaddress = "", LegalDescription = "", Classcode = ""; try { string bulktext1 = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl01_mSection']/div")).Text.Trim(); string[] Propdata1 = bulktext1.Split('\r'); if (Propdata1.Count() == 4) { Owner = Propdata1[0].Replace("\r\n", "").Trim() + "&" + Propdata1[1].Replace("\r\n", "").Trim(); Mailingaddress = Propdata1[2].Replace("\r\n", "").Trim() + Propdata1[3].Replace("\r\n", "").Trim(); } if (Propdata1.Count() == 3) { Owner = Propdata1[0].Replace("\r\n", "").Trim(); Mailingaddress = Propdata1[1].Replace("\r\n", "").Trim() + Propdata1[2].Replace("\r\n", "").Trim(); } if (Propdata1.Count() == 2) { Mailingaddress = Propdata1[1].Replace("\r\n", "").Trim() + Propdata1[2].Replace("\r\n", "").Trim(); } } catch { } ParcelNumber = driver.FindElement(By.Id("ctlBodyPane_ctl00_ctl01_lblParcelNumber")).Text.Trim(); gc.CreatePdf(orderNumber, ParcelNumber, "Property Details and Assessment Details Pdf", driver, "SC", "York"); Propertyaddress = driver.FindElement(By.Id("ctlBodyPane_ctl00_ctl01_lblLocationAddr")).Text.Trim(); LegalDescription = driver.FindElement(By.Id("ctlBodyPane_ctl00_ctl01_lblDescription")).Text.Trim(); Classcode = driver.FindElement(By.Id("ctlBodyPane_ctl00_ctl01_lblClass")).Text.Trim(); string PropertyDetails = Owner.Trim() + "~" + Propertyaddress.Trim() + "~" + Mailingaddress.Trim() + "~" + LegalDescription.Trim() + "~" + Classcode.Trim(); gc.insert_date(orderNumber, ParcelNumber, 1539, PropertyDetails, 1, DateTime.Now); //Assessment Details string AssessmentYear = ""; try { AssessmentYear = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl11_ctl01_grdValuation']/thead/tr/th[3]")).Text.Trim(); } catch { } // gc.CreatePdf(orderNumber, ParcelNumber, "Assessment Details ", driver, "GA", "Paulding"); try { string AssessmentTitle = "", AssessmentValue = ""; IWebElement tbcurasses12 = driver.FindElement(By.Id("ctlBodyPane_ctl02_mSection")); IList <IWebElement> TRcurasses2 = tbcurasses12.FindElements(By.TagName("tr")); IList <IWebElement> TDmulti12; foreach (IWebElement row in TRcurasses2) { TDmulti12 = row.FindElements(By.TagName("td")); if (TDmulti12.Count != 0 && !row.Text.Contains("Value Information")) { AssessmentTitle += TDmulti12[0].Text + "~"; AssessmentValue += TDmulti12[1].Text + "~"; } } db.ExecuteQuery("update data_field_master set Data_Fields_Text='" + "Year" + "~" + AssessmentTitle.Remove(AssessmentTitle.Length - 1, 1) + "' where Id = '" + 1540 + "'"); gc.insert_date(orderNumber, ParcelNumber, 1540, AssessmentYear + "~" + AssessmentValue.Remove(AssessmentValue.Length - 1, 1), 1, DateTime.Now); } catch { } //Tax Authority string Taxauthority = "", Taxauthority1 = ""; try { driver.Navigate().GoToUrl("https://www.yorkcountygov.com/Directory.aspx?did=28"); Taxauthority1 = driver.FindElement(By.Id("CityDirectoryLeftMargin")).Text.Trim(); Taxauthority = gc.Between(Taxauthority1.Replace("\r\n", " "), "Mailing Address:", "Fax:").Trim(); gc.CreatePdf(orderNumber, ParcelNumber, "Tax Authority Details", driver, "SC", "York"); } catch { } //Tax Information Details driver.Navigate().GoToUrl("https://onlinetaxes.yorkcountygov.com/taxes#/"); Thread.Sleep(2000); gc.CreatePdf(orderNumber, ParcelNumber, "Tax main page", driver, "SC", "York"); try {//*[@id="cc5f8c90dc-b4cb-431b-90ee-10648f8df655"]/div/div/p[3]/button[1] //*[@id="cc5f8c90dc-b4cb-431b-90ee-10648f8df655"]/div/div/p[3]/button[1] driver.FindElement(By.XPath("//*[@id='cc5f8c90dc-b4cb-431b-90ee-10648f8df655']/div/div/p[3]/button[1]")).SendKeys(Keys.Enter); Thread.Sleep(2000); gc.CreatePdf(orderNumber, ParcelNumber, "Tax accept click", driver, "SC", "York"); } catch { } try { driver.FindElement(By.XPath("/html/body/div[1]/div/div/div[3]/button[2]")).SendKeys(Keys.Enter); Thread.Sleep(2000); } catch { } ////*[@id="searchBox"] //try { //driver.Navigate().GoToUrl("https://onlinetaxes.yorkcountygov.com/taxes#/WildfireSearch"); //Thread.Sleep(3000); //}catch { } driver.FindElement(By.Id("searchBox")).SendKeys(ParcelNumber); //driver.FindElement(By.XPath("//*[@id='searchBox']")).SendKeys(ParcelNumber); Thread.Sleep(4000); try { //*[@id="searchForm"]/div[1]/div/span/button driver.FindElement(By.XPath("//*[@id='searchForm']/div[1]/div/span/button")).SendKeys(Keys.Enter); } catch { } Thread.Sleep(2000); gc.CreatePdf(orderNumber, ParcelNumber, "Payment Details Pdf", driver, "SC", "York"); //Tax History Details Table string TaxHistorydetails = "", TaxOwnerName = "", TaxYear = "", Receipt = "", Descripton = "", Type = "", Status = "", PaidDate = ""; try { IWebElement PaymentTB = driver.FindElement(By.XPath("//*[@id='cc5f8c90dc-b4cb-431b-90ee-10648f8df655']/div/div/div[4]/div[2]/table")); //Working on div[3]/div[2] Previously 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("Owner Name")) { TaxOwnerName = PaymentTD[0].Text; TaxYear = PaymentTD[1].Text; Receipt = PaymentTD[2].Text; Descripton = PaymentTD[3].Text; Type = PaymentTD[4].Text; Status = PaymentTD[5].Text; PaidDate = PaymentTD[6].Text; TaxHistorydetails = TaxOwnerName + "~" + TaxYear + "~" + Receipt + "~" + Descripton + "~" + Type + "~" + Status + "~" + PaidDate + "~" + Taxauthority; gc.insert_date(orderNumber, ParcelNumber, 1547, TaxHistorydetails, 1, DateTime.Now); } } } catch { } //Tax Information Details// //***********************=========***********************// string name = "", Taxyear = "", bill_no = "", amount = "", Del_details = "", delinaccount = "", delinparcelid = ""; //int p = 0; for (int i = 1; i < 4; i++) { try { IWebElement Receipttable1 = driver.FindElement(By.XPath("//*[@id='cc5f8c90dc-b4cb-431b-90ee-10648f8df655']/div/div/div[4]/div[2]/table/tbody/tr[" + i + "]/td[9]/button")); //Working on div[3]/div[2] Previously Receipttable1.Click(); Thread.Sleep(5000); ////View Delinquent Details 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) { name = DeliquentTD[0].Text.Trim(); bill_no = DeliquentTD[1].Text.Trim(); Taxyear = DeliquentTD[2].Text.Trim(); amount = DeliquentTD[6].Text.Trim(); Del_details = name + "~" + Taxyear + "~" + bill_no + "~" + amount; gc.CreatePdf(orderNumber, ParcelNumber, "Deliquent Details" + i, driver, "SC", "York"); gc.insert_date(orderNumber, ParcelNumber, 1443, Del_details, 1, DateTime.Now); name = ""; Taxyear = ""; bill_no = ""; amount = ""; delinaccount = ""; delinparcelid = ""; } } } 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) { string bill_no1 = DeliquentfootTD[0].Text; string amount1 = DeliquentfootTD[2].Text; string Del_details1 = "" + "~" + "" + "~" + bill_no1 + "~" + amount1; gc.insert_date(orderNumber, ParcelNumber, 1443, Del_details1, 1, DateTime.Now); } } gc.CreatePdf(orderNumber, ParcelNumber, "Delinquent" + i, driver, "SC", "York"); } catch { } try { driver.FindElement(By.XPath("/html/body/div[1]/div/div/div[2]/button[2]")).Click(); Thread.Sleep(2000); } catch { } string Parcelid = "", Taxinfownername1 = "", PayStatus = "", Paypaiddate = "", Effectivedate = "", Paidamount = "", BillType = "", BillTaxYearinfo = "", Billreceipt = "", Duedate = "", Basetaxamt = "", Penalty = "", Costs = "", Totaldue = "", Credit = "", Fees = ""; //Tax Information details1 IWebElement TaxTB2 = driver.FindElement(By.XPath("//*[@id='cc5f8c90dc-b4cb-431b-90ee-10648f8df655']/div/div/div/div/div[1]/div[2]")); IList <IWebElement> TaxTR2 = TaxTB2.FindElements(By.TagName("div")); IList <IWebElement> TaxTD2; foreach (IWebElement Tax2 in TaxTR2) { if (Tax2.Text.Contains("Property Information")) { Parcelid = gc.Between(Tax2.Text, "Parcel Number", "District").Trim(); } if (Tax2.Text.Contains("Bill Information")) { BillType = gc.Between(Tax2.Text, "Record Type", "Tax Year").Trim(); BillTaxYearinfo = gc.Between(Tax2.Text, "Tax Year", "Receipt").Trim(); Billreceipt = gc.Between(Tax2.Text, "Receipt", "Due Date").Trim(); Duedate = GlobalClass.After(Tax2.Text, "Due Date").Trim(); } } //Tax information details //Owner information and Payment Information IWebElement TaxTB1 = driver.FindElement(By.XPath("//*[@id='cc5f8c90dc-b4cb-431b-90ee-10648f8df655']/div/div/div/div/div[1]/div[1]")); IList <IWebElement> TaxTR1 = TaxTB1.FindElements(By.TagName("div")); IList <IWebElement> TaxTD; foreach (IWebElement Tax1 in TaxTR1) { if (Tax1.Text.Contains("Owner Information")) { Taxinfownername1 = GlobalClass.After(Tax1.Text, "Owner Information").Trim(); string[] Taxinfownernamesplit = Taxinfownername1.Split('\r'); TaxOwnerName = Taxinfownernamesplit[0] + " " + Taxinfownernamesplit[2].Trim(); } if (Tax1.Text.Contains("Payment Information")) { PayStatus = gc.Between(Tax1.Text, "Status", "Last Payment Date").Trim(); Paypaiddate = gc.Between(Tax1.Text, "Last Payment Date", "Postmark Date").Trim(); Effectivedate = gc.Between(Tax1.Text, "Postmark Date", "Amount Paid").Trim(); Paidamount = GlobalClass.After(Tax1.Text, "Amount Paid").Trim(); } //} } string Taxinformationdetails2 = TaxOwnerName.Trim() + "~" + PayStatus.Trim() + "~" + Paypaiddate.Trim() + "~" + Effectivedate.Trim() + "~" + Paidamount.Trim() + "~" + BillType.Trim() + "~" + BillTaxYearinfo.Trim() + "~" + Billreceipt.Trim() + "~" + Duedate.Trim(); gc.insert_date(orderNumber, Parcelid, 1545, Taxinformationdetails2, 1, DateTime.Now); gc.CreatePdf(orderNumber, ParcelNumber, "Payment Details Pdf" + BillTaxYearinfo, driver, "SC", "York"); //Property Infor and Bill Infor and Taxes string Basetax = "", Credit1 = "", Fees1 = "", Penalty1 = "", Costs1 = "", Totaldue11 = ""; IWebElement TaxTB3 = driver.FindElement(By.XPath("//*[@id='cc5f8c90dc-b4cb-431b-90ee-10648f8df655']/div/div/div/div/div[1]/div[2]/div[3]/table/tbody")); IList <IWebElement> TaxTR3 = TaxTB3.FindElements(By.TagName("tr")); IList <IWebElement> TaxTD3; foreach (IWebElement Tax2 in TaxTR3) { //TaxTR3 = Tax2.FindElements(By.TagName("tr")); TaxTD3 = Tax2.FindElements(By.TagName("td")); if (TaxTD3.Count == 2 && Tax2.Text.Trim() != "" && Tax2.Text.Trim().Contains("Base Taxes")) { Basetax = TaxTD3[1].Text.Trim(); } if (TaxTD3.Count == 2 && Tax2.Text.Trim() != "" && Tax2.Text.Trim().Contains("Credit")) { Credit1 = TaxTD3[1].Text.Trim(); } if (TaxTD3.Count == 2 && Tax2.Text.Trim() != "" && Tax2.Text.Trim().Contains("Fees")) { Fees1 = TaxTD3[1].Text.Trim(); } if (TaxTD3.Count == 2 && Tax2.Text.Trim() != "" && Tax2.Text.Trim().Contains("Penalty")) { Penalty1 = TaxTD3[1].Text.Trim(); } if (TaxTD3.Count == 2 && Tax2.Text.Trim() != "" && Tax2.Text.Trim().Contains("Costs")) { Costs1 = TaxTD3[1].Text.Trim(); } if (TaxTD3.Count == 2 && Tax2.Text.Trim() != "" && Tax2.Text.Trim().Contains("Total Due")) { Totaldue11 = TaxTD3[1].Text.Trim(); } }//Penalty1="", Costs1="",Totaldue11="" //db.ExecuteQuery("update data_field_master set Data_Fields_Text='" + Title.Remove(Value.Length - 1, 1) + "' where Id = '" + 1445 + "'"); string Taxinformationdetails = BillTaxYearinfo.Trim() + "~" + Basetax.Trim() + "~" + Credit1.Trim() + "~" + Fees1.Trim() + "~" + Penalty1.Trim() + "~" + Costs1.Trim() + "~" + Totaldue11.Trim(); gc.insert_date(orderNumber, ParcelNumber, 1445, Taxinformationdetails, 1, DateTime.Now); //***Due Date Details** string Ifpaidby = "", Penaltydue = "", Amountdue = ""; IWebElement DueTB = driver.FindElement(By.XPath("//*[@id='cc5f8c90dc-b4cb-431b-90ee-10648f8df655']/div/div/div/div/div[1]/div[3]/div[2]/table")); IList <IWebElement> DueTR = DueTB.FindElements(By.TagName("tr")); IList <IWebElement> DueTH = DueTB.FindElements(By.TagName("th")); IList <IWebElement> DueTD; foreach (IWebElement Due in DueTR) { try { DueTD = Due.FindElements(By.TagName("td")); DueTH = Due.FindElements(By.TagName("th")); if (DueTH.Count != 0) { Penaltydue = DueTH[1].Text; Amountdue = DueTH[2].Text; db.ExecuteQuery("update data_field_master set Data_Fields_Text='" + "Tax Year~If Paid by~" + Penaltydue + "~" + Amountdue + "' where Id = '" + 1546 + "'"); } if (DueTD.Count != 0) { Ifpaidby = DueTD[0].Text; Penaltydue = DueTD[1].Text; Amountdue = DueTD[2].Text; string Duedatedetails = BillTaxYearinfo + "~" + Ifpaidby + "~" + Penaltydue + "~" + Amountdue; gc.insert_date(orderNumber, Parcelid, 1546, Duedatedetails, 1, DateTime.Now); } } catch { } } //Tax Bill Download try { driver.FindElement(By.XPath("//*[@id='cc5f8c90dc-b4cb-431b-90ee-10648f8df655']/div/div/div/ul/li[2]/a/div")).Click(); Thread.Sleep(5000); gc.CreatePdf(orderNumber, ParcelNumber, "Tax Bill Details" + BillTaxYearinfo, driver, "SC", "York"); //Thread.Sleep(5000); } catch { } driver.Navigate().Back(); } catch { } } TaxTime = DateTime.Now.ToString("HH:mm:ss"); CitytaxTime = DateTime.Now.ToString("HH:mm:ss"); LastEndTime = DateTime.Now.ToString("HH:mm:ss"); gc.insert_TakenTime(orderNumber, "SC", "York", StartTime, AssessmentTime, TaxTime, CitytaxTime, LastEndTime); driver.Quit(); gc.mergpdf(orderNumber, "SC", "York"); return("Data Inserted Successfully"); } catch (Exception ex) { driver.Quit(); GlobalClass.LogError(ex, orderNumber); throw ex; } } }
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_TNHamilton(string houseno, string sname, string sttype, string accno, string parcelNumber, string searchType, string orderNumber, string ownername, string directParcel, string unitno) { GlobalClass.global_orderNo = orderNumber; HttpContext.Current.Session["orderNo"] = orderNumber; GlobalClass.global_parcelNo = parcelNumber; string StartTime = "", AssessmentTime = "", TaxTime = "", CitytaxTime = "", LastEndTime = ""; var driverService = PhantomJSDriverService.CreateDefaultService(); driverService.HideCommandPromptWindow = true; using (driver = new PhantomJSDriver()) { //driver = new ChromeDriver(); try { StartTime = DateTime.Now.ToString("HH:mm:ss"); if (searchType == "titleflex") { string address = houseno + " " + sname + " " + unitno; gc.TitleFlexSearch(orderNumber, parcelNumber, "", address, "TN", "Hamilton"); if ((HttpContext.Current.Session["TitleFlex_Search"] != null && HttpContext.Current.Session["TitleFlex_Search"].ToString() == "Yes")) { driver.Quit(); return("MultiParcel"); } else if (HttpContext.Current.Session["titleparcel"].ToString() == "") { HttpContext.Current.Session["Nodata_TNHamilton"] = "Yes"; driver.Quit(); return("No Data Found"); } parcelNumber = HttpContext.Current.Session["titleparcel"].ToString(); searchType = "parcel"; } if (searchType == "address") { driver.Navigate().GoToUrl("http://assessor.hamiltontn.gov/search.aspx"); Thread.Sleep(2000); driver.FindElement(By.Id("SearchStreetName")).SendKeys(sname); driver.FindElement(By.Id("SearchStreetNumber")).SendKeys(houseno); driver.FindElement(By.Id("cmdGo")).SendKeys(Keys.Enter); Thread.Sleep(2000); gc.CreatePdf_WOP(orderNumber, "Address search", driver, "TN", "Hamilton"); IWebElement MultiAddressTB = driver.FindElement(By.XPath("//*[@id='T1']/tbody")); IList <IWebElement> MultiAddressTR = MultiAddressTB.FindElements(By.TagName("tr")); IList <IWebElement> MultiAddressTD; if (MultiAddressTR.Count == 1) { driver.FindElement(By.XPath("//*[@id='T1']/tbody/tr/td[1]/a")).Click(); Thread.Sleep(2000); } else { int AddressmaxCheck = 0; foreach (IWebElement MultiAddress in MultiAddressTR) { if (AddressmaxCheck <= 25) { MultiAddressTD = MultiAddress.FindElements(By.TagName("td")); if (MultiAddressTD.Count != 0) { Parcelno = MultiAddressTD[0].Text; Location = MultiAddressTD[1].Text; Owner = MultiAddressTD[2].Text; MultiAddress_details = Location + "~" + Owner; gc.insert_date(orderNumber, Parcelno, 764, MultiAddress_details, 1, DateTime.Now); } AddressmaxCheck++; } } if (MultiAddressTR.Count > 25) { HttpContext.Current.Session["multiParcel_TNHamilton_Multicount"] = "Maximum"; } else { HttpContext.Current.Session["multiparcel_TNHamilton"] = "Yes"; } driver.Quit(); return("MultiParcel"); } try { //No Data Found string nodata = driver.FindElement(By.XPath("//*[@id='body']/div[3]")).Text; if (nodata.Contains("No results found!")) { HttpContext.Current.Session["Nodata_TNHamilton"] = "Yes"; driver.Quit(); return("No Data Found"); } } catch { } } if (searchType == "parcel") { driver.Navigate().GoToUrl("http://assessor.hamiltontn.gov/search.aspx"); Thread.Sleep(2000); if (parcelNumber.Contains("-") || parcelNumber.Contains(" ") || parcelNumber.Contains(".")) { parcelNumber = parcelNumber.Replace("-", "").Replace(" ", "").Replace(".", ""); } string CommonParcel = parcelNumber; if (CommonParcel.Length == 8) { string a = parcelNumber.Substring(0, 4); string b = parcelNumber.Substring(4, 1); string c = parcelNumber.Substring(5, 3); parcelNumber = a + " " + b + " " + c; } if (CommonParcel.Length == 6) { string g = parcelNumber.Substring(0, 3); string h = parcelNumber.Substring(3, 3); parcelNumber = g + " " + h; } if (CommonParcel.Length == 13) { string d = parcelNumber.Substring(0, 4); string e = parcelNumber.Substring(5, 1); string f = parcelNumber.Substring(6, 3); parcelNumber = d + " " + e + " " + f; } driver.FindElement(By.Id("SearchParcel")).SendKeys(parcelNumber); driver.FindElement(By.Id("cmdGo")).SendKeys(Keys.Enter); Thread.Sleep(2000); gc.CreatePdf(orderNumber, parcelNumber, "ParcelSearch", driver, "TN", "Hamilton"); driver.FindElement(By.XPath("//*[@id='T1']/tbody/tr/td[1]/a")).Click(); Thread.Sleep(2000); } if (searchType == "ownername") { driver.Navigate().GoToUrl("http://assessor.hamiltontn.gov/search.aspx"); Thread.Sleep(2000); driver.FindElement(By.Id("SearchOwner")).SendKeys(ownername); driver.FindElement(By.Id("cmdGo")).SendKeys(Keys.Enter); Thread.Sleep(2000); gc.CreatePdf_WOP(orderNumber, "Owner search", driver, "TN", "Hamilton"); IWebElement MultiOwnerTB = driver.FindElement(By.XPath("//*[@id='T1']/tbody")); IList <IWebElement> MultiOwnerTR = MultiOwnerTB.FindElements(By.TagName("tr")); IList <IWebElement> MultiOwnerTD; if (MultiOwnerTR.Count == 1) { driver.FindElement(By.XPath("//*[@id='T1']/tbody/tr/td[1]/a")).Click(); Thread.Sleep(2000); } else { int AddressmaxCheck = 0; foreach (IWebElement MultiOwner in MultiOwnerTR) { if (AddressmaxCheck <= 25) { MultiOwnerTD = MultiOwner.FindElements(By.TagName("td")); if (MultiOwnerTD.Count != 0) { Parcelno = MultiOwnerTD[0].Text; Location = MultiOwnerTD[1].Text; Owner = MultiOwnerTD[2].Text; MultiOwner_details = Location + "~" + Owner; gc.insert_date(orderNumber, Parcelno, 764, MultiOwner_details, 1, DateTime.Now); } AddressmaxCheck++; } } if (MultiOwnerTR.Count > 25) { HttpContext.Current.Session["multiParcel_TNHamilton_Multicount"] = "Maximum"; } else { HttpContext.Current.Session["multiparcel_TNHamilton"] = "Yes"; } driver.Quit(); return("MultiParcel"); } try { //No Data Found string nodata = driver.FindElement(By.XPath("//*[@id='body']/div[3]")).Text; if (nodata.Contains("No results found!")) { HttpContext.Current.Session["Nodata_TNHamilton"] = "Yes"; driver.Quit(); return("No Data Found"); } } catch { } } //Property Details try { Property_Address = driver.FindElement(By.XPath("//*[@id='body']/form/div[2]/table[1]/tbody/tr[1]/td[1]/div/div")).Text; Account_No = driver.FindElement(By.XPath("//*[@id='body']/form/div[2]/table[1]/tbody/tr[1]/td[2]/div/div")).Text; Parcel_ID = driver.FindElement(By.XPath("//*[@id='body']/form/div[2]/table[1]/tbody/tr[1]/td[3]/div/div")).Text; Pro_Type = driver.FindElement(By.XPath("//*[@id='body']/form/div[2]/table[1]/tbody/tr[2]/td[1]/div/div")).Text; Land_Use = driver.FindElement(By.XPath("//*[@id='body']/form/div[2]/table[1]/tbody/tr[2]/td[2]/div/div")).Text; Dist = driver.FindElement(By.XPath("//*[@id='body']/form/div[2]/table[1]/tbody/tr[2]/td[3]/div/div")).Text; Owner1 = driver.FindElement(By.XPath("//*[@id='body']/form/div[2]/table[2]/tbody/tr[2]/td/div/table/tbody/tr/td/table/tbody/tr[1]/td[2]/div")).Text; Owner2 = driver.FindElement(By.XPath("//*[@id='body']/form/div[2]/table[2]/tbody/tr[2]/td/div/table/tbody/tr/td/table/tbody/tr[2]/td[2]/div")).Text; Owners = Owner1 + " &" + Owner2; Mailing1 = driver.FindElement(By.XPath("//*[@id='body']/form/div[2]/table[2]/tbody/tr[2]/td/div/table/tbody/tr/td/table/tbody/tr[3]/td[2]/div")).Text; Mailing2 = driver.FindElement(By.XPath("//*[@id='body']/form/div[2]/table[2]/tbody/tr[2]/td/div/table/tbody/tr/td/table/tbody/tr[1]/td[4]/div")).Text; Mailing3 = driver.FindElement(By.XPath("//*[@id='body']/form/div[2]/table[2]/tbody/tr[2]/td/div/table/tbody/tr/td/table/tbody/tr[2]/td[4]/div")).Text; Mailing4 = driver.FindElement(By.XPath("//*[@id='body']/form/div[2]/table[2]/tbody/tr[2]/td/div/table/tbody/tr/td/table/tbody/tr[3]/td[4]/div")).Text; Mailing_Address = Mailing1 + "," + Mailing2 + "," + Mailing3 + " " + Mailing4; Year_Built = driver.FindElement(By.XPath("//*[@id='body']/form/div[2]/table[2]/tbody/tr[4]/td/div[2]/center/table/tbody/tr[2]/td/div/table/tbody/tr/td/div")).Text; Year_Built = WebDriverTest.Between(Year_Built, "about ", " with"); Legal_Desp = driver.FindElement(By.XPath("//*[@id='body']/form/div[2]/table[2]/tbody/tr[4]/td/div[2]/center/table/tbody/tr[2]/td/font[2]/div[1]/center/table[2]/tbody/tr[2]/td/div/table/tbody/tr/td/div")).Text; property = Account_No + "~" + Property_Address + "~" + Pro_Type + "~" + Land_Use + "~" + Dist + "~" + Owners + "~" + Mailing_Address + "~" + Year_Built + "~" + Legal_Desp; gc.CreatePdf(orderNumber, Parcel_ID, "Property Details", driver, "TN", "Hamilton"); gc.insert_date(orderNumber, Parcel_ID, 766, property, 1, DateTime.Now); } catch { } //Assessment Deatils try { IWebElement tbmulti11 = driver.FindElement(By.XPath("//*[@id='body']/form/div[2]/table[2]/tbody/tr[4]/td/div[1]/center/table/tbody/tr[2]/td/div/table/tbody/tr/td/table/tbody")); IList <IWebElement> TRmulti11 = tbmulti11.FindElements(By.TagName("tr")); IList <IWebElement> TDmulti11; foreach (IWebElement row in TRmulti11) { TDmulti11 = row.FindElements(By.TagName("td")); if (TDmulti11.Count != 0) { Build = TDmulti11[0].Text; if (Build.Contains("Building Value")) { Building_Value = TDmulti11[1].Text; } Xtra = TDmulti11[0].Text; if (Xtra.Contains("Xtra Features Value")) { Xtra_Fetures_Value = TDmulti11[1].Text; } Land = TDmulti11[0].Text; if (Land.Contains("Land Value")) { Land_Value = TDmulti11[1].Text; } tol = TDmulti11[0].Text; if (tol.Contains("Total Value")) { Total_Value = TDmulti11[1].Text; } Assed = TDmulti11[0].Text; if (Assed.Contains("Assessed Value")) { Assessed_Value = TDmulti11[1].Text; } } } Assessment = Building_Value + "~" + Xtra_Fetures_Value + "~" + Land_Value + "~" + Total_Value + "~" + Assessed_Value; gc.insert_date(orderNumber, Parcel_ID, 767, Assessment, 1, DateTime.Now); } catch { } //Tax Details driver.Navigate().GoToUrl("http://tpti.hamiltontn.gov/AppFolder/Trustee_PropertySearch.aspx"); Thread.Sleep(2000); driver.FindElement(By.Id("ctl00_MainContent_btnMGP")).Click(); Thread.Sleep(2000); Parcel_ID = Parcel_ID.Replace("_", ""); if (Parcel_ID.Contains(".")) { Parcel_ID = GlobalClass.Before(Parcel_ID, ".").Trim(); } string com_Parcel = Parcel_ID; if (com_Parcel.Length == 7) { Map = Parcel_ID.Substring(0, 4); Parcel = Parcel_ID.Substring(4, 3); } if (com_Parcel.Length == 8) { Map = Parcel_ID.Substring(0, 4); Group = Parcel_ID.Substring(4, 1); Parcel = Parcel_ID.Substring(5, 3); } if (com_Parcel.Length == 9) { Map = Parcel_ID.Substring(0, 5); Group = Parcel_ID.Substring(5, 1); Parcel = Parcel_ID.Substring(6, 3); } driver.FindElement(By.Id("ctl00_MainContent_txtMap")).SendKeys(Map); driver.FindElement(By.Id("ctl00_MainContent_txtGroup")).SendKeys(Group); driver.FindElement(By.Id("ctl00_MainContent_txtParcel")).SendKeys(Parcel); gc.CreatePdf(orderNumber, Parcel_ID, "Tax Parcel search", driver, "TN", "Hamilton"); driver.FindElement(By.Id("ctl00_MainContent_cmdMGP_Search")).SendKeys(Keys.Enter); //County Tax History Details try { IWebElement CountyTaxPaymentTB = driver.FindElement(By.XPath("//*[@id='ctl00_MainContent_dgrResults']/tbody")); IList <IWebElement> CountyTaxPaymentTR = CountyTaxPaymentTB.FindElements(By.TagName("tr")); IList <IWebElement> CountyTaxPaymentTD; foreach (IWebElement CountyTaxPayment in CountyTaxPaymentTR) { CountyTaxPaymentTD = CountyTaxPayment.FindElements(By.TagName("td")); if (CountyTaxPaymentTD.Count != 0 && !CountyTaxPayment.Text.Contains("Year")) { County_Taxyear = CountyTaxPaymentTD[1].Text; Bill = CountyTaxPaymentTD[2].Text; Bill_Type = CountyTaxPaymentTD[4].Text; CPro_Type = CountyTaxPaymentTD[5].Text; Own_name = CountyTaxPaymentTD[6].Text; Tol_Due = CountyTaxPaymentTD[7].Text; Status = CountyTaxPaymentTD[8].Text; CountyPayment_details = County_Taxyear + "~" + Bill + "~" + Bill_Type + "~" + CPro_Type + "~" + Own_name + "~" + Tol_Due + "~" + Status; gc.CreatePdf(orderNumber, Parcel_ID, "County Tax History Details", driver, "TN", "Hamilton"); gc.insert_date(orderNumber, Parcel_ID, 768, CountyPayment_details, 1, DateTime.Now); } } } catch { } //County Tax Info Details List <string> CountyInfoSearch = new List <string>(); try { IWebElement CityInfoTB = driver.FindElement(By.XPath("//*[@id='ctl00_MainContent_dgrResults']/tbody")); IList <IWebElement> CityInfoTR = CityInfoTB.FindElements(By.TagName("tr")); IList <IWebElement> CityInfoTD; int i = 0; foreach (IWebElement CityInfo in CityInfoTR) { if (!CityInfo.Text.Contains("Year")) { if (i == 1 || i == 2 || i == 3) { CityInfoTD = CityInfo.FindElements(By.TagName("td")); IWebElement CityInfo_link = CityInfoTD[0].FindElement(By.TagName("a")); string CityInfourl = CityInfo_link.GetAttribute("href"); CountyInfoSearch.Add(CityInfourl); } } i++; } foreach (string CityInfobill in CountyInfoSearch) { driver.Navigate().GoToUrl(CityInfobill); Thread.Sleep(5000); driver.SwitchTo().Window(driver.WindowHandles.Last()); Thread.Sleep(3000); //Tax Info Flags = driver.FindElement(By.XPath("//*[@id='aspnetForm']/div[3]/table/tbody/tr[2]/td[2]/table/tbody/tr[5]/td/table/tbody/tr[1]/td[4]")).Text; Tax_Distrct = driver.FindElement(By.XPath("//*[@id='aspnetForm']/div[3]/table/tbody/tr[2]/td[2]/table/tbody/tr[5]/td/table/tbody/tr[2]/td[2]")).Text; Bil_type = driver.FindElement(By.XPath("//*[@id='aspnetForm']/div[3]/table/tbody/tr[2]/td[2]/table/tbody/tr[7]/td/table/tbody/tr[1]/td[2]")).Text; TaxBil_type = driver.FindElement(By.XPath("//*[@id='aspnetForm']/div[3]/table/tbody/tr[2]/td[2]/table/tbody/tr[7]/td/table/tbody/tr[1]/td[4]")).Text; Bil_Status = driver.FindElement(By.XPath("//*[@id='aspnetForm']/div[3]/table/tbody/tr[2]/td[2]/table/tbody/tr[7]/td/table/tbody/tr[2]/td[2]")).Text; Bill_Hash = driver.FindElement(By.XPath("//*[@id='aspnetForm']/div[3]/table/tbody/tr[2]/td[2]/table/tbody/tr[7]/td/table/tbody/tr[2]/td[4]")).Text; Tax_Assessment = driver.FindElement(By.XPath("//*[@id='aspnetForm']/div[3]/table/tbody/tr[2]/td[2]/table/tbody/tr[7]/td/table/tbody/tr[5]/td[2]")).Text; IWebElement Tax3TB = driver.FindElement(By.XPath("//*[@id='ctl00_MainContent_dgrTrans']/tbody")); IList <IWebElement> Tax3TR = Tax3TB.FindElements(By.TagName("tr")); IList <IWebElement> Tax3TD; foreach (IWebElement Tax3 in Tax3TR) { Tax3TD = Tax3.FindElements(By.TagName("td")); if (Tax3TD.Count != 0 && !Tax3.Text.Contains("Date")) { Billing_Date = Tax3TD[0].Text; Trns_type = Tax3TD[1].Text; Fee_Type = Tax3TD[2].Text; Bill_Amount = Tax3TD[4].Text; } } try { IWebElement Tax4TB = driver.FindElement(By.XPath("//*[@id='ctl00_MainContent_dgrPayments']/tbody")); IList <IWebElement> Tax4TR = Tax4TB.FindElements(By.TagName("tr")); IList <IWebElement> Tax4TD; foreach (IWebElement Tax4 in Tax4TR) { Tax4TD = Tax4.FindElements(By.TagName("td")); if (Tax4TD.Count != 0 && !Tax4.Text.Contains("Date Paid")) { PayIfo_Date = Tax4TD[0].Text; PayIfoTrns_type = Tax4TD[1].Text; PayIfoFee_Type = Tax4TD[2].Text; PayIfo_Amount = Tax4TD[3].Text; } } } catch { } //Deliquent Details try { IWebElement IntrestTB = driver.FindElement(By.XPath("//*[@id='ctl00_MainContent_lblIntAndFees']/table/tbody")); IList <IWebElement> IntrestTR = IntrestTB.FindElements(By.TagName("tr")); IList <IWebElement> IntrestTD; foreach (IWebElement Intrest in IntrestTR) { IntrestTD = Intrest.FindElements(By.TagName("td")); if (IntrestTD.Count != 0) { ints = IntrestTD[0].Text; if (ints.Contains("Interest:")) { Deliq_Interest = IntrestTD[1].Text; } Court = IntrestTD[0].Text; if (Court.Contains("Court Cost:")) { Deliq_CourtCost = IntrestTD[1].Text; } Att = IntrestTD[0].Text; if (Att.Contains("Attorney's Fee:")) { Deliq_Attornys = IntrestTD[1].Text; } Clerk = IntrestTD[0].Text; if (Clerk.Contains("Clerk Commission:")) { Deliq_Clerk = IntrestTD[1].Text; } TR = IntrestTD[0].Text; if (TR.Contains("TR Costs:")) { Deliq_TR = IntrestTD[1].Text; } } } } catch { } IWebElement Tax2TB = driver.FindElement(By.XPath("//*[@id='ctl00_MainContent_pnlTotalDue']/table[1]/tbody/tr[1]/td/table/tbody")); IList <IWebElement> Tax2TR = Tax2TB.FindElements(By.TagName("tr")); IList <IWebElement> Tax2TD; foreach (IWebElement Tax2 in Tax2TR) { Tax2TD = Tax2.FindElements(By.TagName("td")); if (Tax2TD.Count != 0) { t_du = Tax2TD[0].Text; if (t_du.Contains(" Total Due ")) { Total_taxDue = Tax2TD[1].Text; } } } gc.CreatePdf(orderNumber, Parcel_ID, "Tax Details" + TaxBil_type, driver, "TN", "Hamilton"); try { Tax_Authority = driver.FindElement(By.XPath("//*[@id='ctl00_MainContent_pnlOurAddr']/table/tbody/tr/td/b")).Text; } catch { } try { Tax_Authority = driver.FindElement(By.XPath("//*[@id='ctl00_MainContent_pnlDelQ']/table/tbody/tr/td/b")).Text; } catch { } Tax_Deatils = Tax_Distrct + "~" + TaxBil_type + "~" + Flags + "~" + Bil_type + "~" + Bil_Status + "~" + Bill_Hash + "~" + Tax_Assessment + "~" + Billing_Date + "~" + Trns_type + "~" + Fee_Type + "~" + Bill_Amount + "~" + PayIfo_Date + "~" + PayIfoTrns_type + "~" + PayIfoFee_Type + "~" + PayIfo_Amount + "~" + Deliq_Interest + "~" + Deliq_CourtCost + "~" + Deliq_Attornys + "~" + Deliq_Clerk + "~" + Deliq_TR + "~" + Total_taxDue + "~" + Tax_Authority; gc.insert_date(orderNumber, Parcel_ID, 769, Tax_Deatils, 1, DateTime.Now); PayIfo_Date = ""; PayIfoTrns_type = ""; PayIfoFee_Type = ""; PayIfo_Amount = ""; Deliq_Interest = ""; Deliq_CourtCost = ""; Deliq_Attornys = ""; Deliq_Clerk = ""; Deliq_TR = ""; Total_taxDue = ""; Tax_Authority = ""; } } catch { } TaxTime = DateTime.Now.ToString("HH:mm:ss"); if (Tax_Distrct == "Chattanooga (1)") { driver.Navigate().GoToUrl("http://propertytax.chattanooga.gov/component/ptaxweb/searchpage?field=mgp"); Thread.Sleep(2000); City_map = Map.Replace(" ", ""); driver.FindElement(By.Id("filter_search_map")).SendKeys(City_map); driver.FindElement(By.Id("filter_search_group")).SendKeys(Group); driver.FindElement(By.Id("filter_search_parcel")).SendKeys(Parcel); gc.CreatePdf(orderNumber, Parcel_ID, "City Parcel search", driver, "TN", "Hamilton"); driver.FindElement(By.XPath("//*[@id='content']/div[1]/form/div/div[2]/button")).SendKeys(Keys.Enter); Thread.Sleep(2000); driver.FindElement(By.XPath("//*[@id=\'content']/div/div[1]/form/table/tbody/tr/td[1]/a")).Click(); Thread.Sleep(2000); //City Tax History Details try { IWebElement CityTaxPaymentTB = driver.FindElement(By.XPath("//*[@id='content']/div/div[1]/form/table[2]/tbody")); IList <IWebElement> CityTaxPaymentTR = CityTaxPaymentTB.FindElements(By.TagName("tr")); IList <IWebElement> CityTaxPaymentTD; foreach (IWebElement CityTaxPayment in CityTaxPaymentTR) { CityTaxPaymentTD = CityTaxPayment.FindElements(By.TagName("td")); if (CityTaxPaymentTD.Count != 0 && !CityTaxPayment.Text.Contains("Year")) { City_Taxyear = CityTaxPaymentTD[1].Text; City_Bill = CityTaxPaymentTD[2].Text; CityBill_Type = CityTaxPaymentTD[3].Text; CityPro_Type = CityTaxPaymentTD[4].Text; CityOwn_name = CityTaxPaymentTD[5].Text; CityTol_Due = CityTaxPaymentTD[6].Text; CityStatus = CityTaxPaymentTD[7].Text; CityPayment_details = City_Taxyear + "~" + City_Bill + "~" + CityBill_Type + "~" + CityPro_Type + "~" + CityOwn_name + "~" + CityTol_Due + "~" + CityStatus; gc.CreatePdf(orderNumber, Parcel_ID, "CIty Tax History Details", driver, "TN", "Hamilton"); gc.insert_date(orderNumber, Parcel_ID, 770, CityPayment_details, 1, DateTime.Now); } } } catch { } //City Info Details List <string> CityInfoSearch = new List <string>(); try { IWebElement CityInfo1TB = driver.FindElement(By.XPath("//*[@id='content']/div/div[1]/form/table[2]/tbody")); IList <IWebElement> CityInfo1TR = CityInfo1TB.FindElements(By.TagName("tr")); IList <IWebElement> CityInfo1TD; int i = 0; foreach (IWebElement CityInfo1 in CityInfo1TR) { if (i == 0 || i == 1 || i == 2) { CityInfo1TD = CityInfo1.FindElements(By.TagName("td")); IWebElement CityInfo1_link = CityInfo1TD[0].FindElement(By.TagName("a")); string CityInfo1url = CityInfo1_link.GetAttribute("href"); CityInfoSearch.Add(CityInfo1url); } i++; } foreach (string CityInfobill1 in CityInfoSearch) { driver.Navigate().GoToUrl(CityInfobill1); Thread.Sleep(5000); driver.SwitchTo().Window(driver.WindowHandles.Last()); Thread.Sleep(3000); City_Flags = driver.FindElement(By.XPath("//*[@id='ptaxweb-content']/table[1]/tbody/tr[1]/td[4]")).Text; City_BillHash = driver.FindElement(By.XPath("//*[@id='ptaxweb-content']/table[2]/tbody/tr/td[2]")).Text; City_Bil_type = driver.FindElement(By.XPath("//*[@id='ptaxweb-content']/table[3]/tbody/tr[1]/td[2]")).Text; City_TaxBil_Year = driver.FindElement(By.XPath("//*[@id='ptaxweb-content']/table[3]/tbody/tr[1]/td[4]")).Text; City_Bil_Status = driver.FindElement(By.XPath("//*[@id='ptaxweb-content']/table[3]/tbody/tr[2]/td[2]")).Text; City_Assessment = driver.FindElement(By.XPath("//*[@id='ptaxweb-content']/table[3]/tbody/tr[4]/td[4]")).Text; try { IWebElement Tax211TB = driver.FindElement(By.XPath("//*[@id='ptaxweb-content']/table[5]/tbody[2]")); IList <IWebElement> Tax211TR = Tax211TB.FindElements(By.TagName("tr")); IList <IWebElement> Tax211TD; foreach (IWebElement Tax211 in Tax211TR) { Tax211TD = Tax211.FindElements(By.TagName("td")); if (Tax211TD.Count != 0) { t_Inst = Tax211TD[0].Text; if (t_Inst.Contains("Taxes & Interest")) { Tax_Instr = Tax211TD[1].Text; } t_Water = Tax211TD[0].Text; if (t_Water.Contains("Water Quality Fee & Interest")) { Tax_Water = Tax211TD[1].Text; } } } } catch { } try { IWebElement Tax212TB = driver.FindElement(By.XPath("//*[@id='ptaxweb-content']/table[5]/tbody[2]")); IList <IWebElement> Tax212TR = Tax212TB.FindElements(By.TagName("tr")); IList <IWebElement> Tax212TD; foreach (IWebElement Tax212 in Tax212TR) { Tax212TD = Tax212.FindElements(By.TagName("td")); if (Tax212TD.Count != 0) { City_PaidDate = Tax212TD[0].Text; City_PaidAmount = Tax212TD[1].Text; } } } catch { } try { IWebElement Tax21TB = driver.FindElement(By.XPath("//*[@id='ptaxweb-content']/table[6]/tbody[2]")); IList <IWebElement> Tax21TR = Tax21TB.FindElements(By.TagName("tr")); IList <IWebElement> Tax21TD; foreach (IWebElement Tax21 in Tax21TR) { Tax21TD = Tax21.FindElements(By.TagName("td")); if (Tax21TD.Count != 0) { City_PaidDate = Tax21TD[0].Text; City_PaidAmount = Tax21TD[1].Text; } } } catch { } try { IWebElement Tax311TB = driver.FindElement(By.XPath("//*[@id='ptaxweb-content']/table[7]/tbody")); IList <IWebElement> Tax311TR = Tax311TB.FindElements(By.TagName("tr")); IList <IWebElement> Tax311TD; foreach (IWebElement Tax311 in Tax311TR) { Tax311TD = Tax311.FindElements(By.TagName("td")); if (Tax311TD.Count != 0) { tauth_Inst1 = Tax311TD[0].Text; if (tauth_Inst.Contains("Total Due")) { City_TotalDue = Tax311TD[1].Text; } } } } catch { } try { IWebElement Tax311TB = driver.FindElement(By.XPath("//*[@id='ptaxweb-content']/table[8]/tbody")); IList <IWebElement> Tax311TR = Tax311TB.FindElements(By.TagName("tr")); IList <IWebElement> Tax311TD; foreach (IWebElement Tax311 in Tax311TR) { Tax311TD = Tax311.FindElements(By.TagName("td")); if (Tax311TD.Count != 0) { tauth_Inst = Tax311TD[0].Text; if (tauth_Inst.Contains("Total Due")) { City_TotalDue = Tax311TD[1].Text; } } } } catch { } try { CityTax_Authority = driver.FindElement(By.XPath("//*[@id='ptaxweb-content']/table[6]/tbody/tr/td")).Text; CityTax_Authority = WebDriverTest.After(CityTax_Authority, "MAKE CHECKS PAYABLE AND MAIL TO:"); } catch { } try { CityTax_Authority1 = driver.FindElement(By.XPath("//*[@id='ptaxweb-content']/table[7]/tbody/tr/td")).Text; CityTax_Authority1 = WebDriverTest.After(CityTax_Authority1, "MAKE CHECKS PAYABLE AND MAIL TO:"); } catch { } CityTax_Deatils = City_Flags + "~" + City_BillHash + "~" + City_Bil_type + "~" + City_TaxBil_Year + "~" + City_Bil_Status + "~" + City_Assessment + "~" + City_PaidDate + "~" + City_PaidAmount + "~" + Tax_Instr + "~" + Tax_Water + "~" + City_TotalDue + "~" + CityTax_Authority + "~" + CityTax_Authority1; gc.CreatePdf(orderNumber, Parcel_ID, "City Tax Details" + City_TaxBil_Year, driver, "TN", "Hamilton"); gc.insert_date(orderNumber, Parcel_ID, 771, CityTax_Deatils, 1, DateTime.Now); City_PaidDate = ""; City_PaidAmount = ""; Tax_Instr = ""; Tax_Water = ""; City_TotalDue = ""; try { IWebElement CinfoTB = driver.FindElement(By.XPath("//*[@id='ptaxweb-content']/table[4]/tbody[2]")); IList <IWebElement> CinfoTR = CinfoTB.FindElements(By.TagName("tr")); IList <IWebElement> CinfoTD; foreach (IWebElement Cinfo in CinfoTR) { CinfoTD = Cinfo.FindElements(By.TagName("td")); if (CinfoTD.Count != 0) { Cinfo_Taxyear = CinfoTD[0].Text; Cinfo_Transtype = CinfoTD[1].Text; Cinfo_Feetype = CinfoTD[2].Text; Cinfo_Amount = CinfoTD[3].Text; Cinfo_details = Cinfo_Taxyear + "~" + Cinfo_Transtype + "~" + Cinfo_Feetype + "~" + Cinfo_Amount; gc.insert_date(orderNumber, Parcel_ID, 772, Cinfo_details, 1, DateTime.Now); } } } catch { } } } catch { } } CitytaxTime = DateTime.Now.ToString("HH:mm:ss"); LastEndTime = DateTime.Now.ToString("HH:mm:ss"); gc.insert_TakenTime(orderNumber, "TN", "Hamilton", StartTime, AssessmentTime, TaxTime, CitytaxTime, LastEndTime); driver.Quit(); gc.mergpdf(orderNumber, "TN", "Hamilton"); return("Data Inserted Successfully"); } catch (Exception ex) { driver.Quit(); GlobalClass.LogError(ex, orderNumber); throw; } } }
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; } } }
public string FTP_HenryGA(string Address, string unitno, string ownername, string parcelNumber, string searchType, string orderNumber, string directParcel) { GlobalClass.global_orderNo = orderNumber; HttpContext.Current.Session["orderNo"] = orderNumber; GlobalClass.global_parcelNo = parcelNumber; IJavaScriptExecutor js = driver as IJavaScriptExecutor; string strmulti = "", Taxy = "", LegalDescription = ""; string StartTime = "", AssessmentTime = "", TaxTime = "", CitytaxTime = "", LastEndTime = "", accountnumber = ""; var driverService = PhantomJSDriverService.CreateDefaultService(); driverService.HideCommandPromptWindow = true; //driver = new PhantomJSDriver(); //driver = new ChromeDriver(); using (driver = new PhantomJSDriver()) { try { StartTime = DateTime.Now.ToString("HH:mm:ss"); driver.Navigate().GoToUrl("http://qpublic7.qpublic.net/ga_henry_search.php"); try { driver.FindElement(By.XPath("//*[@id='appBody']/div[4]/div/div/div[3]/a[1]")).SendKeys(Keys.Enter); Thread.Sleep(2000); } catch { } try { driver.FindElement(By.XPath("//*[@id='appBody']/div[5]/div/div/div[3]/a")).SendKeys(Keys.Enter); Thread.Sleep(2000); } catch { } //Thread.Sleep(3000); if (searchType == "titleflex") { gc.TitleFlexSearch(orderNumber, "", "", Address.Trim(), "GA", "Henry"); 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_HenryGA"] = "Yes"; driver.Quit(); return("No Data Found"); } parcelNumber = HttpContext.Current.Session["titleparcel"].ToString(); searchType = "parcel"; } if (searchType == "address") { driver.FindElement(By.Id("ctlBodyPane_ctl02_ctl01_txtAddress")).SendKeys(Address); gc.CreatePdf_WOP(orderNumber, "Address Search Before", driver, "GA", "Henry"); driver.FindElement(By.Id("ctlBodyPane_ctl02_ctl01_btnSearch")).SendKeys(Keys.Enter); Thread.Sleep(2000); gc.CreatePdf_WOP(orderNumber, "Address Search After", driver, "GA", "Henry"); try { strmulti = GlobalClass.Before(driver.FindElement(By.Id("ctlBodyPane_ctl00_txtResultCount")).Text.Trim(), "Results"); if (Convert.ToInt32(strmulti) > 25) { HttpContext.Current.Session["multiParcel_Henry_Maximum"] = "Maximum"; return("Maximum"); } IWebElement Imultitable = driver.FindElement(By.Id("ctlBodyPane_ctl00_ctl01_gvwParcelResults")); IList <IWebElement> ImutiRow = Imultitable.FindElements(By.TagName("tr")); IList <IWebElement> ImultiTD; foreach (IWebElement multi in ImutiRow) { ImultiTD = multi.FindElements(By.TagName("td")); if (ImultiTD.Count != 0 && !multi.Text.Contains("Address")) { string strmultiDetails = ImultiTD[2].Text + "~" + ImultiTD[3].Text; gc.insert_date(orderNumber, ImultiTD[1].Text, 1647, strmultiDetails, 1, DateTime.Now); } } HttpContext.Current.Session["multiParcel_Henry"] = "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_HenryGA"] = "Yes"; driver.Quit(); return("No Data Found"); } } catch { } } if (searchType == "parcel") { driver.FindElement(By.Id("ctlBodyPane_ctl01_ctl01_txtParcelID")).SendKeys(parcelNumber); gc.CreatePdf(orderNumber, parcelNumber, "Parcel Before Search", driver, "GA", "Henry"); driver.FindElement(By.Id("ctlBodyPane_ctl01_ctl01_btnSearch")).SendKeys(Keys.Enter); Thread.Sleep(2000); gc.CreatePdf(orderNumber, parcelNumber, "Parcel Aftere Pdf", driver, "GA", "Henry"); 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_HenryGA"] = "Yes"; driver.Quit(); return("No Data Found"); } } catch { } } else if (searchType == "ownername") { driver.FindElement(By.Id("ctlBodyPane_ctl00_ctl01_txtName")).SendKeys(ownername); gc.CreatePdf_WOP(orderNumber, "OwnerName Search Before", driver, "GA", "Henry"); driver.FindElement(By.Id("ctlBodyPane_ctl00_ctl01_btnSearch")).SendKeys(Keys.Enter); Thread.Sleep(2000); gc.CreatePdf_WOP(orderNumber, "OwnerName Search After", driver, "GA", "Henry"); try { strmulti = GlobalClass.Before(driver.FindElement(By.Id("ctlBodyPane_ctl00_txtResultCount")).Text.Trim(), " Results"); if (Convert.ToInt32(strmulti) > 25) { HttpContext.Current.Session["multiParcel_Henry_Maximum"] = "Maximum"; return("Maximum"); } IWebElement Imultitable = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl00_ctl01_gvwParcelResults']/tbody")); IList <IWebElement> ImutiRow = Imultitable.FindElements(By.TagName("tr")); IList <IWebElement> ImultiTD; foreach (IWebElement multi in ImutiRow) { ImultiTD = multi.FindElements(By.TagName("td")); if (ImultiTD.Count != 0 && !multi.Text.Contains("Address")) { string strmultiDetails = ImultiTD[2].Text + "~" + ImultiTD[3].Text; gc.insert_date(orderNumber, ImultiTD[1].Text, 1647, strmultiDetails, 1, DateTime.Now); } } HttpContext.Current.Session["multiParcel_Henry"] = "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_HenryGA"] = "Yes"; driver.Quit(); return("No Data Found"); } } catch { } } //Property Details string Owner = "", MailingAddress = "", ParcelNumber = "", Propertytype = "", PropertyAddress = "", ZipCode = "", Class = "", TaxDistrict = "", MillageRate = "", Acres = "", Neighborhood = "", HomesteadExemption = "", LandlotAndDistrictAndSection = "", Subdivision = "", YearBuilt = ""; try { string bulktext1 = driver.FindElement(By.Id("ctlBodyPane_ctl02_ctl01_lstOwner")).Text.Trim(); string[] Propdata1 = bulktext1.Split('\r'); if (Propdata1.Count() == 4) { Owner = Propdata1[0].Replace("\r\n", "").Trim() + "&" + Propdata1[1].Replace("\r\n", "").Trim(); MailingAddress = Propdata1[2].Replace("\r\n", "").Trim() + " " + Propdata1[3].Replace("\r\n", "").Trim(); } if (Propdata1.Count() == 3) { Owner = Propdata1[0].Replace("\r\n", "").Trim(); MailingAddress = Propdata1[1].Replace("\r\n", "").Trim() + " " + Propdata1[2].Replace("\r\n", "").Trim(); } if (Propdata1.Count() == 2) { MailingAddress = Propdata1[1].Replace("\r\n", "").Trim() + " " + Propdata1[2].Replace("\r\n", "").Trim(); } ParcelNumber = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl00_mSection']/div/div/div/table/tbody/tr[1]/td[2]")).Text.Trim(); //gc.CreatePdf(orderNumber, ParcelNumber, "Property Details and Assessment Details Pdf", driver, "GA", "Henry"); PropertyAddress = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl00_mSection']/div/div/div/table/tbody/tr[2]/td[2]")).Text.Trim(); Propertytype = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl00_mSection']/div/div/div/table/tbody/tr[4]/td[2]")).Text.Trim(); try { YearBuilt = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl06_mSection']/div/div/div[1]/table/tbody/tr[3]/td[2]")).Text.Trim(); } catch { } } catch { } //Assessment Details try { string AssessmentTitle = "", AssessmentValue = ""; IWebElement tbcurasses12 = driver.FindElement(By.Id("ctlBodyPane_ctl03_ctl01_grdValuation_grdYearData")); IList <IWebElement> TRcurasses2 = tbcurasses12.FindElements(By.TagName("tr")); IList <IWebElement> TDmulti12; IList <IWebElement> THmulti12; foreach (IWebElement row in TRcurasses2) { TDmulti12 = row.FindElements(By.TagName("td")); THmulti12 = row.FindElements(By.TagName("th")); if (TDmulti12.Count != 0 && !row.Text.Contains("Year")) { AssessmentValue = TDmulti12[0].Text + "~" + TDmulti12[1].Text + "~" + TDmulti12[2].Text + "~" + TDmulti12[3].Text + "~" + TDmulti12[4].Text; gc.insert_date(orderNumber, ParcelNumber, 1642, AssessmentValue, 1, DateTime.Now); } if (THmulti12.Count != 0 && row.Text.Contains("Assessed Year")) { AssessmentTitle = THmulti12[0].Text + "~" + THmulti12[1].Text + "~" + THmulti12[2].Text + "~" + THmulti12[3].Text + "~" + THmulti12[4].Text; } } db.ExecuteQuery("update data_field_master set Data_Fields_Text='" + AssessmentTitle + "' where Id = '" + 1642 + "'"); } catch { } //Tax Authority string Taxauthority = ""; try { //string Taxauthority1 = "", Taxauthority2 = "", Taxauthority3 = "", Taxauthority4 = ""; driver.Navigate().GoToUrl("https://www.henrytc.org/#/"); Thread.Sleep(2000); IWebElement taxo = driver.FindElement(By.Id("bottom2")); string[] Taxauthority1 = taxo.Text.Split('\r'); gc.CreatePdf(orderNumber, ParcelNumber, "TaxAuthority Pdf", driver, "GA", "Henry"); Taxauthority = Taxauthority1[1] + " " + Taxauthority1[2] + " " + Taxauthority1[3] + " " + Taxauthority1[4]; } catch { } //Tax information Details string AccountAndRealkey = ""; try { driver.Navigate().GoToUrl("https://www.henrytc.org/taxes.html#/WildfireSearch"); Thread.Sleep(2000); try {///html/body/div[1]/div/div/div[3]/button[2] driver.FindElement(By.XPath("/html/body/div[1]/div/div/div[3]/button[2]")).SendKeys(Keys.Enter); Thread.Sleep(2000); } catch { } driver.FindElement(By.Id("searchBox")).SendKeys(ParcelNumber); Thread.Sleep(4000); try { driver.FindElement(By.XPath("//*[@id='searchForm']/div[1]/div/span/button")).SendKeys(Keys.Enter); } catch { } Thread.Sleep(2000); gc.CreatePdf(orderNumber, ParcelNumber, "Payment Details Pdf", driver, "GA", "Henry"); } catch { } //Tax Payment Receipt Details Table string Paymentdetails = "", TaxOwnerName = "", TaxYear = "", Bill = "", MapandParcel = "", Taxtype = "", PaidDate = "", Paid = ""; try { IWebElement PaymentTB = null; try { PaymentTB = driver.FindElement(By.XPath("//*[@id='avalon']/div/div[3]/div[2]/table")); } catch { } try { if (PaymentTB == null) { PaymentTB = driver.FindElement(By.XPath("//*[@id='avalon']/div/div[4]/div[2]/table")); } } catch { } //IWebElement PaymentTB = driver.FindElement(By.XPath("//*[@id='avalon']/div/div[3]/div[2]/table")); 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("Owner Name")) { TaxOwnerName = PaymentTD[0].Text; TaxYear = PaymentTD[1].Text; Bill = PaymentTD[2].Text; MapandParcel = PaymentTD[3].Text; Taxtype = PaymentTD[4].Text; PaidDate = PaymentTD[6].Text; Paid = PaymentTD[5].Text; //Tax OwnerName~TaxYear~Bil Numberl~Property Address~Tax Type~Status~Paid Date Paymentdetails = TaxOwnerName + "~" + TaxYear + "~" + Bill + "~" + MapandParcel + "~" + Taxtype + "~" + Paid + "~" + PaidDate; gc.insert_date(orderNumber, ParcelNumber, 1643, Paymentdetails, 1, DateTime.Now); } } } catch { } //Tax Bill Details string name = "", Taxyear = "", bill_no = "", amount = "", Del_details = "", delinaccount = "", delinparcelid = ""; try { //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 { } //IWebElement Receipttable = driver.FindElement(By.XPath("//*[@id='avalon']/div/div[3]/div[2]/table/tbody")); IList <IWebElement> ReceipttableRow = Receipttable.FindElements(By.TagName("tr")); int rowcount = ReceipttableRow.Count; for (int p = 1; p <= rowcount; p++) { if (p < 4) { ////*[@id="avalon"]/div/div[3]/div[2]/table/tbody/tr[1]/td[9] 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")).Click(); } catch { } Thread.Sleep(2000); try { driver.FindElement(By.XPath("/html/body/div[1]/div/div/div[2]/button[2]")).Click(); Thread.Sleep(2000); } catch { } gc.CreatePdf(orderNumber, ParcelNumber, "Overview & Pay Pdf" + p, driver, "GA", "Henry"); Thread.Sleep(6000); //View Delinquent Details try { driver.FindElement(By.XPath("//*[@id='avalon']/div/div/div/div[1]/div[1]/div[3]/button[4]")).Click(); 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) { name = DeliquentTD[0].Text.Trim(); Taxyear = DeliquentTD[1].Text.Trim(); bill_no = DeliquentTD[2].Text.Trim(); delinaccount = DeliquentTD[3].Text.Trim(); delinparcelid = DeliquentTD[4].Text.Trim(); amount = DeliquentTD[6].Text.Trim(); Del_details = name + "~" + Taxyear + "~" + bill_no + "~" + delinaccount + "~" + delinparcelid + "~" + amount; gc.CreatePdf(orderNumber, ParcelNumber, "Deliquent Details" + delinaccount, driver, "GA", "Henry"); gc.insert_date(orderNumber, ParcelNumber, 1646, Del_details, 1, DateTime.Now); name = ""; Taxyear = ""; bill_no = ""; amount = ""; delinaccount = ""; delinparcelid = ""; } } } 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) { string bill_no1 = DeliquentfootTD[0].Text; string amount1 = DeliquentfootTD[2].Text; string Del_details1 = "" + "~" + "" + "~" + "" + "~" + "" + "~" + bill_no1 + "~" + amount1; gc.insert_date(orderNumber, ParcelNumber, 1646, 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 { } string Taxinfownername = "", Mailingadd = "", AccountNumber = "", RecordType = "", BillNumber = "", BillTaxYear = "", taxown = ""; string DueDate = "", PaymentStatus = "", LastPaymentDate = "", TotalAmountPaid = "", TotalDuePayment = ""; //Tax information details try { IWebElement owne = driver.FindElement(By.XPath("//*[@id='avalon']/div/div/div/div[1]/div[1]/div[1]")); string[] ownesplit = owne.Text.Split('\r'); Taxinfownername = ownesplit[1].Trim(); try { Mailingadd = ownesplit[3].Trim() + " " + ownesplit[6].Trim(); } catch { } //Bill information IWebElement TaxTB = driver.FindElement(By.XPath("//*[@id='avalon']/div/div/div/div[1]/div[2]/div[2]/table/tbody")); IList <IWebElement> TaxTR = TaxTB.FindElements(By.TagName("tr")); IList <IWebElement> TaxTD; foreach (IWebElement Tax1 in TaxTR) { TaxTD = Tax1.FindElements(By.TagName("td")); if (TaxTD.Count != 0 && Tax1.Text != "") { if (Tax1.Text.Contains("Record Type")) { RecordType = TaxTD[1].Text; } if (Tax1.Text.Contains("Tax Year")) { BillTaxYear = TaxTD[1].Text; } if (Tax1.Text.Contains("Bill Number")) { BillNumber = TaxTD[1].Text; } if (Tax1.Text.Contains("Account Number")) { AccountNumber = TaxTD[1].Text; } if (Tax1.Text.Contains("Due Date")) { DueDate = TaxTD[1].Text; } } } //Property information string Propertyid = "", District = "", Propertyadd = "", Assessedvalu = "", Appriasedval = ""; IWebElement TaxTB2 = driver.FindElement(By.XPath("//*[@id='avalon']/div/div/div/div[1]/div[2]/div[1]/table/tbody")); IList <IWebElement> TaxTR2 = TaxTB2.FindElements(By.TagName("tr")); IList <IWebElement> TaxTD2; foreach (IWebElement Tax2 in TaxTR2) { TaxTD2 = Tax2.FindElements(By.TagName("td")); if (TaxTD2.Count != 0 && Tax2.Text != "") { if (Tax2.Text.Contains("Parcel Number")) { Propertyid = TaxTD2[1].Text; } if (Tax2.Text.Contains("District")) { District = TaxTD2[1].Text + " "; } if (Tax2.Text.Contains("Description")) { LegalDescription = TaxTD2[1].Text + " "; } if (Tax2.Text.Contains("Property Address")) { Propertyadd = TaxTD2[1].Text + " "; } if (Tax2.Text.Contains("Assessed Value")) { Assessedvalu = TaxTD2[1].Text + " "; } if (Tax2.Text.Contains("Appraised Value")) { Appriasedval = TaxTD2[1].Text + " "; } } } //Taxes Information string BaseTaxes = "", Penalty = "", Interest = "", Otherfees = "", TotaldueTax = "", BackTaxes = "", Yeartotaldue = ""; IWebElement TaxTB3 = driver.FindElement(By.XPath("//*[@id='avalon']/div/div/div/div[1]/div[2]/div[3]/table/tbody")); IList <IWebElement> TaxTR3 = TaxTB3.FindElements(By.TagName("tr")); IList <IWebElement> TaxTD3; foreach (IWebElement Tax3 in TaxTR3) { TaxTD3 = Tax3.FindElements(By.TagName("td")); if (TaxTD3.Count != 0 && Tax3.Text != "") { if (Tax3.Text.Contains("Base Taxes")) { BaseTaxes = TaxTD3[1].Text; } if (Tax3.Text.Contains("Penalty")) { Penalty = TaxTD3[1].Text + " "; } if (Tax3.Text.Contains("Interest")) { Interest = TaxTD3[1].Text; } if (Tax3.Text.Contains("Other Fees")) { Otherfees = TaxTD3[1].Text; } if (Tax3.Text.Contains("Total Due")) { try { if (TaxTD3[0].Text.Trim().Count() > 9) { string Yeartotaldue1 = TaxTD3[1].Text; Yeartotaldue = BillTaxYear.Trim() + " " + Yeartotaldue1.Trim(); } } catch { } } if (Tax3.Text.Contains("Back Taxes")) { BackTaxes = TaxTD3[1].Text + " "; } if (Tax3.Text.Contains("Total Due") && !Tax3.Text.Contains(BillTaxYear)) { TotaldueTax = TaxTD3[1].Text + " "; } } } //Payment Information IWebElement TaxTB4 = driver.FindElement(By.XPath("//*[@id='avalon']/div/div/div/div[1]/div[1]/div[2]/table/tbody")); IList <IWebElement> TaxTR4 = TaxTB4.FindElements(By.TagName("tr")); IList <IWebElement> TaxTD4; foreach (IWebElement Tax4 in TaxTR4) { TaxTD4 = Tax4.FindElements(By.TagName("td")); if (TaxTD4.Count != 0 && Tax4.Text != "") { if (Tax4.Text.Contains("Status")) { PaymentStatus = TaxTD4[1].Text + " "; } if (Tax4.Text.Contains("Last Payment Date")) { LastPaymentDate = TaxTD4[1].Text; } if (Tax4.Text.Contains("Amount Paid")) { TotalAmountPaid = TaxTD4[1].Text + " "; } } } string Taxinfo_details1 = Taxinfownername + "~" + Propertyadd + "~" + Mailingadd + "~" + District + "~" + Assessedvalu + "~" + Appriasedval + "~" + PaymentStatus + "~" + PaidDate + "~" + TotalAmountPaid + "~" + RecordType + "~" + BillTaxYear + "~" + BillNumber + "~" + AccountNumber + "~" + DueDate + "~" + BaseTaxes + "~" + Penalty + "~" + Interest + "~" + Otherfees + "~" + Yeartotaldue + "~" + BackTaxes + "~" + TotaldueTax + "~" + Taxauthority; gc.insert_date(orderNumber, Propertyid, 1644, Taxinfo_details1, 1, DateTime.Now); string Authority = "", Adjusted = "", Assessd = "", Exemptions = "", Taxableval = "", Millage = "", Gross = "", Credit = "", Nettax = ""; //Tax Distribution Details IWebElement TaxTB5 = driver.FindElement(By.XPath("//*[@id='avalon']/div/div/div/div[1]/div[3]/div/table")); IList <IWebElement> TaxTR5 = TaxTB5.FindElements(By.TagName("tr")); IList <IWebElement> TaxTD5; IList <IWebElement> TaxTH5; foreach (IWebElement Tax5 in TaxTR5) { TaxTD5 = Tax5.FindElements(By.TagName("td")); TaxTH5 = Tax5.FindElements(By.TagName("th")); if (TaxTD5.Count != 0 && Tax5.Text != "") { Authority = TaxTD5[0].Text.Trim(); Adjusted = TaxTD5[1].Text.Trim(); Assessd = TaxTD5[2].Text.Trim(); Exemptions = TaxTD5[3].Text.Trim(); Taxableval = TaxTD5[4].Text.Trim(); Millage = TaxTD5[5].Text.Trim(); Gross = TaxTD5[6].Text.Trim(); Credit = TaxTD5[7].Text.Trim(); Nettax = TaxTD5[8].Text.Trim(); string Taxinfo_details2 = BillTaxYear + "~" + Authority + "~" + Adjusted + "~" + Assessd + "~" + Exemptions + "~" + Taxableval + "~" + Millage + "~" + Gross + "~" + Credit + "~" + Nettax; gc.insert_date(orderNumber, Propertyid, 1645, Taxinfo_details2, 1, DateTime.Now); } if (TaxTH5.Count != 0 && Tax5.Text != "" && !Tax5.Text.Contains("Entity")) { Authority = TaxTH5[0].Text.Trim(); Adjusted = TaxTH5[1].Text.Trim(); Assessd = TaxTH5[2].Text.Trim(); Exemptions = TaxTH5[3].Text.Trim(); Taxableval = TaxTH5[4].Text.Trim(); Millage = TaxTH5[5].Text.Trim(); Gross = TaxTH5[6].Text.Trim(); Credit = TaxTH5[7].Text.Trim(); Nettax = TaxTH5[8].Text.Trim(); string Taxinfo_details3 = BillTaxYear + "~" + Authority + "~" + Adjusted + "~" + Assessd + "~" + Exemptions + "~" + Taxableval + "~" + Millage + "~" + Gross + "~" + Credit + "~" + Nettax; gc.insert_date(orderNumber, Propertyid, 1645, Taxinfo_details3, 1, DateTime.Now); } } } catch { } //Tax Bill driver.FindElement(By.XPath("//*[@id='avalon']/div/div/ul/li[2]/a")).Click(); Thread.Sleep(9000); gc.CreatePdf(orderNumber, ParcelNumber, "Tax Bill Details" + BillTaxYear, driver, "GA", "Henry"); //View And Print Receipt try { driver.FindElement(By.XPath("//*[@id='avalon']/div/div/ul/li[3]/a")).Click(); Thread.Sleep(9000); gc.CreatePdf(orderNumber, ParcelNumber, "View Print Receipt" + BillTaxYear, driver, "GA", "Henry"); } catch { } Thread.Sleep(5000); driver.Navigate().Back(); } } } catch { } string PropertyDetails = Owner.Trim() + "~" + PropertyAddress.Trim() + "~" + MailingAddress.Trim() + "~" + Propertytype.Trim() + "~" + YearBuilt.Trim() + "~" + LegalDescription.Trim(); gc.insert_date(orderNumber, ParcelNumber, 1641, PropertyDetails, 1, DateTime.Now); TaxTime = DateTime.Now.ToString("HH:mm:ss"); CitytaxTime = DateTime.Now.ToString("HH:mm:ss"); LastEndTime = DateTime.Now.ToString("HH:mm:ss"); gc.insert_TakenTime(orderNumber, "GA", "Henry", StartTime, AssessmentTime, TaxTime, CitytaxTime, LastEndTime); driver.Quit(); gc.mergpdf(orderNumber, "GA", "Henry"); return("Data Inserted Successfully"); } catch (Exception ex) { driver.Quit(); GlobalClass.LogError(ex, orderNumber); throw ex; } } }