public string FTP_FLMarion(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; List <string> mcheck = new List <string>(); 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") { titleaddress = address; titleOwner = ownername; gc.TitleFlexSearch(orderNumber, "", ownername, titleaddress, "FL", "Marion"); 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_FLMarion"] = "Yes"; driver.Quit(); return("No Data Found"); } parcelNumber = HttpContext.Current.Session["titleparcel"].ToString(); searchType = "parcel"; } if (searchType == "address") { driver.Navigate().GoToUrl("http://www.pa.marion.fl.us/PropertySearch.aspx"); Thread.Sleep(2000); driver.FindElement(By.Id("MCPAMaster_MCPAContent_rblSearchBy_0")).Click(); Thread.Sleep(2000); driver.FindElement(By.Id("MCPAMaster_MCPAContent_txtParm")).SendKeys(address); driver.FindElement(By.Id("MCPAMaster_MCPAContent_btnWine")).SendKeys(Keys.Enter); gc.CreatePdf_WOP(orderNumber, "Address search", driver, "FL", "Marion"); Thread.Sleep(2000); try { IWebElement MultiAddressTB = driver.FindElement(By.XPath("//*[@id='srch']/table[1]/tbody")); IList <IWebElement> MultiAddressTR = MultiAddressTB.FindElements(By.TagName("tr")); IList <IWebElement> MultiAddressTD; gc.CreatePdf_WOP(orderNumber, "Multi Address search", driver, "FL", "Marion"); if (MultiAddressTR.Count == 1) { driver.FindElement(By.XPath("//*[@id='srch']/table[1]/tbody/tr/td[1]/a")).Click(); Thread.Sleep(4000); } else { int AddressmaxCheck = 0; string xpath = ""; int m = 1; foreach (IWebElement MultiAddress in MultiAddressTR) { if (AddressmaxCheck <= 25) { MultiAddressTD = MultiAddress.FindElements(By.TagName("td")); if (MultiAddressTD.Count != 0 && MultiAddress.Text.Contains(address.ToUpper())) { IWebElement Parcelno1 = MultiAddressTD[0].FindElement(By.TagName("a")); Parcelno = Parcelno1.Text; Owner = MultiAddressTD[1].Text; Property_Address = MultiAddressTD[2].Text; MultiAddress_details = Owner + "~" + Property_Address; gc.insert_date(orderNumber, Parcelno, 672, MultiAddress_details, 1, DateTime.Now); xpath = "//*[@id='srch']/table[1]/tbody/tr[" + m + "]/td[1]/a"; mcheck.Add(MultiAddressTD[0].Text.Trim()); } m++; } AddressmaxCheck++; } if (mcheck.Count == 1) { driver.FindElement(By.XPath(xpath)).Click(); Thread.Sleep(4000); } else { if (MultiAddressTR.Count > 25) { HttpContext.Current.Session["multiParcel_FLMarion_Multicount"] = "Maximum"; driver.Quit(); return("Maximum"); } else { HttpContext.Current.Session["multiparcel_FLMarion"] = "Yes"; driver.Quit(); return("MultiParcel"); } } } } catch { } try { //No Data Found string nodata = driver.FindElement(By.Id("srch")).Text; if (nodata.Contains("0 records found. End of search reached.")) { HttpContext.Current.Session["Nodata_FLMarion"] = "Yes"; driver.Quit(); return("No Data Found"); } } catch { } } if (searchType == "parcel") { driver.Navigate().GoToUrl("http://www.pa.marion.fl.us/PropertySearch.aspx"); Thread.Sleep(2000); driver.FindElement(By.Id("MCPAMaster_MCPAContent_rblSearchBy_2")).Click(); Thread.Sleep(2000); driver.FindElement(By.Id("MCPAMaster_MCPAContent_txtParm")).SendKeys(parcelNumber); driver.FindElement(By.Id("MCPAMaster_MCPAContent_btnWine")).SendKeys(Keys.Enter); gc.CreatePdf(orderNumber, parcelNumber, "ParcelSearch", driver, "FL", "Marion"); Thread.Sleep(2000); driver.FindElement(By.XPath("//*[@id='srch']/table[1]/tbody/tr/td[1]/a")).Click(); Thread.Sleep(2000); try { //No Data Found string nodata = driver.FindElement(By.Id("srch'")).Text; if (nodata.Contains("0 records found. End of search reached.")) { HttpContext.Current.Session["Nodata_FLMarion"] = "Yes"; driver.Quit(); return("No Data Found"); } } catch { } } if (searchType == "ownername") { var chromeOptions = new ChromeOptions(); var chDriver = new ChromeDriver(chromeOptions); chDriver.Navigate().GoToUrl("http://www.pa.marion.fl.us/PropertySearch.aspx"); Thread.Sleep(2000); chDriver.FindElement(By.Id("MCPAMaster_MCPAContent_rblSearchBy_1")).Click(); Thread.Sleep(2000); chDriver.FindElement(By.Id("MCPAMaster_MCPAContent_txtParm")).SendKeys(ownername); chDriver.FindElement(By.Id("MCPAMaster_MCPAContent_btnWine")).SendKeys(Keys.Enter); gc.CreatePdf_WOP(orderNumber, "Owner search", chDriver, "FL", "Marion"); Thread.Sleep(2000); try { IWebElement MultiOwnerTB = chDriver.FindElement(By.XPath("//*[@id='srch']/table[1]/tbody")); IList <IWebElement> MultiOwnerTR = MultiOwnerTB.FindElements(By.TagName("tr")); IList <IWebElement> MultiOwnerTD; gc.CreatePdf_WOP(orderNumber, "Multi Owner search", chDriver, "FL", "Marion"); if (MultiOwnerTR.Count == 1) { chDriver.FindElement(By.XPath("//*[@id='srch']/table[1]/tbody/tr/td[1]/a")).Click(); Thread.Sleep(2000); } else { int OwnermaxCheck = 0; foreach (IWebElement MultiOwner in MultiOwnerTR) { if (OwnermaxCheck <= 25) { MultiOwnerTD = MultiOwner.FindElements(By.TagName("td")); if (MultiOwnerTD.Count != 0) { IWebElement Parcelno1 = MultiOwnerTD[0].FindElement(By.TagName("a")); Parcelno = Parcelno1.Text; Owner = MultiOwnerTD[1].Text; Property_Address = MultiOwnerTD[2].Text; MultiOwner_details = Owner + "~" + Property_Address; gc.insert_date(orderNumber, Parcelno, 672, MultiOwner_details, 1, DateTime.Now); } OwnermaxCheck++; } } if (MultiOwnerTR.Count > 25) { HttpContext.Current.Session["multiParcel_FLMarion_Multicount"] = "Maximum"; } else { HttpContext.Current.Session["multiparcel_FLMarion"] = "Yes"; } chDriver.Quit(); return("MultiParcel"); } } catch { } try { //No Data Found string nodata = driver.FindElement(By.XPath("//*[@id='srch']/text()")).Text; if (nodata.Contains("0 records found. End of search reached.")) { HttpContext.Current.Session["Nodata_FLMarion"] = "Yes"; driver.Quit(); return("No Data Found"); } } catch { } chDriver.Quit(); } Thread.Sleep(3000); driver.SwitchTo().Window(driver.WindowHandles.Last()); Thread.Sleep(4000); //Property Details //try //{ // driver.FindElement(By.XPath("//*[@id='prc']/div/a[1]")).Click(); // Thread.Sleep(6000); //} //catch //{ } try { ParcelID = driver.FindElement(By.XPath("//*[@id='prc']/table/tbody/tr/td/h1")).Text; Primary_Key = driver.FindElement(By.XPath("//*[@id='prc']/table/tbody/tr/td/table[1]/tbody/tr/td[1]")).Text; Primary_Key = WebDriverTest.After(Primary_Key, "Prime Key: "); Owner_Mailing = driver.FindElement(By.XPath("//*[@id='prc']/table/tbody/tr/td/table[2]/tbody/tr/td[1]")).Text; try { driver.FindElement(By.XPath("//*[@id='prc']/div/a[2]")).Click(); Thread.Sleep(2000); full = driver.FindElement(By.XPath("//*[@id='prc']/table/tbody/tr/td/table[2]/tbody/tr/td[2]")).Text; Taxes_Assments = gc.Between(full, "Taxes / Assessments:", "Map ID:"); try { assess1 = driver.FindElement(By.XPath("//*[@id='prc']/table/tbody/tr/td/table[3]/tbody/tr/td[1]")).Text.Replace("\r\n", "~"); assess11 = driver.FindElement(By.XPath("//*[@id='prc']/table/tbody/tr/td/table[3]/tbody/tr/td[2]")).Text.Replace("\r\n", "~"); DBconnection dbconn = new DBconnection(); dbconn.ExecuteQuery("update data_field_master set Data_Fields_Text='" + assess1 + "' where Id = '" + 692 + "'"); gc.CreatePdf(orderNumber, ParcelID, "Assessment1 Details", driver, "FL", "Marion"); gc.insert_date(orderNumber, ParcelID, 692, assess11, 1, DateTime.Now); } catch { } //History Accessd Values try { IWebElement HistoryTB = driver.FindElement(By.XPath("//*[@id='prc']/table/tbody/tr/td/table[4]/tbody")); IList <IWebElement> HistoryTR = HistoryTB.FindElements(By.TagName("tr")); IList <IWebElement> HistoryTD; foreach (IWebElement History in HistoryTR) { HistoryTD = History.FindElements(By.TagName("td")); if (HistoryTD.Count != 0 && HistoryTR.Count != 1) { Year = HistoryTD[0].Text; Land_Just = HistoryTD[1].Text; Building = HistoryTD[2].Text; Misc_Value = HistoryTD[3].Text; Mkt_Just = HistoryTD[4].Text; Assed_Value = HistoryTD[5].Text; Exceptions = HistoryTD[6].Text; Taxabl_Val = HistoryTD[7].Text; History_details = Year + "~" + Land_Just + "~" + Building + "~" + Misc_Value + "~" + Mkt_Just + "~" + Assed_Value + "~" + Exceptions + "~" + Taxabl_Val; gc.insert_date(orderNumber, ParcelID, 693, History_details, 1, DateTime.Now); } } } catch { } driver.Navigate().Back(); Thread.Sleep(5000); } catch { } Map_Id = gc.Between(full, "Map ID:", "Millage:"); Millage = GlobalClass.After(full, "Millage:"); full1 = driver.FindElement(By.XPath("//*[@id='prc']/table/tbody/tr/td/table[2]/tbody/tr/td[3]")).Text; try { Acres = gc.Between(full1, "Acres: ", "Situs: ").Replace("More Situs", ""); Situs = WebDriverTest.After(full1, "Situs: "); } catch { } Proty_Desp = driver.FindElement(By.XPath("//*[@id='prc']/table/tbody/tr/td")).Text; Proty_Desp = gc.Between(Proty_Desp, "Property Description", "Land Data - Warning: Verify Zoning"); try { Improve1 = driver.FindElement(By.XPath("//*[@id='prc']/table/tbody/tr/td/table[6]/tbody/tr/td[1]/table/tbody/tr/td[2]")).Text.Replace("\r\n", "~"); string[] rowarrayname1 = Improve1.Split('~'); Improve = rowarrayname1[0]; Year_Built = driver.FindElement(By.XPath("//*[@id='prc']/table/tbody/tr/td/table[6]/tbody/tr/td[2]")).Text; Year_Built = gc.Between(Year_Built, "Year Built", "Physical Deterioration"); } catch { } property = Primary_Key + "~" + Owner_Mailing + "~" + Situs + "~" + Taxes_Assments + "~" + Map_Id + "~" + Millage + "~" + Acres + "~" + Proty_Desp + "~" + Improve + "~" + Year_Built; gc.CreatePdf(orderNumber, ParcelID, "Assessment11 Details", driver, "FL", "Marion"); gc.insert_date(orderNumber, ParcelID, 691, property, 1, DateTime.Now); } catch { } //try //{ // assess = driver.FindElement(By.XPath("//*[@id='prc']/table/tbody/tr/td/table[3]/tbody/tr/td[1]")).Text.Replace("\r\n", "~"); // assess1 = driver.FindElement(By.XPath("//*[@id='prc']/table/tbody/tr/td/table[3]/tbody/tr/td[2]")).Text.Replace("\r\n", "~"); // DBconnection dbconn = new DBconnection(); // dbconn.ExecuteQuery("update data_field_master set Data_Fields_Text='" + assess + "' where Id = '" + 692 + "'"); // gc.insert_date(orderNumber, ParcelID, 692, assess1, 1, DateTime.Now); //} //catch //{ } AssessmentTime = DateTime.Now.ToString("HH:mm:ss"); //Tax Details driver.Navigate().GoToUrl("https://www.mariontax.com/itm/PropertySearchAccount.aspx"); Thread.Sleep(4000); driver.FindElement(By.Id("btnAgree")).Click(); Thread.Sleep(4000); driver.FindElement(By.Id("_ctl0_ContentPlaceHolder1_txtAccount")).SendKeys(ParcelID); gc.CreatePdf(orderNumber, ParcelID, "Tax Details", driver, "FL", "Marion"); driver.FindElement(By.Id("_ctl0_ContentPlaceHolder1_btnSearch")).SendKeys(Keys.Enter); Thread.Sleep(4000); gc.CreatePdf(orderNumber, ParcelID, "Tax Parcels Details", driver, "FL", "Marion"); driver.FindElement(By.Id("_ctl0_ContentPlaceHolder1_rptSummary__ctl0_lnkDetails1")).Click(); Thread.Sleep(4000); //Tax Payment History try { IWebElement BreakdownTB = driver.FindElement(By.XPath("//*[@id='_ctl0_ContentPlaceHolder1_tblSummary']/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 && !Breakdown.Text.Contains("Year")) { Tax_Year = BreakdownTD[0].Text; Roll = BreakdownTD[1].Text; Acc_Num = BreakdownTD[2].Text; Sta = BreakdownTD[3].Text; Date_Paid = BreakdownTD[4].Text; Amount_Paid = BreakdownTD[5].Text; Balnc_Due = BreakdownTD[6].Text; Payment_details = Tax_Year + "~" + Roll + "~" + Acc_Num + "~" + Sta + "~" + Date_Paid + "~" + Amount_Paid + "~" + Balnc_Due; gc.insert_date(orderNumber, ParcelID, 695, Payment_details, 1, DateTime.Now); } } } catch { } //Tax Information Acc_No = driver.FindElement(By.XPath("//*[@id='tbl1']/tbody/tr[2]/td[2]")).Text.Replace(" ", ""); Typ = driver.FindElement(By.XPath("//*[@id='tbl1']/tbody/tr[2]/td[4]/table/tbody/tr/td[1]")).Text; Add = driver.FindElement(By.XPath("//*[@id='tbl1']/tbody/tr[3]/td[2]")).Text; try { Deliquent = driver.FindElement(By.XPath("//*[@id='tbl3']/tbody/tr[4]/td")).Text; } catch { } try { Roll_Coment = driver.FindElement(By.XPath("//*[@id='_ctl0_ContentPlaceHolder1_tblSummary']/tbody/tr[3]/td[2]")).Text; } catch { } List <string> ParcelSearch = new List <string>(); try { IWebElement ParcelTB = driver.FindElement(By.XPath("//*[@id='_ctl0_ContentPlaceHolder1_tblSummary']/tbody")); IList <IWebElement> ParcelTR = ParcelTB.FindElements(By.TagName("tr")); ParcelTR.Reverse(); int rows_count = ParcelTR.Count; for (int row = 0; row < rows_count; row++) { if (row == rows_count - 1 || row == rows_count - 2 || row == rows_count - 3) { IList <IWebElement> Columns_row = ParcelTR[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[0].FindElement(By.TagName("a")); string Parcelurl = ParcelBill_link.GetAttribute("href"); ParcelSearch.Add(Parcelurl); } } } } } catch { } foreach (string Parcelbill in ParcelSearch) { driver.Navigate().GoToUrl(Parcelbill); Thread.Sleep(3000); Taxy = driver.FindElement(By.XPath("//*[@id='_ctl0_ContentPlaceHolder1_lblDetTaxYear']")).Text; try { Pdes1 = driver.FindElement(By.XPath("//*[@id='Table2a']/tbody/tr[1]/td")).Text; Pdes2 = driver.FindElement(By.XPath("//*[@id='Table2a']/tbody/tr[2]/td")).Text; Pdes3 = driver.FindElement(By.XPath("//*[@id='Table2a']/tbody/tr[3]/td")).Text; Pdes4 = driver.FindElement(By.XPath("//*[@id='Table2a']/tbody/tr[4]/td")).Text; P_des = Pdes1 + " " + Pdes2 + " " + Pdes3 + " " + Pdes4; } catch { } try { OInfo1 = driver.FindElement(By.XPath("//*[@id='Table2b']/tbody/tr[1]/td")).Text; M_Addr1 = driver.FindElement(By.XPath("//*[@id='Table2b']/tbody/tr[2]/td")).Text; M_Addr2 = driver.FindElement(By.XPath("//*[@id='Table2b']/tbody/tr[3]/td")).Text; Owner_Mail = OInfo1 + " & " + M_Addr1 + " " + M_Addr2; } catch { } try { OInfo1 = driver.FindElement(By.XPath("//*[@id='Table2b']/tbody/tr[1]/td")).Text; OInfo2 = driver.FindElement(By.XPath("//*[@id='Table2b']/tbody/tr[2]/td")).Text; M_Addr1 = driver.FindElement(By.XPath("//*[@id='Table2b']/tbody/tr[3]/td")).Text; M_Addr2 = driver.FindElement(By.XPath("//*[@id='Table2b']/tbody/tr[4]/td")).Text; Owner_Mail = OInfo1 + " " + OInfo2 + " & " + M_Addr1 + " " + M_Addr2; } catch { } try { IWebElement tbmulti11 = driver.FindElement(By.XPath("//*[@id='Table2c']/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) { Mkt = TDmulti11[0].Text; if (Mkt.Contains("MARKET VALU")) { Markt_Value = TDmulti11[0].Text.Replace(" ", ""); Markt_Value = WebDriverTest.After(Markt_Value, "MARKETVALU"); } Asst = TDmulti11[0].Text; if (Asst.Contains("ASSESSMENT")) { ASSESSMENT = TDmulti11[0].Text.Replace(" ", ""); ASSESSMENT = WebDriverTest.After(ASSESSMENT, "ASSESSMENT"); } Txb = TDmulti11[0].Text; if (Txb.Contains("TAXABLE")) { TAXABLE = TDmulti11[0].Text.Replace(" ", ""); TAXABLE = WebDriverTest.After(TAXABLE, "TAXABLE"); } Ext = TDmulti11[0].Text; if (Ext.Contains("EXCD01")) { EXC = TDmulti11[0].Text.Replace(" ", ""); EXC = WebDriverTest.After(EXC, "EXCD01"); } Ext1 = TDmulti11[0].Text; if (Ext1.Contains("EXCD38")) { EXC1 = TDmulti11[0].Text.Replace(" ", ""); EXC1 = WebDriverTest.After(EXC1, "EXCD38"); } Ext2 = TDmulti11[0].Text; if (Ext2.Contains("EXCD02")) { EXC2 = TDmulti11[0].Text.Replace(" ", ""); EXC2 = WebDriverTest.After(EXC2, "EXCD02"); } Count_Asst = TDmulti11[0].Text; if (Count_Asst.Contains("COUNTY ASMT")) { County_ASMT = TDmulti11[0].Text.Replace(" ", ""); County_ASMT = WebDriverTest.After(County_ASMT, "COUNTYASMT"); } Count_txbl = TDmulti11[0].Text; if (Count_txbl.Contains("COUNTY TXBL")) { County_TXBL = TDmulti11[0].Text.Replace(" ", ""); County_TXBL = WebDriverTest.After(County_TXBL, "COUNTYTXBL"); } Tax_Asst = TDmulti11[0].Text; if (Tax_Asst.Contains("SCHOOL ASMT")) { Tax_ASMT = TDmulti11[0].Text.Replace(" ", ""); Tax_ASMT = WebDriverTest.After(Tax_ASMT, "SCHOOLASMT"); } Tax_txbl = TDmulti11[0].Text; if (Tax_txbl.Contains("SCHOOL TXBL")) { Tax_TXBL = TDmulti11[0].Text.Replace(" ", ""); Tax_TXBL = WebDriverTest.After(Tax_TXBL, "SCHOOLTXBL"); } } } IWebElement tbmulti1 = driver.FindElement(By.XPath("//*[@id='Table2d']/tbody")); IList <IWebElement> TRmulti1 = tbmulti1.FindElements(By.TagName("tr")); IList <IWebElement> TDmulti1; foreach (IWebElement row in TRmulti1) { TDmulti1 = row.FindElements(By.TagName("td")); if (TDmulti1.Count != 0) { txes = TDmulti1[0].Text; if (txes.Contains("TAXES")) { TAXES = TDmulti1[0].Text.Replace(" ", ""); TAXES = WebDriverTest.After(TAXES, "TAXES"); } sptxs = TDmulti1[0].Text; if (sptxs.Contains("SP. ASMT")) { SP_ASMT = TDmulti1[0].Text.Replace(" ", ""); SP_ASMT = WebDriverTest.After(SP_ASMT, "SP.ASMT"); } intt = TDmulti1[0].Text; if (intt.Contains("INT.")) { INT = TDmulti1[0].Text.Replace(" ", ""); INT = WebDriverTest.After(INT, "INT."); } Salet = TDmulti1[0].Text; if (Salet.Contains("SALE 5%")) { SALE = TDmulti1[0].Text.Replace(" ", ""); SALE = WebDriverTest.After(SALE, "SALE5%"); } Advt = TDmulti1[0].Text; if (Advt.Contains("ADV. FEE")) { ADV = TDmulti1[0].Text.Replace(" ", ""); ADV = WebDriverTest.After(ADV, "ADV.FEE"); } } } Tax_Info = Acc_No + "~" + Typ + "~" + Add + "~" + Taxy + "~" + P_des + "~" + Owner_Mail + "~" + Markt_Value + "~" + ASSESSMENT + "~" + TAXABLE + "~" + EXC + "~" + EXC1 + "~" + EXC2 + "~" + TAXES + "~" + SP_ASMT + "~" + INT + "~" + SALE + "~" + ADV + "~" + County_ASMT + "~" + County_TXBL + "~" + Tax_ASMT + "~" + Tax_TXBL; gc.insert_date(orderNumber, ParcelID, 697, Tax_Info, 1, DateTime.Now); Markt_Value = ""; ASSESSMENT = ""; TAXABLE = ""; EXC = ""; EXC1 = ""; EXC2 = ""; TAXES = ""; SP_ASMT = ""; INT = ""; SALE = ""; ADV = ""; County_ASMT = ""; County_TXBL = ""; Tax_ASMT = ""; Tax_TXBL = ""; } catch { } gc.CreatePdf(orderNumber, ParcelID, "Tax Payment Details" + Taxy, driver, "FL", "Marion"); Thread.Sleep(2000); //Tax Receipt try { Receipt = driver.FindElement(By.XPath("//*[@id='tbl5']/tbody/tr[4]/td")).Text.Replace(" ", ""); Commonreceipt = Receipt; if (Commonreceipt.Length == 58) { A = Receipt.Substring(0, 10); B = Receipt.Substring(10, 19); C = Receipt.Substring(29, 9); D = Receipt.Substring(38, 7); E = Receipt.Substring(45, 4); F = Receipt.Substring(49, 9); Receipt_Details5 = A + "~" + B + "~" + "~" + C + "~" + D + "~" + E + "~" + F; gc.insert_date(orderNumber, ParcelID, 698, Receipt_Details5, 1, DateTime.Now); } if (Commonreceipt.Length == 42) { A = Receipt.Substring(0, 10); B = Receipt.Substring(10, 19); C = Receipt.Substring(29, 4); D = Receipt.Substring(33, 9); Receipt_Details1 = A + "~" + B + "~" + C + "~" + D + "~" + "" + "~" + "" + "~" + ""; gc.insert_date(orderNumber, ParcelID, 698, Receipt_Details1, 1, DateTime.Now); } if (Commonreceipt.Length == 62) { A = Receipt.Substring(0, 10); B = Receipt.Substring(10, 19); C = Receipt.Substring(29, 4); D = Receipt.Substring(33, 9); E = Receipt.Substring(42, 7); F = Receipt.Substring(49, 4); G = Receipt.Substring(53, 9); Receipt_Details2 = A + "~" + B + "~" + C + "~" + D + "~" + E + "~" + F + "~" + G; gc.insert_date(orderNumber, ParcelID, 698, Receipt_Details2, 1, DateTime.Now); } if (Commonreceipt.Length == 61) { A = Receipt.Substring(0, 10); B = Receipt.Substring(10, 19); C = Receipt.Substring(29, 4); D = Receipt.Substring(33, 10); E = Receipt.Substring(43, 6); F = Receipt.Substring(49, 5); G = Receipt.Substring(54, 7); Receipt_Details3 = A + "~" + B + "~" + C + "~" + D + "~" + E + "~" + F + "~" + G; gc.insert_date(orderNumber, ParcelID, 698, Receipt_Details3, 1, DateTime.Now); } if (Commonreceipt.Length == 60) { A = Receipt.Substring(0, 10); B = Receipt.Substring(10, 19); C = Receipt.Substring(29, 4); D = Receipt.Substring(33, 9); E = Receipt.Substring(42, 7); F = Receipt.Substring(49, 4); G = Receipt.Substring(53, 7); Receipt_Details4 = A + "~" + B + "~" + C + "~" + D + "~" + E + "~" + F + "~" + G; gc.insert_date(orderNumber, ParcelID, 698, Receipt_Details4, 1, DateTime.Now); } if (Commonreceipt.Length == 56) { A = Receipt.Substring(0, 10); B = Receipt.Substring(10, 19); C = Receipt.Substring(29, 9); D = Receipt.Substring(38, 7); E = Receipt.Substring(45, 4); F = Receipt.Substring(49, 7); Receipt_Details4 = A + "~" + B + "~" + "" + "~" + C + "~" + D + "~" + E + "~" + F; gc.insert_date(orderNumber, ParcelID, 698, Receipt_Details4, 1, DateTime.Now); } if (Commonreceipt.Length == 64) { A = Receipt.Substring(0, 10); B = Receipt.Substring(10, 19); C = Receipt.Substring(29, 4); D = Receipt.Substring(33, 9); E = Receipt.Substring(42, 8); F = Receipt.Substring(50, 4); G = Receipt.Substring(54, 10); Receipt_Details9 = A + "~" + B + "~" + C + "~" + D + "~" + E + "~" + F + "~" + G; gc.insert_date(orderNumber, ParcelID, 698, Receipt_Details9, 1, DateTime.Now); } } catch { } //driver.Navigate().Back(); //Thread.Sleep(2000); } driver.FindElement(By.Id("_ctl0_ContentPlaceHolder1_lnkAcctBill2")).Click(); Thread.Sleep(3000); driver.SwitchTo().Window(driver.WindowHandles.Last()); Thread.Sleep(4000); //Ad-Valorem & Non-Ad Valorem IWebElement AdValoremTB = driver.FindElement(By.XPath("//*[@id='Table3']/tbody")); IList <IWebElement> AdValoremTR = AdValoremTB.FindElements(By.TagName("tr")); IList <IWebElement> AdValoremTD; foreach (IWebElement AdValorem in AdValoremTR) { AdValoremTD = AdValorem.FindElements(By.TagName("td")); if (AdValoremTD.Count != 0 && !AdValorem.Text.Contains("TAXING AUTHORITY") && AdValoremTD[0].Text != "" && !AdValorem.Text.Contains("*** PAID *** PAID *** PAID ***") && !AdValorem.Text.Contains("PERIOD")) { //if (AdValorem.Text.Contains("COMBINED TAXES & ASSESSMENTS TOTAL:")) //{ // break; //} string Output = AdValoremTD[0].Text; Output = Regex.Replace(Output, @"\s+", " ").TrimStart(); Output = Output.Replace(" ", "~"); string[] rowarrayname1 = Output.Split('~'); List <string> listname = new List <string>(); listname.AddRange(rowarrayname1); int count = listname.Count(); string name = "", millege = "", assessed = "", exemptions = "", taxable = "", taxes = ""; int k = 0; if (count == 2 && listname[0].Any(Char.IsDigit)) { Advalorem_details1 = "Total Millege" + "~" + listname[0] + "~" + "" + "~" + "" + "~" + "Total Ad Valorem Taxes" + "~" + listname[1]; gc.CreatePdf(orderNumber, ParcelID, "Ad-Valorem & Non-Ad Valorem Taxs Details" + Taxy, driver, "FL", "Marion"); gc.insert_date(orderNumber, ParcelID, 700, Advalorem_details1, 1, DateTime.Now); } else { for (int i = 0; i < count; i++) { if (!listname[i].Any(Char.IsDigit)) { name = name + " " + listname[i]; } else { if (listname[i].Any(Char.IsDigit) && (k == 0)) { millege = listname[i]; } if (listname[i].Any(Char.IsDigit) && (k == 1)) { assessed = listname[i]; } if (listname[i].Any(Char.IsDigit) && (k == 2)) { exemptions = listname[i]; } if (listname[i].Any(Char.IsDigit) && (k == 3)) { taxable = listname[i]; } if (listname[i].Any(Char.IsDigit) && (k == 4)) { taxes = listname[i]; } k++; } } } Advalorem_details = name + "~" + millege + "~" + assessed + "~" + exemptions + "~" + taxable + "~" + taxes; gc.CreatePdf(orderNumber, ParcelID, "Ad-Valorem & Non-Ad Valorem Taxs Details" + Taxy, driver, "FL", "Marion"); gc.insert_date(orderNumber, ParcelID, 700, Advalorem_details, 1, DateTime.Now); } } //Taxing Authority driver.Navigate().GoToUrl("https://www.mariontax.com/itm.asp"); Thread.Sleep(2000); Deliquent_Comments = ""; CER_Comments = ""; try { Taxing_Authority = driver.FindElement(By.XPath("//*[@id='ss-block-container-1']/div/address[2]")).Text.Replace("\r\n", " "); } catch { } if (Deliquent == "DELINQUENT TAXES DUE ") { Deliquent_Comments = "For prior tax amount due, you must call the tax Collector's Office."; } if (Roll_Coment == "CER") { CER_Comments = "Tax Sale in property. Need to contact Tax Collector"; } Taxauthority_Details = Taxing_Authority + "~" + Deliquent_Comments + "~" + CER_Comments; gc.CreatePdf(orderNumber, ParcelID, "Tax Authority", driver, "FL", "Marion"); gc.insert_date(orderNumber, ParcelID, 704, Taxauthority_Details, 1, DateTime.Now); TaxTime = DateTime.Now.ToString("HH:mm:ss"); LastEndTime = DateTime.Now.ToString("HH:mm:ss"); gc.insert_TakenTime(orderNumber, "FL", "Marion", StartTime, AssessmentTime, TaxTime, CitytaxTime, LastEndTime); driver.Quit(); gc.mergpdf(orderNumber, "FL", "Marion"); return("Data Inserted Successfully"); } catch (Exception ex) { driver.Quit(); GlobalClass.LogError(ex, orderNumber); throw; } } }
public string FTP_CASanBernardino(string houseno, string sname, string stype, string city, string parcelNumber, string searchType, string orderNumber, string ownername, 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()) { try { StartTime = DateTime.Now.ToString("HH:mm:ss"); if (searchType == "titleflex") { address = houseno + " " + sname + " " + stype + " " + unitno; gc.TitleFlexSearch(orderNumber, parcelNumber, "", address, "CA", "San Bernardino"); 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_CASanBernardino"] = "Zero"; driver.Quit(); return("No Data Found"); } parcelNumber = HttpContext.Current.Session["titleparcel"].ToString(); searchType = "parcel"; } if (searchType == "address") { driver.Navigate().GoToUrl("http://www.mytaxcollector.com/trSearch.aspx"); Thread.Sleep(2000); driver.FindElement(By.XPath("/html/body/table/tbody/tr[3]/td[3]/form/table/tbody/tr[1]/td[2]/nobr/input")).SendKeys(houseno); driver.FindElement(By.XPath("/html/body/table/tbody/tr[3]/td[3]/form/table/tbody/tr[2]/td[2]/nobr/input")).SendKeys(sname); gc.CreatePdf_WOP(orderNumber, "Address search", driver, "CA", "San Bernardino"); driver.FindElement(By.Id("ctl00_contentHolder_cmdSearch")).SendKeys(Keys.Enter); Thread.Sleep(3000); gc.CreatePdf_WOP(orderNumber, "Address search Result", driver, "CA", "San Bernardino"); try { IWebElement MultiAddressTB = driver.FindElement(By.XPath("/html/body/table/tbody/tr[3]/td[3]/div[1]/table/tbody")); IList <IWebElement> MultiAddressTR = MultiAddressTB.FindElements(By.TagName("tr")); IList <IWebElement> MultiAddressTD; gc.CreatePdf_WOP(orderNumber, "Multi Address search", driver, "CA", "San Bernardino"); int AddressmaxCheck = 0; if (MultiAddressTR.Count == 2) { driver.FindElement(By.XPath("/html/body/table/tbody/tr[3]/td[3]/div[1]/table/tbody/tr[2]/td[1]/a")).Click(); Thread.Sleep(2000); } else { foreach (IWebElement MultiAddress in MultiAddressTR) { if (AddressmaxCheck <= 25) { MultiAddressTD = MultiAddress.FindElements(By.TagName("td")); if (MultiAddressTD.Count != 0 && !MultiAddress.Text.Contains("Parcel Number")) { Parcelno = MultiAddressTD[0].Text; Address = MultiAddressTD[1].Text; MultiAddress_details = Address; gc.insert_date(orderNumber, Parcelno, 557, MultiAddress_details, 1, DateTime.Now); } AddressmaxCheck++; } } if (MultiAddressTR.Count > 25) { HttpContext.Current.Session["multiParcel_SanBernardino_Multicount"] = "Maximum"; } else { HttpContext.Current.Session["multiparcel_SanBernardino"] = "Yes"; } driver.Quit(); return("MultiParcel"); } } catch { } } if (searchType == "parcel") { driver.Navigate().GoToUrl("http://www.mytaxcollector.com/trSearch.aspx"); Thread.Sleep(2000); driver.FindElement(By.XPath("/html/body/table/tbody/tr[3]/td[3]/form/table/tbody/tr[6]/td[2]/input")).SendKeys(parcelNumber); gc.CreatePdf(orderNumber, parcelNumber, "ParcelSearch", driver, "CA", "San Bernardino"); driver.FindElement(By.Id("ctl00_contentHolder_cmdSearch")).SendKeys(Keys.Enter); Thread.Sleep(2000); } else if (searchType == "ownername") { driver.Navigate().GoToUrl("http://www.sbcounty.gov/assessor/pims/(S(fbwsp3kdg4b2bm5y5tgxd2r3))/PIMSINTERFACE.ASPX"); Thread.Sleep(2000); IWebElement iframeElementOwner = driver.FindElement(By.XPath("//*[@id='frameSearchResults']")); driver.SwitchTo().Frame(iframeElementOwner); Thread.Sleep(2000); driver.FindElement(By.Id("mnuPIMS_2")).Click(); Thread.Sleep(3000); driver.FindElement(By.Id("FormattedNameSearchInput1_txtLASTNAME")).SendKeys(ownername); driver.FindElement(By.Id("FormattedNameSearchInput1_btnStartNameSearch")).SendKeys(Keys.Enter); Thread.Sleep(4000); try { IWebElement MultiOwnerTB = driver.FindElement(By.XPath("//*[@id='G_UltraWebGridSearchResults']/tbody")); IList <IWebElement> MultiOwnerTR = MultiOwnerTB.FindElements(By.TagName("tr")); IList <IWebElement> MultiOwnerTD; gc.CreatePdf_WOP(orderNumber, "Multi Owner search", driver, "CA", "San Bernardino"); int maxCheck = 0; foreach (IWebElement MultiOwner in MultiOwnerTR) { if (maxCheck <= 25) { MultiOwnerTD = MultiOwner.FindElements(By.TagName("td")); if (MultiOwnerTD.Count != 0) { Parcelno = MultiOwnerTD[1].Text; Address = MultiOwnerTD[6].Text; MultiOwner_details = Address; gc.insert_date(orderNumber, Parcelno, 557, MultiOwner_details, 1, DateTime.Now); } maxCheck++; } } if (MultiOwnerTR.Count > 25) { HttpContext.Current.Session["multiParcel_SanBernardino_Multicount"] = "Maximum"; } else { HttpContext.Current.Session["multiparcel_SanBernardino"] = "Yes"; } driver.Quit(); return("MultiParcel"); } catch { } } try { Parcelno = driver.FindElement(By.XPath("/html/body/table/tbody/tr[3]/td[3]/table[1]/tbody/tr[2]/td")).Text; Parcelno = WebDriverTest.After(Parcelno, "Parcel ").Replace("-", ""); } catch { } //Property Details driver.Navigate().GoToUrl("http://www.sbcounty.gov/assessor/pims/(S(fbwsp3kdg4b2bm5y5tgxd2r3))/PIMSINTERFACE.ASPX"); Thread.Sleep(4000); IWebElement iframeElementAdd = driver.FindElement(By.XPath("//*[@id='frameSearchResults']")); driver.SwitchTo().Frame(iframeElementAdd); Thread.Sleep(2000); driver.FindElement(By.Id("mnuPIMS_1")).Click(); Thread.Sleep(3000); driver.FindElement(By.Id("ParcelInquiryInput1_txtParcelNbr")).SendKeys(Parcelno); driver.FindElement(By.Id("ParcelInquiryInput1_btnStartParcelInquiry")).SendKeys(Keys.Enter); Thread.Sleep(6000); driver.SwitchTo().DefaultContent(); IWebElement iframeElementAdd1 = driver.FindElement(By.XPath("//*[@id='frmset']/frame[2]")); driver.SwitchTo().Frame(iframeElementAdd1); Thread.Sleep(2000); IWebElement iframeElementAdd2 = driver.FindElement(By.XPath("//*[@id='RadPageViewPropInfo']/iframe")); driver.SwitchTo().Frame(iframeElementAdd2); Thread.Sleep(2000); try { Parcelno = driver.FindElement(By.XPath("//*[@id='spnPROPERTYINFO']/center[1]/table/tbody/tr[2]/td[1]")).Text; ownername1 = driver.FindElement(By.XPath("//*[@id='spnPROPERTYINFO']/div[1]/table/tbody/tr/td[3]/table/tbody/tr[2]/td[1]")).Text; Effective_Date = driver.FindElement(By.XPath("//*[@id='spnPROPERTYINFO']/div[1]/table/tbody/tr/td[3]/table/tbody/tr[2]/td[2]")).Text; ownername2 = driver.FindElement(By.XPath("//*[@id='spnPROPERTYINFO']/div[1]/table/tbody/tr/td[3]/table/tbody/tr[3]/td")).Text; Owner_Mailing_Address = ownername1 + ownername2; Legal_Description = driver.FindElement(By.XPath("//*[@id='spnPROPERTYINFO']/div[3]/textarea")).Text; Property_Details = Owner_Mailing_Address + "~" + Effective_Date + "~" + Legal_Description; gc.CreatePdf(orderNumber, Parcelno, "Property Details", driver, "CA", "San Bernardino"); gc.insert_date(orderNumber, Parcelno, 558, Property_Details, 1, DateTime.Now); } catch { } driver.SwitchTo().DefaultContent(); //Assessment Details IWebElement iframeElementAdd3 = driver.FindElement(By.XPath("//*[@id='frmset']/frame[2]")); driver.SwitchTo().Frame(iframeElementAdd3); Thread.Sleep(2000); driver.FindElement(By.XPath("//*[@id='RadTabStripMain']/div/ul/li[2]/a")).Click(); Thread.Sleep(2000); IWebElement iframeElementAdd4 = driver.FindElement(By.XPath("//*[@id='RadPageViewRollValuesHist']/iframe")); driver.SwitchTo().Frame(iframeElementAdd4); Thread.Sleep(4000); Land_Value = driver.FindElement(By.XPath("//*[@id='mainsect']/tbody/tr[8]/td[1]")).Text; Improvement_Value = driver.FindElement(By.XPath("//*[@id='mainsect']/tbody/tr[9]/td[1]")).Text; Improvement_Penalty = driver.FindElement(By.XPath("//*[@id='mainsect']/tbody/tr[10]/td[1]")).Text; PresProp_Value = driver.FindElement(By.XPath("//*[@id='mainsect']/tbody/tr[11]/td[1]")).Text; PresProp_Penalty = driver.FindElement(By.XPath("//*[@id='mainsect']/tbody/tr[12]/td[1]")).Text; Total_Penalties = driver.FindElement(By.XPath("//*[@id='mainsect']/tbody/tr[13]/td[1]")).Text; TotalAssessed_Value = driver.FindElement(By.XPath("//*[@id='mainsect']/tbody/tr[14]/td[1]")).Text; Homeowner_Exemption = driver.FindElement(By.XPath("//*[@id='mainsect']/tbody/tr[15]/td[1]")).Text; Special_Exemptions = driver.FindElement(By.XPath("//*[@id='mainsect']/tbody/tr[16]/td[1]")).Text; Net_Value = driver.FindElement(By.XPath("//*[@id='mainsect']/tbody/tr[17]/td[1]")).Text; Assessment_Details = Land_Value + "~" + Improvement_Value + "~" + Improvement_Penalty + "~" + PresProp_Value + "~" + PresProp_Penalty + "~" + Total_Penalties + "~" + TotalAssessed_Value + "~" + Homeowner_Exemption + "~" + Special_Exemptions + "~" + Net_Value; gc.CreatePdf(orderNumber, Parcelno, "Assessment Details", driver, "CA", "San Bernardino"); gc.insert_date(orderNumber, Parcelno, 559, Assessment_Details, 1, DateTime.Now); AssessmentTime = DateTime.Now.ToString("HH:mm:ss"); driver.Navigate().GoToUrl("http://www.mytaxcollector.com/trSearch.aspx"); Thread.Sleep(2000); driver.FindElement(By.XPath("/html/body/table/tbody/tr[3]/td[3]/form/table/tbody/tr[6]/td[2]/input")).SendKeys(Parcelno); driver.FindElement(By.Id("ctl00_contentHolder_cmdSearch")).SendKeys(Keys.Enter); Thread.Sleep(2000); driver.FindElement(By.XPath("//*[@id='ctl00_menuHolder_trLeftNav_LeftNavMenuControln9']/td/table/tbody/tr/td/a")).Click(); Thread.Sleep(2000); //Tax Payment History Details IWebElement PaymentTB = driver.FindElement(By.XPath("/html/body/table/tbody/tr[3]/td[3]/div[1]/table/tbody")); IList <IWebElement> PaymentTR = PaymentTB.FindElements(By.TagName("tr")); IList <IWebElement> PaymentTD; foreach (IWebElement Payment in PaymentTR) { PaymentTD = Payment.FindElements(By.TagName("td")); if (PaymentTD.Count != 0 && !Payment.Text.Contains("Bill Number")) { Bill_Number = PaymentTD[0].Text; Eff_Date = PaymentTD[1].Text; Extnd_Date = PaymentTD[2].Text; Correction = PaymentTD[3].Text; Remarks = PaymentTD[4].Text; Payment_details = Bill_Number + "~" + Eff_Date + "~" + Extnd_Date + "~" + Correction + "~" + Remarks; gc.CreatePdf(orderNumber, Parcelno, "Tax Paymnt Details", driver, "CA", "San Bernardino"); gc.insert_date(orderNumber, Parcelno, 560, Payment_details, 1, DateTime.Now); } } //Current Tax Details driver.FindElement(By.XPath("//*[@id='ctl00_menuHolder_trLeftNav_LeftNavMenuControln10']/td/table/tbody/tr/td/a")).Click(); Thread.Sleep(2000); List <string> secure = new List <string>(); List <string> Unsecure = new List <string>(); try { Bill_Type = driver.FindElement(By.XPath("/html/body/table/tbody/tr[3]/td[3]/form/div[1]/div")).Text; IWebElement Receipttable = driver.FindElement(By.XPath("/html/body/table/tbody/tr[3]/td[3]/form/div[1]/table[3]/tbody")); IList <IWebElement> ReceipttableRow = Receipttable.FindElements(By.TagName("tr")); IList <IWebElement> ReceipttableTD; foreach (IWebElement Receipt in ReceipttableRow) { ReceipttableTD = Receipt.FindElements(By.TagName("td")); if (ReceipttableTD.Count != 0 && Receipt.Text.Contains("Installment")) { IWebElement Bill_link = ReceipttableTD[0].FindElement(By.TagName("a")); url = Bill_link.GetAttribute("href"); secure.Add(url); } if (ReceipttableTD.Count != 0 && !Receipt.Text.Contains("Bill Number") && !Receipt.Text.Contains("Total:")) { Penalty = ReceipttableTD[2].Text; Cost = ReceipttableTD[3].Text; Inst_Del = ReceipttableTD[6].Text; CurrentTax_Details = Bill_Type + "~" + Penalty + "~" + Cost + "~" + Inst_Del + "~" + "-" + "~" + "-" + "~" + "-" + "~" + "-" + "~" + "-" + "~" + "-" + "~" + "-" + "~" + "-" + "~" + "-" + "~" + "-" + "~" + "-" + "~" + "-" + "~" + "-" + "~" + "-" + "~" + "-" + "~" + "-" + "~" + "-" + "~" + "-" + "~" + "-"; gc.CreatePdf(orderNumber, Parcelno, "Secured Tax Bills Details", driver, "CA", "San Bernardino"); gc.insert_date(orderNumber, Parcelno, 561, CurrentTax_Details, 1, DateTime.Now); } } //Deliquent taxes try { bill_type = driver.FindElement(By.XPath("/html/body/table/tbody/tr[3]/td[3]/form/div[2]/table[1]/tbody/tr/th/center/font/a")).Text; IWebElement Unsecuredtable = driver.FindElement(By.XPath("/html/body/table/tbody/tr[3]/td[3]/form/div[2]/table[2]/tbody")); IList <IWebElement> UnsecuredRow = Unsecuredtable.FindElements(By.TagName("tr")); IList <IWebElement> UnsecuredTD; foreach (IWebElement Unsecured in UnsecuredRow) { UnsecuredTD = Unsecured.FindElements(By.TagName("td")); if (UnsecuredTD.Count != 0 && Unsecured.Text.Contains("*")) { IWebElement UnBill_link = UnsecuredTD[0].FindElement(By.TagName("a")); Unurl = UnBill_link.GetAttribute("href"); Unsecure.Add(Unurl); } if (UnsecuredTD.Count != 0 && !Unsecured.Text.Contains("Bill Number") && !Unsecured.Text.Contains("Responsible Parties")) { Lien = UnsecuredTD[3].Text; Intrest = UnsecuredTD[5].Text; Unpenalty = UnsecuredTD[6].Text; Uncost = UnsecuredTD[7].Text; Redemption = UnsecuredTD[8].Text; UnCurrentTax_Details = bill_type + "~" + Lien + "~" + Intrest + "~" + Unpenalty + "~" + Uncost + "~" + Redemption + "~" + "-" + "~" + "-" + "~" + "-" + "~" + "-" + "~" + "-" + "~" + "-" + "~" + "-" + "~" + "-" + "~" + "-" + "~" + "-" + "~" + "-" + "~" + "-" + "~" + "-" + "~" + "-"; gc.CreatePdf(orderNumber, Parcelno, "UnSecured Tax Bills Details", driver, "CA", "San Bernardino"); gc.insert_date(orderNumber, Parcelno, 566, UnCurrentTax_Details, 1, DateTime.Now); } } } catch { } foreach (string bill in secure) { driver.Navigate().GoToUrl(bill); Thread.Sleep(3000); try { Billed_Owner = driver.FindElement(By.XPath("/html/body/table/tbody/tr[3]/td[3]/table[2]/tbody/tr[1]/td/table/tbody/tr[2]/td[2]")).Text; try { Co_Owner = driver.FindElement(By.XPath("/html/body/table/tbody/tr[3]/td[3]/table[2]/tbody/tr[1]/td/table/tbody/tr[3]/td[2]")).Text; } catch { } Default_date = driver.FindElement(By.XPath("/html/body/table/tbody/tr[3]/td[3]/table[2]/tbody/tr[3]/td/table/tbody/tr[1]/td[2]")).Text; Tax_Type = driver.FindElement(By.XPath("/html/body/table/tbody/tr[3]/td[3]/table[2]/tbody/tr[3]/td/table/tbody/tr[1]/td[3]")).Text; TaxBill_Number = driver.FindElement(By.XPath("/html/body/table/tbody/tr[3]/td[3]/table[2]/tbody/tr[3]/td/table/tbody/tr[2]/td[1]")).Text; Extend_date = driver.FindElement(By.XPath("/html/body/table/tbody/tr[3]/td[3]/table[2]/tbody/tr[3]/td/table/tbody/tr[2]/td[2]")).Text; Effective_date = driver.FindElement(By.XPath("/html/body/table/tbody/tr[3]/td[3]/table[2]/tbody/tr[3]/td/table/tbody/tr[2]/td[3]")).Text; Taxrate_Year = driver.FindElement(By.XPath("/html/body/table/tbody/tr[3]/td[3]/table[2]/tbody/tr[3]/td/table/tbody/tr[4]/td[3]")).Text; IWebElement valuetableElement = driver.FindElement(By.XPath("/html/body/table/tbody/tr[3]/td[3]/table[2]/tbody/tr[5]/td/table/tbody/tr/td[2]/table/tbody")); IList <IWebElement> valuetableRow = valuetableElement.FindElements(By.TagName("tr")); IList <IWebElement> valuerowTD; List <string> Installment1 = new List <string>(); List <string> Due_Amt1 = new List <string>(); List <string> Delq_Amt1 = new List <string>(); List <string> Due_Date1 = new List <string>(); List <string> Pmt_Posted1 = new List <string>(); List <string> Installment2 = new List <string>(); List <string> Due_Amt2 = new List <string>(); List <string> Delq_Amt2 = new List <string>(); List <string> Due_Date2 = new List <string>(); List <string> Total_Tax = new List <string>(); List <string> Pay_Status = new List <string>(); int j = 0; foreach (IWebElement row in valuetableRow) { valuerowTD = row.FindElements(By.TagName("td")); if (j == 0) { Installment1.Add(valuerowTD[0].Text); } else if (j == 1) { Due_Amt1.Add(valuerowTD[0].Text); } else if (j == 2) { Delq_Amt1.Add(valuerowTD[0].Text); } else if (j == 3) { Due_Date1.Add(valuerowTD[0].Text); } else if (j == 4) { Pmt_Posted1.Add(valuerowTD[0].Text); } else if (j == 5) { Installment2.Add(valuerowTD[0].Text); } else if (j == 6) { Due_Amt2.Add(valuerowTD[0].Text); } else if (j == 7) { Delq_Amt2.Add(valuerowTD[0].Text); } else if (j == 8) { Due_Date2.Add(valuerowTD[0].Text); } else if (j == 9) { Total_Tax.Add(valuerowTD[0].Text); } else if (j == 10) { Pay_Status.Add(valuerowTD[0].Text); } j++; } SecuredCurrentTax_Details = "-" + "~" + "-" + "~" + "-" + "~" + "-" + "~" + Billed_Owner + "~" + Co_Owner + "~" + Default_date + "~" + Tax_Type + "~" + TaxBill_Number + "~" + Extend_date + "~" + Effective_date + "~" + Taxrate_Year + "~" + Installment1[0] + "~" + Due_Amt1[0] + "~" + Delq_Amt1[0] + "~" + Due_Date1[0] + "~" + Pmt_Posted1[0] + "~" + Installment2[0] + "~" + Due_Amt2[0] + "~" + Delq_Amt2[0] + "~" + Due_Date2[0] + "~" + Total_Tax[0] + "~" + Pay_Status[0]; gc.CreatePdf(orderNumber, Parcelno, "Secured Bills Details", driver, "CA", "San Bernardino"); gc.insert_date(orderNumber, Parcelno, 561, SecuredCurrentTax_Details, 1, DateTime.Now); } catch { } } } catch { } try { foreach (string Unbill in Unsecure) { driver.Navigate().GoToUrl(Unbill); Thread.Sleep(3000); UnBilled_Owner = driver.FindElement(By.XPath("/html/body/table/tbody/tr[3]/td[3]/table[2]/tbody/tr[1]/td/table/tbody/tr[2]/td[2]")).Text; UnCo_Owner = driver.FindElement(By.XPath("/html/body/table/tbody/tr[3]/td[3]/table[2]/tbody/tr[1]/td/table/tbody/tr[3]/td[2]")).Text; UnDefault_Date = driver.FindElement(By.XPath("/html/body/table/tbody/tr[3]/td[3]/table[2]/tbody/tr[3]/td/table/tbody/tr[1]/td[2]")).Text; UnTax_Type = driver.FindElement(By.XPath("/html/body/table/tbody/tr[3]/td[3]/table[2]/tbody/tr[3]/td/table/tbody/tr[1]/td[3]")).Text; UnBill_Number = driver.FindElement(By.XPath("/html/body/table/tbody/tr[3]/td[3]/table[2]/tbody/tr[3]/td/table/tbody/tr[2]/td[1]")).Text; UnExtended_Date = driver.FindElement(By.XPath("/html/body/table/tbody/tr[3]/td[3]/table[2]/tbody/tr[3]/td/table/tbody/tr[2]/td[2]")).Text; UnEffective_Owner = driver.FindElement(By.XPath("/html/body/table/tbody/tr[3]/td[3]/table[2]/tbody/tr[3]/td/table/tbody/tr[2]/td[3]")).Text; UnTaxrate_Year = driver.FindElement(By.XPath("/html/body/table/tbody/tr[3]/td[3]/table[2]/tbody/tr[3]/td/table/tbody/tr[4]/td[3]")).Text; IWebElement UnvaluetableElement = driver.FindElement(By.XPath("/html/body/table/tbody/tr[3]/td[3]/table[2]/tbody/tr[5]/td/table/tbody/tr/td[2]/table/tbody")); IList <IWebElement> UnvaluetableRow = UnvaluetableElement.FindElements(By.TagName("tr")); IList <IWebElement> UnvaluerowTD; List <string> UnInstallment = new List <string>(); List <string> UnDue_Amt = new List <string>(); List <string> UnDelq_Amt = new List <string>(); List <string> UnDue_Date = new List <string>(); List <string> UnTotal_Tax = new List <string>(); List <string> UnPay_Status = new List <string>(); int K = 0; foreach (IWebElement Unrow in UnvaluetableRow) { UnvaluerowTD = Unrow.FindElements(By.TagName("td")); if (K == 0) { UnInstallment.Add(UnvaluerowTD[0].Text); } else if (K == 1) { UnDue_Amt.Add(UnvaluerowTD[0].Text); } else if (K == 2) { UnDelq_Amt.Add(UnvaluerowTD[0].Text); } else if (K == 3) { UnDue_Date.Add(UnvaluerowTD[0].Text); } else if (K == 4) { UnTotal_Tax.Add(UnvaluerowTD[0].Text); } else if (K == 5) { UnPay_Status.Add(UnvaluerowTD[0].Text); } K++; } UnSecuredCurrentTax_Details = "-" + "~" + "-" + "~" + "-" + "~" + "-" + "~" + "-" + "~" + "-" + "~" + UnBilled_Owner + "~" + UnCo_Owner + "~" + UnDefault_Date + "~" + UnTax_Type + "~" + UnBill_Number + "~" + UnExtended_Date + "~" + UnEffective_Owner + "~" + UnTaxrate_Year + "~" + UnInstallment[0] + "~" + UnDue_Amt[0] + "~" + UnDelq_Amt[0] + "~" + UnDue_Date[0] + "~" + UnTotal_Tax[0] + "~" + UnPay_Status[0]; gc.CreatePdf(orderNumber, Parcelno, "UnSecured Bills Details", driver, "CA", "San Bernardino"); gc.insert_date(orderNumber, Parcelno, 566, UnSecuredCurrentTax_Details, 1, DateTime.Now); } } catch { } TaxTime = DateTime.Now.ToString("HH:mm:ss"); LastEndTime = DateTime.Now.ToString("HH:mm:ss"); gc.insert_TakenTime(orderNumber, "CA", "San Bernardino", StartTime, AssessmentTime, TaxTime, CitytaxTime, LastEndTime); driver.Quit(); gc.mergpdf(orderNumber, "CA", "San Bernardino"); return("Data Inserted Successfully"); } catch (Exception ex) { driver.Quit(); GlobalClass.LogError(ex, orderNumber); throw ex; } } }
public string FTP_FLFlagler(string address, string assessment_id, string parcelNumber, string searchType, string orderNumber, string directParcel, string ownername) { string Parcelno = "", Owner = "", Property_Address = "", City = "", MultiOwner_details = "", MultiAddress_details = ""; string Par = "", Parcel_ID = "", Loc = "", Location = "", Lg_Des = "", Legal = "", Pro_Code = "", Property_Code = "", Distr = "", Property_District = "", Mi_Rate = "", Pro_Milagerate = "", Acres = "", Acreage = "", PRo_Home = "", Homestead = "", Pro_Owner = "", Pro_MilingAddreess = "", Pro_YearBuilt = "", property = ""; string Assemnt_Details1 = "", Assemnt_Details2 = "", Assemnt_Details3 = "", Assemnt_Details4 = "", Year1 = "", Year2 = "", Year3 = "", Year4 = "", currenttax = "", curtax = "", prior_total = "", priortotlinsert = "", taxhis = "", Url = "", tax_authority = "", Tax_Sale = "", tax_sales = "", taxhistoryownername = ""; string exempt = "", exempt_amount = "", EscrowCode = "", milage_code = "", taxhistoryPayid = "", tax_type = "", tax_years = "", valoremtotal = "", total_milage = "", total_Asstax = "", valoremtax = "", nonvaloremtax = "", total_ass = "", Total_taxes = "", valoremtotalass = "", valoremtotaltax = "", curtaxhis = "", date_paid = "", Transaction = "", Receipt = "", Amount_Paid = "", Item = ""; GlobalClass.global_orderNo = orderNumber; HttpContext.Current.Session["orderNo"] = orderNumber; GlobalClass.global_parcelNo = parcelNumber; string StartTime = "", AssessmentTime = "", TaxTime = "", CitytaxTime = "", LastEndTime = ""; var driverService = PhantomJSDriverService.CreateDefaultService(); driverService.HideCommandPromptWindow = true; //driver = new PhantomJSDriver(); //driver = new ChromeDriver(); using (driver = new PhantomJSDriver()) { try { StartTime = DateTime.Now.ToString("HH:mm:ss"); if (searchType == "titleflex") { string titleaddress = address; gc.TitleFlexSearch(orderNumber, "", "", titleaddress, "FL", "Flagler"); if ((HttpContext.Current.Session["TitleFlex_Search"] != null && HttpContext.Current.Session["TitleFlex_Search"].ToString() == "Yes")) { driver.Quit(); return("MultiParcel"); } else if (HttpContext.Current.Session["titleparcel"].ToString() == "") { HttpContext.Current.Session["Nodata_FLFlagler"] = "Yes"; driver.Quit(); return("No Data Found"); } parcelNumber = HttpContext.Current.Session["titleparcel"].ToString(); searchType = "parcel"; } if (searchType == "address") { driver.Navigate().GoToUrl("https://qpublic.schneidercorp.com/Application.aspx?App=FlaglerCountyFL&Layer=Parcels&PageType=Search"); Thread.Sleep(5000); try { driver.FindElement(By.XPath("//*[@id='appBody']/div[4]/div/div/div[3]/a[1]")).Click(); Thread.Sleep(2000); } catch { } driver.FindElement(By.Id("ctlBodyPane_ctl00_ctl01_txtAddress")).SendKeys(address); gc.CreatePdf_WOP(orderNumber, "Address search", driver, "FL", "Flagler"); driver.FindElement(By.Id("ctlBodyPane_ctl00_ctl01_btnSearch")).SendKeys(Keys.Enter); Thread.Sleep(2000); try { IWebElement MultiAddressTB = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl00_ctl01_gvwParcelResults']/tbody")); IList <IWebElement> MultiAddressTR = MultiAddressTB.FindElements(By.TagName("tr")); IList <IWebElement> MultiAddressTD; gc.CreatePdf_WOP(orderNumber, "Multi Address search", driver, "FL", "Flagler"); int AddressmaxCheck = 0; foreach (IWebElement MultiAddress in MultiAddressTR) { if (AddressmaxCheck <= 25) { MultiAddressTD = MultiAddress.FindElements(By.TagName("td")); if (MultiAddressTD.Count != 0) { Parcelno = MultiAddressTD[2].Text; Owner = MultiAddressTD[3].Text; Property_Address = MultiAddressTD[4].Text; City = MultiAddressTD[5].Text; MultiAddress_details = Owner + "~" + Property_Address + "~" + City; gc.insert_date(orderNumber, Parcelno, 1289, MultiAddress_details, 1, DateTime.Now); } AddressmaxCheck++; } } if (MultiAddressTR.Count > 25) { HttpContext.Current.Session["multiParcel_FLFlagler_Multicount"] = "Maximum"; } else { HttpContext.Current.Session["multiparcel_FLFlagler"] = "Yes"; } driver.Quit(); return("MultiParcel"); } catch { } try { string nodata = driver.FindElement(By.Id("ctlBodyPane_noDataList_pnlNoResults")).Text; if (nodata.Contains("No results")) { HttpContext.Current.Session["Nodata_FLFlagler"] = "Yes"; driver.Quit(); return("No Data Found"); } } catch { } } if (searchType == "parcel") { driver.Navigate().GoToUrl("https://qpublic.schneidercorp.com/Application.aspx?App=FlaglerCountyFL&Layer=Parcels&PageType=Search"); Thread.Sleep(2000); try { driver.FindElement(By.XPath("//*[@id='appBody']/div[4]/div/div/div[3]/a[1]")).Click(); Thread.Sleep(2000); } catch { } driver.FindElement(By.Id("ctlBodyPane_ctl02_ctl01_txtParcelID")).SendKeys(parcelNumber); gc.CreatePdf(orderNumber, parcelNumber, "ParcelSearch", driver, "FL", "Flagler"); driver.FindElement(By.Id("ctlBodyPane_ctl02_ctl01_btnSearch")).SendKeys(Keys.Enter); Thread.Sleep(2000); } if (searchType == "ownername") { driver.Navigate().GoToUrl("https://qpublic.schneidercorp.com/Application.aspx?App=FlaglerCountyFL&Layer=Parcels&PageType=Search"); Thread.Sleep(2000); try { driver.FindElement(By.XPath("//*[@id='appBody']/div[4]/div/div/div[3]/a[1]")).Click(); Thread.Sleep(2000); } catch { } driver.FindElement(By.Id("ctlBodyPane_ctl01_ctl01_txtName")).SendKeys(ownername); gc.CreatePdf_WOP(orderNumber, "Owner search", driver, "FL", "Flagler"); driver.FindElement(By.Id("ctlBodyPane_ctl01_ctl01_btnSearch")).SendKeys(Keys.Enter); Thread.Sleep(2000); try { IWebElement MultiOwnerTB = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl00_ctl01_gvwParcelResults']/tbody")); IList <IWebElement> MultiOwnerTR = MultiOwnerTB.FindElements(By.TagName("tr")); IList <IWebElement> MultiOwnerTD; gc.CreatePdf_WOP(orderNumber, "Multi Owner search", driver, "FL", "Flagler"); int OwnermaxCheck = 0; foreach (IWebElement MultiOwner in MultiOwnerTR) { if (OwnermaxCheck <= 25) { MultiOwnerTD = MultiOwner.FindElements(By.TagName("td")); if (MultiOwnerTD.Count != 0) { Parcelno = MultiOwnerTD[2].Text; Owner = MultiOwnerTD[3].Text; Property_Address = MultiOwnerTD[4].Text; City = MultiOwnerTD[5].Text; MultiOwner_details = Owner + "~" + Property_Address + "~" + City; gc.insert_date(orderNumber, Parcelno, 1289, MultiOwner_details, 1, DateTime.Now); } OwnermaxCheck++; } } if (MultiOwnerTR.Count > 25) { HttpContext.Current.Session["multiParcel_FLFlagler_Multicount"] = "Maximum"; } else { HttpContext.Current.Session["multiparcel_FLFlagler"] = "Yes"; } driver.Quit(); return("MultiParcel"); } catch { } } try { IWebElement Inodata = driver.FindElement(By.Id("ctlBodyPane_noDataList_pnlNoResults")); if (Inodata.Text.Contains("No results match")) { HttpContext.Current.Session["Nodata_FLFlagler"] = "Yes"; driver.Quit(); return("No Data Found"); } } catch { } //Property Details IWebElement PropertyTB = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl01_mSection']/div/table/tbody")); IList <IWebElement> PropertyTR = PropertyTB.FindElements(By.TagName("tr")); IList <IWebElement> PropertyTD; foreach (IWebElement Property in PropertyTR) { PropertyTD = Property.FindElements(By.TagName("td")); if (PropertyTD.Count != 0) { Par = PropertyTD[0].Text; if (Par.Contains("Parcel ID")) { Parcel_ID = PropertyTD[1].Text; } Loc = PropertyTD[0].Text; if (Loc.Contains("Location Address")) { Location = PropertyTD[1].Text; } Lg_Des = PropertyTD[0].Text; if (Lg_Des.Contains("Brief Tax Description*")) { Legal = PropertyTD[1].Text; } Pro_Code = PropertyTD[0].Text; if (Pro_Code.Contains("Property Use Code")) { Property_Code = PropertyTD[1].Text; } Distr = PropertyTD[0].Text; if (Distr.Contains("Tax District")) { Property_District = PropertyTD[1].Text; } Mi_Rate = PropertyTD[0].Text; if (Mi_Rate.Contains("Millage Rate")) { Pro_Milagerate = PropertyTD[1].Text; } Acres = PropertyTD[0].Text; if (Acres.Contains("Acreage")) { Acreage = PropertyTD[1].Text; } PRo_Home = PropertyTD[0].Text; if (PRo_Home.Contains("Homestead")) { Homestead = PropertyTD[1].Text; } } } try { Pro_Owner = driver.FindElement(By.Id("ctlBodyPane_ctl00_ctl01_lstPrimaryOwner_ctl00_lblPrimaryOwnerName_lblSearch")).Text; Pro_MilingAddreess = driver.FindElement(By.Id("ctlBodyPane_ctl00_ctl01_lstPrimaryOwner_ctl00_lblPrimaryOwnerAddress")).Text; Pro_YearBuilt = driver.FindElement(By.Id("ctlBodyPane_ctl08_ctl01_lstBuildings_ctl00_Label1")).Text; } catch { } property = Location + "~" + Legal + "~" + Pro_Owner + "~" + Property_Code + "~" + Property_District + "~" + Pro_Milagerate + "~" + Acreage + "~" + Homestead + "~" + Pro_MilingAddreess + "~" + Pro_YearBuilt; gc.CreatePdf(orderNumber, Parcel_ID, "Property Details", driver, "FL", "Flagler"); gc.insert_date(orderNumber, Parcel_ID, 1290, property, 1, DateTime.Now); //Assessment Details //*[@id="ctlBodyPane_ctl02_ctl01_grdValuation"]/thead IWebElement AssmThTb = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl02_ctl01_grdValuation']/thead")); IList <IWebElement> AssmThTr = AssmThTb.FindElements(By.TagName("tr")); IList <IWebElement> AssmTh; foreach (IWebElement Assm in AssmThTr) { AssmTh = Assm.FindElements(By.TagName("th")); if (AssmTh.Count != 0) { Year1 = AssmTh[0].Text; Year2 = AssmTh[1].Text; Year3 = AssmTh[2].Text; Year4 = AssmTh[3].Text; } } IWebElement AssmTb = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl02_ctl01_grdValuation']/tbody")); IList <IWebElement> AssmTr = AssmTb.FindElements(By.TagName("tr")); IList <IWebElement> AssmTd; int j = 0; List <string> Building_Value = new List <string>(); List <string> Extra_Feature_Value = new List <string>(); List <string> Land_Value = new List <string>(); List <string> Land_Agricultural_Value = new List <string>(); List <string> Agricultural_Value = new List <string>(); List <string> Just_Value = new List <string>(); List <string> Assessed_Value = new List <string>(); List <string> Exempt_Value = new List <string>(); List <string> Taxable_Value = new List <string>(); List <string> Protected_Value = new List <string>(); foreach (IWebElement Assmrow in AssmTr) { AssmTd = Assmrow.FindElements(By.TagName("td")); if (AssmTd.Count != 0) { if (j == 0) { Building_Value.Add(AssmTd[1].Text); Building_Value.Add(AssmTd[2].Text); Building_Value.Add(AssmTd[3].Text); Building_Value.Add(AssmTd[4].Text); } else if (j == 1) { Extra_Feature_Value.Add(AssmTd[1].Text); Extra_Feature_Value.Add(AssmTd[2].Text); Extra_Feature_Value.Add(AssmTd[3].Text); Extra_Feature_Value.Add(AssmTd[4].Text); } else if (j == 2) { Land_Value.Add(AssmTd[1].Text); Land_Value.Add(AssmTd[2].Text); Land_Value.Add(AssmTd[3].Text); Land_Value.Add(AssmTd[4].Text); } else if (j == 3) { Land_Agricultural_Value.Add(AssmTd[1].Text); Land_Agricultural_Value.Add(AssmTd[2].Text); Land_Agricultural_Value.Add(AssmTd[3].Text); Land_Agricultural_Value.Add(AssmTd[4].Text); } else if (j == 4) { Agricultural_Value.Add(AssmTd[1].Text); Agricultural_Value.Add(AssmTd[2].Text); Agricultural_Value.Add(AssmTd[3].Text); Agricultural_Value.Add(AssmTd[4].Text); } else if (j == 5) { Just_Value.Add(AssmTd[1].Text); Just_Value.Add(AssmTd[2].Text); Just_Value.Add(AssmTd[3].Text); Just_Value.Add(AssmTd[4].Text); } else if (j == 6) { Assessed_Value.Add(AssmTd[1].Text); Assessed_Value.Add(AssmTd[2].Text); Assessed_Value.Add(AssmTd[3].Text); Assessed_Value.Add(AssmTd[4].Text); } else if (j == 7) { Exempt_Value.Add(AssmTd[1].Text); Exempt_Value.Add(AssmTd[2].Text); Exempt_Value.Add(AssmTd[3].Text); Exempt_Value.Add(AssmTd[4].Text); } else if (j == 8) { Taxable_Value.Add(AssmTd[1].Text); Taxable_Value.Add(AssmTd[2].Text); Taxable_Value.Add(AssmTd[3].Text); Taxable_Value.Add(AssmTd[4].Text); } else if (j == 9) { Protected_Value.Add(AssmTd[1].Text); Protected_Value.Add(AssmTd[2].Text); Protected_Value.Add(AssmTd[3].Text); Protected_Value.Add(AssmTd[4].Text); } j++; } } Assemnt_Details1 = Year1 + "~" + Building_Value[0] + "~" + Extra_Feature_Value[0] + "~" + Land_Value[0] + "~" + Land_Agricultural_Value[0] + "~" + Agricultural_Value[0] + "~" + Just_Value[0] + "~" + Assessed_Value[0] + "~" + Exempt_Value[0] + "~" + Taxable_Value[0] + "~" + Protected_Value[0]; Assemnt_Details2 = Year2 + "~" + Building_Value[1] + "~" + Extra_Feature_Value[1] + "~" + Land_Value[1] + "~" + Land_Agricultural_Value[1] + "~" + Agricultural_Value[1] + "~" + Just_Value[1] + "~" + Assessed_Value[1] + "~" + Exempt_Value[1] + "~" + Taxable_Value[1] + "~" + Protected_Value[1]; Assemnt_Details3 = Year3 + "~" + Building_Value[2] + "~" + Extra_Feature_Value[2] + "~" + Land_Value[2] + "~" + Land_Agricultural_Value[2] + "~" + Agricultural_Value[2] + "~" + Just_Value[2] + "~" + Assessed_Value[2] + "~" + Exempt_Value[2] + "~" + Taxable_Value[2] + "~" + Protected_Value[2]; Assemnt_Details4 = Year4 + "~" + Building_Value[3] + "~" + Extra_Feature_Value[3] + "~" + Land_Value[3] + "~" + Land_Agricultural_Value[3] + "~" + Agricultural_Value[3] + "~" + Just_Value[3] + "~" + Assessed_Value[3] + "~" + Exempt_Value[3] + "~" + Taxable_Value[3] + "~" + Protected_Value[3]; gc.insert_date(orderNumber, Parcel_ID, 1291, Assemnt_Details1, 1, DateTime.Now); gc.insert_date(orderNumber, Parcel_ID, 1291, Assemnt_Details2, 1, DateTime.Now); gc.insert_date(orderNumber, Parcel_ID, 1291, Assemnt_Details3, 1, DateTime.Now); gc.insert_date(orderNumber, Parcel_ID, 1291, Assemnt_Details4, 1, DateTime.Now); AssessmentTime = DateTime.Now.ToString("HH:mm:ss"); //Tax Details driver.Navigate().GoToUrl("http://fl-flagler-taxcollector.governmax.com/collectmax/collect30.asp"); Thread.Sleep(5000); IWebElement iframeElement = driver.FindElement(By.XPath("/html/frameset/frame")); driver.SwitchTo().Frame(iframeElement); IWebElement img = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table/tbody/tr/td/table/tbody/tr[4]/td/center")).FindElement(By.TagName("a")); string imghref = img.GetAttribute("href"); driver.Navigate().GoToUrl(imghref); // img.SendKeys(Keys.Enter); Thread.Sleep(5000); // /html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table/tbody/tr/td/table/tbody/tr[1]/td/table/tbody/tr/td/table/tbody/tr[2]/td/font/input //driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table/tbody/tr/td/table/tbody/tr[4]/td/center/a")).SendKeys(Keys.Enter); // Thread.Sleep(5000); driver.FindElement(By.Name("account")).SendKeys(Parcel_ID); gc.CreatePdf(orderNumber, Parcel_ID, "TaxPage Input Passed", driver, "FL", "Flagler"); driver.FindElement(By.Name("go")).SendKeys(Keys.Enter); Thread.Sleep(5000); gc.CreatePdf(orderNumber, Parcel_ID, "Tax Deails", driver, "FL", "Flagler"); try { exempt = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table[3]/tbody/tr[6]/td/table/tbody/tr/td/table/tbody/tr[2]/td[1]/font")).Text.Trim(); } catch { } try { IWebElement exemtable = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table[3]/tbody/tr[6]/td/table/tbody/tr/td/table/tbody/tr[2]/td[1]/table/tbody")); IList <IWebElement> exemtableRow = exemtable.FindElements(By.TagName("tr")); int exemtablecount = exemtableRow.Count; IList <IWebElement> exemtablerowTD; int a = 0; foreach (IWebElement rowid in exemtableRow) { exemtablerowTD = rowid.FindElements(By.TagName("td")); if (exemtablerowTD.Count != 0 && !rowid.Text.Contains("Taxing Authority")) { if (a == 0) { exempt = exemtablerowTD[0].Text; exempt_amount = exemtablerowTD[1].Text; } else if (a == 1) { exempt += ","; exempt += exemtablerowTD[0].Text; exempt_amount += ","; exempt_amount += exemtablerowTD[1].Text; } a++; } } } catch { } try { milage_code = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table[3]/tbody/tr[6]/td/table/tbody/tr/td/table/tbody/tr[2]/td[2]/font")).Text.Trim(); tax_type = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table[3]/tbody/tr[2]/td[2]/font/b")).Text.Trim(); tax_years = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table[3]/tbody/tr[2]/td[3]/font/b")).Text.Trim(); EscrowCode = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table[3]/tbody/tr[6]/td/table/tbody/tr/td/table/tbody/tr[2]/td[3]/font")).Text; } catch { } //valorem Details try { IWebElement valoremtable = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table[3]/tbody/tr[8]/td/table[1]/tbody")); IList <IWebElement> valoremtableRow = valoremtable.FindElements(By.TagName("tr")); int valoremtablerowcount = valoremtableRow.Count; IList <IWebElement> valoremtablerowTD; foreach (IWebElement rowid in valoremtableRow) { valoremtablerowTD = rowid.FindElements(By.TagName("td")); if (valoremtablerowTD.Count != 0 && !rowid.Text.Contains("Taxing Authority")) { if (valoremtablerowTD.Count == 6) { valoremtax = valoremtablerowTD[0].Text + "~" + "" + "~" + "Ad Valorem Taxes" + "~" + valoremtablerowTD[1].Text + "~" + valoremtablerowTD[2].Text + "~" + valoremtablerowTD[3].Text + "~" + valoremtablerowTD[4].Text + "~" + valoremtablerowTD[5].Text; gc.insert_date(orderNumber, Parcel_ID, 1297, valoremtax, 1, DateTime.Now); } else if (valoremtablerowTD.Count == 2) { valoremtax = valoremtablerowTD[0].Text + "~" + "" + "~" + "Ad Valorem Taxes" + "~" + "" + "~" + "" + "~" + "" + "~" + "" + "~" + ""; gc.insert_date(orderNumber, Parcel_ID, 1297, valoremtax, 1, DateTime.Now); } } } total_milage = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table[3]/tbody/tr[8]/td/table[2]/tbody/tr/td[2]/font")).Text.Trim(); total_Asstax = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table[3]/tbody/tr[8]/td/table[2]/tbody/tr/td[4]/font")).Text.Trim(); valoremtotal = "Total" + "~" + "" + "~" + "Ad Valorem Taxes" + "~" + total_milage + "~" + " " + "~" + " " + "~" + " " + "~" + total_Asstax; gc.insert_date(orderNumber, Parcel_ID, 1297, valoremtotal, 1, DateTime.Now); } catch { } try { IWebElement nonvaloremtable = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table[3]/tbody/tr[10]/td/table[1]/tbody")); IList <IWebElement> nonvaloremtableRow = nonvaloremtable.FindElements(By.TagName("tr")); int nonvaloremtablerowcount = nonvaloremtableRow.Count; IList <IWebElement> nonvaloremtablerowTD; foreach (IWebElement rowid in nonvaloremtableRow) { nonvaloremtablerowTD = rowid.FindElements(By.TagName("td")); if (nonvaloremtablerowTD.Count != 0 && !rowid.Text.Contains("Levying Authority") && !rowid.Text.Trim().Contains("")) { nonvaloremtax = ""; try { nonvaloremtax = nonvaloremtablerowTD[1].Text + "~" + nonvaloremtablerowTD[0].Text + "~" + "Non-Ad Valorem Taxes" + "~" + "" + "~" + "" + "~" + "" + "~" + "" + "~" + nonvaloremtablerowTD[2].Text; gc.insert_date(orderNumber, Parcel_ID, 1297, nonvaloremtax, 1, DateTime.Now); } catch { } } } total_ass = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table[3]/tbody/tr[10]/td/table[2]/tbody/tr/td[2]/font")).Text.Trim(); Total_taxes = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table[3]/tbody/tr[11]/td/table/tbody/tr/td[4]/font")).Text.Trim(); valoremtotalass = "Total" + "~" + "" + "~" + "Total Assessments" + "~" + "" + "~" + " " + "~" + " " + "~" + " " + "~" + total_ass; gc.insert_date(orderNumber, Parcel_ID, 1297, valoremtotalass, 1, DateTime.Now); valoremtotaltax = "Total" + "~" + "" + "~" + "Taxes & Assessments" + "~" + "" + "~" + " " + "~" + " " + "~" + " " + "~" + Total_taxes; gc.insert_date(orderNumber, Parcel_ID, 1297, valoremtotaltax, 1, DateTime.Now); } catch { } //Tax Due try { IWebElement taxduetable = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table[4]/tbody/tr/td/table/tbody")); IList <IWebElement> taxduetableRow = taxduetable.FindElements(By.TagName("tr")); int taxduerowcount = taxduetableRow.Count; IList <IWebElement> taxduetablerowTD; foreach (IWebElement rowid in taxduetableRow) { taxduetablerowTD = rowid.FindElements(By.TagName("td")); if (taxduetablerowTD.Count != 0 && !rowid.Text.Contains("If Paid By")) { try { curtax = taxduetablerowTD[0].Text + "~" + taxduetablerowTD[1].Text; gc.insert_date(orderNumber, Parcel_ID, 1298, curtax, 1, DateTime.Now); } catch { } } } } catch { } //curtaxhistory try { IWebElement taxpaidtable = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table[5]")); IList <IWebElement> taxpaidtableRow = taxpaidtable.FindElements(By.TagName("tr")); int taxpaidrowcount = taxpaidtableRow.Count; IList <IWebElement> taxduetablerowTD; foreach (IWebElement rowid in taxpaidtableRow) { taxduetablerowTD = rowid.FindElements(By.TagName("td")); if (taxduetablerowTD.Count != 0 && !rowid.Text.Contains("Date Paid")) { try { date_paid = taxduetablerowTD[0].Text; Transaction = taxduetablerowTD[1].Text; Receipt = taxduetablerowTD[2].Text; Item = taxduetablerowTD[3].Text; Amount_Paid = taxduetablerowTD[4].Text; //currenttax = "" + "~" + "" + "~" + "" + "~" + "" + "~" + Item + "~" + "" + "~" + Amount_Paid + "~" + date_paid + "~" + "" + "~" + Receipt + "~" + "" + "~" + Transaction + "~" + ""; //gc.insert_date(orderNumber, Parcel_ID, 1299, currenttax, 1, DateTime.Now); } catch { } } } } catch { } //prior year tax try { IWebElement priortaxtable = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table[6]/tbody/tr[2]/td/table[1]/tbody")); IList <IWebElement> priortaxtableRow = priortaxtable.FindElements(By.TagName("tr")); int priorrowcount = priortaxtableRow.Count; IList <IWebElement> priortaxtablerowTD; foreach (IWebElement rowid in priortaxtableRow) { priortaxtablerowTD = rowid.FindElements(By.TagName("td")); if (priortaxtablerowTD.Count != 0 && !rowid.Text.Contains("Year")) { try { curtax = priortaxtablerowTD[0].Text + "~" + priortaxtablerowTD[1].Text + "~" + priortaxtablerowTD[2].Text + "~" + priortaxtablerowTD[3].Text + "~" + priortaxtablerowTD[4].Text + "~" + priortaxtablerowTD[5].Text; gc.insert_date(orderNumber, Parcel_ID, 1300, curtax, 1, DateTime.Now); } catch { } } } } catch { } try { prior_total = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table[6]/tbody/tr[2]/td/table[3]/tbody/tr/td[2]")).Text.Trim(); priortotlinsert = "Prior Years Total " + "~" + "" + "~" + "" + "~" + "" + "~" + "" + "~" + prior_total; gc.insert_date(orderNumber, Parcel_ID, 1300, priortotlinsert, 1, DateTime.Now); IWebElement priortaxdettable = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table[7]/tbody")); IList <IWebElement> priortaxdettableRow = priortaxdettable.FindElements(By.TagName("tr")); int priortaxdettablecount = priortaxdettableRow.Count; IList <IWebElement> priortaxdettablerowTD; foreach (IWebElement rowid in priortaxdettableRow) { priortaxdettablerowTD = rowid.FindElements(By.TagName("td")); if (priortaxdettablerowTD.Count != 0 && !rowid.Text.Contains("If Paid By")) { try { curtax = priortaxdettablerowTD[0].Text + "~" + "Delinquent" + "~" + priortaxdettablerowTD[1].Text; gc.insert_date(orderNumber, Parcel_ID, 1298, curtax, 1, DateTime.Now); } catch { } } } } catch { } //Tax Sale try { tax_sales = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table[4]/tbody/tr/td")).Text; tax_sales = WebDriverTest.Between(tax_sales, "Please contact the ", " at (386)"); if (tax_sales == "Tax Department") { Tax_Sale = "Due to the status code assigned to this account, the remaining detail is blocked from viewing. Please contact the Tax Department at (386) 313-4160 for further information regarding this account."; gc.insert_date(orderNumber, Parcel_ID, 1372, Tax_Sale, 1, DateTime.Now); } } catch { } //Tax History Details try { try { driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table[6]/tbody/tr/td/font/a")).SendKeys(Keys.Enter); Thread.Sleep(2000); } catch { } try { driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table[5]/tbody/tr/td/font/a")).SendKeys(Keys.Enter); } catch { } Thread.Sleep(7000); gc.CreatePdf(orderNumber, Parcel_ID, "Tax History Deails", driver, "FL", "Flagler"); IWebElement tablelist = driver.FindElement(By.XPath("html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table/tbody/tr/td")); IList <IWebElement> tablelists = tablelist.FindElements(By.TagName("table")); int tablecount = tablelists.Count; int k = 3; for (k = 3; k < tablecount - 1; k++) { IWebElement taxhistorytable = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[2]/td[2]/table/tbody/tr/td/table/tbody/tr/td/table[" + k + "]/tbody")); IList <IWebElement> taxhistorytableRow = taxhistorytable.FindElements(By.TagName("tr")); int taxhistorytablecount = taxhistorytableRow.Count; IList <IWebElement> taxhistorytablerowTD; foreach (IWebElement rowid1 in taxhistorytableRow) { taxhistorytablerowTD = rowid1.FindElements(By.TagName("td")); if (k == 3) { if (taxhistorytablerowTD.Count != 0 && !rowid1.Text.Contains("Payment History") && !rowid1.Text.Contains("Year") && taxhistorytableRow.Count == 4) { if (taxhistorytablerowTD.Count == 6) { taxhis = taxhistorytablerowTD[0].Text + "~" + taxhistorytablerowTD[1].Text + "~" + taxhistorytablerowTD[2].Text + "~" + taxhistorytablerowTD[3].Text + "~" + taxhistorytablerowTD[4].Text + "~" + taxhistorytablerowTD[5].Text; } if (taxhistorytablerowTD.Count == 2) { if (taxhistorytablerowTD[0].Text.Trim().Contains("Owner Name")) { taxhistoryownername = taxhis + "~" + taxhistorytablerowTD[1].Text + "~" + ""; gc.insert_date(orderNumber, Parcel_ID, 1304, taxhistoryownername, 1, DateTime.Now); } } } if (taxhistorytablerowTD.Count != 0 && !rowid1.Text.Contains("Payment History") && !rowid1.Text.Contains("Year") && taxhistorytableRow.Count == 5) { if (taxhistorytablerowTD.Count == 6) { taxhis = taxhistorytablerowTD[0].Text + "~" + taxhistorytablerowTD[1].Text + "~" + taxhistorytablerowTD[2].Text + "~" + taxhistorytablerowTD[3].Text + "~" + taxhistorytablerowTD[4].Text + "~" + taxhistorytablerowTD[5].Text; } if (taxhistorytablerowTD.Count == 2) { if (taxhistorytablerowTD[0].Text.Trim().Contains("Owner Name")) { taxhistoryownername = taxhistorytablerowTD[1].Text; } if (taxhistorytablerowTD[0].Text.Trim().Contains("Paid By")) { taxhistoryPayid = taxhis + "~" + taxhistoryownername + "~" + taxhistorytablerowTD[1].Text; gc.insert_date(orderNumber, Parcel_ID, 1304, taxhistoryPayid, 1, DateTime.Now); } } } } else { if (taxhistorytablerowTD.Count != 0 && !rowid1.Text.Contains("Payment History") && !rowid1.Text.Contains("Year") && taxhistorytableRow.Count == 3) { if (taxhistorytablerowTD.Count == 6) { taxhis = taxhistorytablerowTD[0].Text + "~" + taxhistorytablerowTD[1].Text + "~" + taxhistorytablerowTD[2].Text + "~" + taxhistorytablerowTD[3].Text + "~" + taxhistorytablerowTD[4].Text + "~" + taxhistorytablerowTD[5].Text; } if (taxhistorytablerowTD.Count == 2) { if (taxhistorytablerowTD[0].Text.Trim().Contains("Owner Name")) { taxhistoryownername = taxhis + "~" + taxhistorytablerowTD[1].Text + "~" + ""; gc.insert_date(orderNumber, Parcel_ID, 1304, taxhistoryownername, 1, DateTime.Now); } } } if (taxhistorytablerowTD.Count != 0 && !rowid1.Text.Contains("Payment History") && !rowid1.Text.Contains("Year") && taxhistorytableRow.Count == 4) { if (taxhistorytablerowTD.Count == 6) { taxhis = taxhistorytablerowTD[0].Text + "~" + taxhistorytablerowTD[1].Text + "~" + taxhistorytablerowTD[2].Text + "~" + taxhistorytablerowTD[3].Text + "~" + taxhistorytablerowTD[4].Text + "~" + taxhistorytablerowTD[5].Text; } if (taxhistorytablerowTD.Count == 2) { if (taxhistorytablerowTD[0].Text.Trim().Contains("Owner Name")) { taxhistoryownername = taxhistorytablerowTD[1].Text; } if (taxhistorytablerowTD[0].Text.Trim().Contains("Paid By")) { taxhistoryPayid = taxhis + "~" + taxhistoryownername + "~" + taxhistorytablerowTD[1].Text; gc.insert_date(orderNumber, Parcel_ID, 1304, taxhistoryPayid, 1, DateTime.Now); } } } } } } } catch { } //Bill Screeshot try { IWebElement Idownloadurl = driver.FindElement(By.XPath("/html/body/table[2]/tbody/tr[1]/td[1]/table/tbody/tr[2]/td/table/tbody/tr[8]/td/font/a")); Url = Idownloadurl.GetAttribute("href"); driver.Navigate().GoToUrl(Url); Thread.Sleep(5000); gc.CreatePdf(orderNumber, Parcel_ID, "Tax Bill", driver, "FL", "Flagler"); } catch { } //Tax Authority try { tax_authority = "Flagler County Tax Collector 1769 E. Moody Blvd. Suite 102 Bunnell, FL 32110 Phone: (386) 313-4160 FAX: (386) 313-4161"; } catch { } curtaxhis = exempt + "~" + exempt_amount + "~" + milage_code + "~" + EscrowCode + "~" + Item + "~" + tax_type + "~" + Total_taxes + "~" + Amount_Paid + "~" + date_paid + "~" + Receipt + "~" + Transaction + "~" + tax_authority; gc.insert_date(orderNumber, Parcel_ID, 1299, curtaxhis, 1, DateTime.Now); TaxTime = DateTime.Now.ToString("HH:mm:ss"); LastEndTime = DateTime.Now.ToString("HH:mm:ss"); gc.insert_TakenTime(orderNumber, "FL", "Flagler", StartTime, AssessmentTime, TaxTime, CitytaxTime, LastEndTime); driver.Quit(); gc.mergpdf(orderNumber, "FL", "Flagler"); return("Data Inserted Successfully"); } catch (Exception ex) { driver.Quit(); GlobalClass.LogError(ex, orderNumber); throw; } } }
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_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; } } }