public String GetAccountName(String Member_No, LogMessage LogMessage, Sta ta) { String ACCOUNT_NAME = String.Empty; //[***ห้ามเป็นภาษาไทย] try { String SqlGetName = "SELECT MEMB_ENAME||' '||MEMB_ESURNAME AS ACCOUNT_NAME FROM MBMEMBMASTER WHERE MEMBER_NO = {0}"; SqlGetName = WebUtil.SQLFormat(SqlGetName, Member_No); LogMessage.WriteLog("DeptAccount SQL", SqlGetName); Sdt dt = ta.Query(SqlGetName); if (dt.Next()) { ACCOUNT_NAME = dt.GetString("ACCOUNT_NAME").ToUpper(); LogMessage.WriteLog("", "ACCOUNT_NAME = " + ACCOUNT_NAME); if (ACCOUNT_NAME.Trim() == "") { ACCOUNT_NAME = "N/A"; } } else { ACCOUNT_NAME = ""; } } catch (Exception ex) { throw ex; } return(ACCOUNT_NAME); }
IEnumerator waitforHeadShot(Sta _originSta) { yield return(new WaitForSeconds(0.25f)); rb.constraints = RigidbodyConstraints2D.FreezeRotation; state.work = _originSta; }
public lift() { current_floor = 1; isgood = true; isuse = false; mxfloor = -1; status = Sta.stay; }
public IHttpActionResult station() { String connetStr = "server=127.0.0.1;port=3306;user=root;password=root; database=zhikexing;"; MySqlConnection conn = new MySqlConnection(connetStr); try { conn.Open(); //建立连接 string sql = "select * from stations"; //查询stations表 MySqlCommand cmd = new MySqlCommand(sql, conn); MySqlDataReader reader = cmd.ExecuteReader(); //执行ExecuteReader()返回一个MySqlDataReader对象 Station stalist = new Station(); int flag; //判断stalist中是否有当前读取的线路 while (reader.Read()) //初始索引是-1,执行读取下一行数据,返回值是bool { flag = 1; //遍历stalist,如果有当前线路,将站点加到该线路中,如果没有,加入该线路 foreach (var item in stalist.item) { if ((string)reader["s_line"] == item.line_name) { Sta sta = new Sta(); sta.sta_name = (string)reader["s_sta_name"]; sta.sequence = (int)reader["s_sequence"]; item.sta.Add(sta); flag = 0; break; } } if (flag == 1) { Line line = new Line(); line.line_name = (string)reader["s_line"]; stalist.item.Add(line); } } //将地铁线路和地铁站进行排序 stalist.item = stalist.item.OrderBy(e => e.line_name).ToList(); foreach (var item in stalist.item) { item.sta = item.sta.OrderBy(e => e.sequence).ToList(); } //状态码赋值为1 stalist.status = 1; return(Json(stalist)); } catch (MySqlException ex) { return(Json(ex.Message)); } finally { conn.Close(); } }
static void Main0(string[] args) { // WGS84 geoid parameters const double R_WGS84 = 6378.137e3; // Radius Earth [m] const double f_WGS84 = 1.0 / 298.257223563; // Flattening // Variables Geo.Algorithm.Vector R_Sta = new Geo.Algorithm.Vector(3); // Cartesian station coordinates GeoCoord Sta; // Station coordinates // Header var endl = "\r\n"; var info = "Exercise 5-3: Geodetic coordinates" + endl; Console.WriteLine(info); // Coordinates of NIMA GPS station at Diego Garcia (WGS84(G873); epoch 1997.0) R_Sta = new Geo.Algorithm.Vector(1917032.190, 6029782.349, -801376.113); // [m] // Geodetic coordinates Sta = CoordTransformer.XyzToGeoCoord(new XYZ(R_Sta.OneDimArray));//, R_WGS84, f_WGS84); // Output info = "Cartesian station coordinates (WGS84) [m]" + endl + endl + Sta.ToXyzVector(R_WGS84, f_WGS84) + endl + endl; Console.WriteLine(info); info = "Geodetic station coordinates (WGS84)" + endl + endl + " longitude " + String.Format("{0, 12:F8}", OrbitConsts.DegPerRad * Sta.Lon) + " deg" + endl + " latitude " + String.Format("{0, 12:F8}", OrbitConsts.DegPerRad * Sta.Lat) + " deg" + endl + " height " + String.Format("{0, 12:F5}", Sta.Height) + " m" + endl; Console.WriteLine(info); Console.ReadKey(); }
public void LoanInquiry(String COOP_FIID, String Member_ID, LogMessage LogMessage, Sta ta) { try { MemberNo = Member_ID; Decimal RECEIVE_AMT = 0; Decimal PAY_AMT = 0; Decimal SEQUEST_AMT = 0; String SqlGetAccount = "SELECT TRIM(LOANCONTRACT_NO) AS LOANCONTRACT_NO, RECEIVE_AMT, PAY_AMT, SEQUEST_AMT, ACCOUNT_HOLD FROM ATMLOAN WHERE ACCOUNT_STATUS = 1 AND MEMBER_NO = {0} AND COOP_ID = {1}"; SqlGetAccount = WebUtil.SQLFormat(SqlGetAccount, Member_ID, COOP_FIID); LogMessage.WriteLog("LoanCont SQL", SqlGetAccount); Sdt dt = ta.Query(SqlGetAccount); int RowCount = dt.GetRowCount(); if (RowCount != 1) { LedgerBal = 0; AvailableBal = 0; Loan_Hold = 1; LogMessage.WriteLog("", "พบจำนวนสัญญาเงินกู้ ATM ของเลขที่สมาชิก " + Member_ID + " ที่ผูกกับ ATM [" + RowCount + " Row]"); return; } else if (dt.Next()) { LOANCONTRACT_NO = dt.GetString("LOANCONTRACT_NO"); RECEIVE_AMT = dt.GetDecimal("RECEIVE_AMT"); PAY_AMT = dt.GetDecimal("PAY_AMT"); SEQUEST_AMT = dt.GetDecimal("SEQUEST_AMT"); ACCOUNT_HOLD = dt.GetDecimal("ACCOUNT_HOLD"); LogMessage.WriteLog("", "LOANCONTRACT_NO = " + LOANCONTRACT_NO + " , RECEIVE_AMT = " + RECEIVE_AMT.ToString("#,##0.00") + " , PAY_AMT = " + PAY_AMT.ToString("#,##0.00") + " , ACCOUNT_HOLD = " + ACCOUNT_HOLD.ToString("#0") + " , SEQUEST_AMT = " + SEQUEST_AMT.ToString("#,##0.00")); } String SqlString = "SELECT (NVL(LN.LOANAPPROVE_AMT, 0) - NVL(LN.PRINCIPAL_BALANCE, 0)) AS LEDGER_AMT, (NVL(LN.LOANAPPROVE_AMT, 0) - NVL(LN.PRINCIPAL_BALANCE, 0) - NVL(AC.LOANSEQUEST_AMT,0)) AS AVAILABLE_AMT, AC.LOAN_HOLD AS LOAN_HOLD FROM LNCONTMASTER LN, ATMCOOP AC WHERE LN.CONTRACT_STATUS = 1 AND TRIM(AC.COOP_ID) = {0} AND LN.MEMBER_NO = {1} AND LN.LOANCONTRACT_NO = {2}"; SqlString = WebUtil.SQLFormat(SqlString, COOP_FIID, Member_ID, LOANCONTRACT_NO); LogMessage.WriteLog("LoanInquiry SQL", SqlString); dt = ta.Query(SqlString); RowCount = dt.GetRowCount(); if (RowCount != 1) { LedgerBal = 0; AvailableBal = 0; Dept_Hold = 1; LogMessage.WriteLog("", "พบจำนวนสัญญาเงินกู้ ATM เลขที่ " + LOANCONTRACT_NO + " ของเลขที่สมาชิก " + Member_ID + " ที่ผูกกับ ATM [" + RowCount + " Row]"); return; } else if (dt.Next()) { LedgerBal = dt.GetDecimal("LEDGER_AMT"); AvailableBal = dt.GetDecimal("AVAILABLE_AMT"); Loan_Hold = dt.GetDecimal("LOAN_HOLD"); LogMessage.WriteLog("", "LEDGER_AMT = " + LedgerBal.ToString("#,##0.00") + " , AVAILABLE_AMT = " + AvailableBal.ToString("#,##0.00") + " , LOAN_HOLD = " + Loan_Hold); LedgerBal = LedgerBal - RECEIVE_AMT + PAY_AMT; AvailableBal = AvailableBal - RECEIVE_AMT + PAY_AMT - SEQUEST_AMT; } LogMessage.WriteLog("", "LedgerBalance = " + LedgerBal.ToString("#,##0.00")); LogMessage.WriteLog("", "AvailableBalance = " + AvailableBal.ToString("#,##0.00")); if (AvailableBal < 0) { AvailableBal = 0; LogMessage.WriteLog("", "[ChangBalance] AvailableBalance = " + AvailableBal.ToString("#,##0.00")); } } catch (Exception ex) { throw ex; } }
public void DeptInquiry(String COOP_FIID, String Member_ID, LogMessage LogMessage, Sta ta) { try { MemberNo = Member_ID; Decimal RECEIVE_AMT = 0; Decimal PAY_AMT = 0; Decimal SEQUEST_AMT = 0; String SqlGetAccount = "SELECT TRIM(DEPTACCOUNT_NO) AS DEPTACCOUNT_NO, RECEIVE_AMT, PAY_AMT, SEQUEST_AMT, ACCOUNT_HOLD FROM ATMDEPT WHERE ACCOUNT_STATUS = 1 AND MEMBER_NO = {0} AND COOP_ID = {1}"; SqlGetAccount = WebUtil.SQLFormat(SqlGetAccount, Member_ID, COOP_FIID); LogMessage.WriteLog("DeptAccount SQL", SqlGetAccount); Sdt dt = ta.Query(SqlGetAccount); int RowCount = dt.GetRowCount(); if (RowCount != 1) { LedgerBal = 0; AvailableBal = 0; Dept_Hold = 1; LogMessage.WriteLog("", "พบจำนวนบัญชีเงินฝากของเลขที่สมาชิก " + Member_ID + " ที่ผูกกับ ATM [" + RowCount + " Row]"); return; } else if (dt.Next()) { DEPTACCOUNT_NO = dt.GetString("DEPTACCOUNT_NO"); RECEIVE_AMT = dt.GetDecimal("RECEIVE_AMT"); PAY_AMT = dt.GetDecimal("PAY_AMT"); SEQUEST_AMT = dt.GetDecimal("SEQUEST_AMT"); ACCOUNT_HOLD = dt.GetDecimal("ACCOUNT_HOLD"); LogMessage.WriteLog("", "DEPTACCOUNT_NO = " + DEPTACCOUNT_NO + " , RECEIVE_AMT = " + RECEIVE_AMT.ToString("#,##0.00") + " , PAY_AMT = " + PAY_AMT.ToString("#,##0.00") + " , SEQUEST_AMT = " + SEQUEST_AMT.ToString("#,##0.00") + " , ACCOUNT_HOLD = " + ACCOUNT_HOLD); } String SqlString = "SELECT NVL(DP.PRNCBAL,0) AS LEDGER_AMT, (NVL(DP.PRNCBAL,0) - NVL(DP.SEQUEST_AMOUNT,0) - NVL(DP.CHECKPEND_AMT,0) - NVL(AC.DEPTSEQUEST_AMT,0)) AS AVAILABLE_AMT, AC.DEPT_HOLD AS DEPT_HOLD FROM DPDEPTMASTER DP, ATMCOOP AC WHERE DP.DEPTCLOSE_STATUS = 0 AND TRIM(AC.COOP_ID) = {0} AND MEMBER_NO = {1} AND DP.DEPTACCOUNT_NO = {2}"; SqlString = WebUtil.SQLFormat(SqlString, COOP_FIID, Member_ID, DEPTACCOUNT_NO); LogMessage.WriteLog("DeptInquiry SQL", SqlString); dt = ta.Query(SqlString); RowCount = dt.GetRowCount(); if (RowCount != 1) { LedgerBal = 0; AvailableBal = 0; Dept_Hold = 1; LogMessage.WriteLog("", "พบจำนวนบัญชีเงินฝากของเลขที่สมาชิก " + Member_ID + " ที่ผูกกับ ATM [" + RowCount + " Row]"); return; } else if (dt.Next()) { LedgerBal = dt.GetDecimal("LEDGER_AMT"); AvailableBal = dt.GetDecimal("AVAILABLE_AMT") - SEQUEST_AMT; Dept_Hold = dt.GetDecimal("DEPT_HOLD"); LogMessage.WriteLog("", "LEDGER_AMT = " + LedgerBal.ToString("#,##0.00") + " , AVAILABLE_AMT = " + AvailableBal.ToString("#,##0.00") + " , DEPT_HOLD = " + Dept_Hold); LedgerBal = LedgerBal - RECEIVE_AMT + PAY_AMT; AvailableBal = AvailableBal - RECEIVE_AMT + PAY_AMT; } LogMessage.WriteLog("", "LedgerBalance = " + LedgerBal.ToString("#,##0.00")); LogMessage.WriteLog("", "AvailableBalance = " + AvailableBal.ToString("#,##0.00")); if (AvailableBal < 0) { AvailableBal = 0; LogMessage.WriteLog("", "[ChangBalance] AvailableBalance = " + AvailableBal.ToString("#,##0.00")); } } catch (Exception ex) { throw ex; } }
public void ProcessCancelPayment(String MEMBER_NO, String COOP_ID, String ACCOUNT_NO, Decimal ITEM_AMT, DateTime CCS_OPERATE_DATE, String SYSTEM_CODE, String OPERATE_CODE, String CASH_TYPE, String ATM_NO, String ATM_SEQNO, String SAVING_ACC, LogMessage LogMessage, Sta ta) { try { String SqlInsertATMTRANSACTIONCANCEL = @"INSERT INTO ATMTRANSACTIONCANCEL ( MEMBER_NO, COOP_ID, ACCOUNT_NO, CCS_OPERATE_DATE, SYSTEM_CODE, OPERATE_CODE, CASH_TYPE, ITEM_AMT, ATM_NO, ATM_SEQNO, SAVING_ACC ) VALUES ( {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10})"; SqlInsertATMTRANSACTIONCANCEL = WebUtil.SQLFormat(SqlInsertATMTRANSACTIONCANCEL, MEMBER_NO, COOP_ID, ACCOUNT_NO, CCS_OPERATE_DATE, SYSTEM_CODE, OPERATE_CODE, CASH_TYPE, ITEM_AMT, ATM_NO, ATM_SEQNO, SAVING_ACC); LogMessage.WriteLog("INSERT TRNCANCEL", SqlInsertATMTRANSACTIONCANCEL); ta.Exe(SqlInsertATMTRANSACTIONCANCEL); } catch (Exception ex) { throw ex; } }
public void ProcessPayment(String MEMBER_NO, String COOP_ID, String ACCOUNT_NO, Decimal ITEM_AMT, DateTime CCS_OPERATE_DATE, String SYSTEM_CODE, String OPERATE_CODE, String CASH_TYPE, String ATM_NO, String ATM_SEQNO, String SAVING_ACC, LogMessage LogMessage, Sta ta) { try { if (SYSTEM_CODE == "01") //เงินกู้ { String SqlUpdateATMLOAN = "UPDATE ATMLOAN SET PAY_AMT=PAY_AMT + {0} WHERE ATMLOAN.MEMBER_NO={1} AND ATMLOAN.COOP_ID={2} AND ATMLOAN.LOANCONTRACT_NO={3}"; SqlUpdateATMLOAN = WebUtil.SQLFormat(SqlUpdateATMLOAN, ITEM_AMT, MEMBER_NO, COOP_ID, ACCOUNT_NO); LogMessage.WriteLog("UPDATE ATMLOAN", SqlUpdateATMLOAN); ta.Exe(SqlUpdateATMLOAN); } else if (SYSTEM_CODE == "02") //เงินฝาก { String SqlUpdateATMDEPT = "UPDATE ATMDEPT SET PAY_AMT=PAY_AMT + {0} WHERE ATMDEPT.MEMBER_NO={1} AND ATMDEPT.COOP_ID={2} AND ATMDEPT.DEPTACCOUNT_NO={3}"; SqlUpdateATMDEPT = WebUtil.SQLFormat(SqlUpdateATMDEPT, ITEM_AMT, MEMBER_NO, COOP_ID, ACCOUNT_NO); LogMessage.WriteLog("UPDATE ATMDEPT", SqlUpdateATMDEPT); ta.Exe(SqlUpdateATMDEPT); } else { throw new Exception("SYSTEM_CODE NOT VALUE (ไม่ถูกต้อง)"); } String SqlInsertATMTRANSACTION = @"INSERT INTO ATMTRANSACTION ( MEMBER_NO, COOP_ID, ACCOUNT_NO, CCS_OPERATE_DATE, SYSTEM_CODE, OPERATE_CODE, CASH_TYPE, ITEM_AMT, ATM_NO, ATM_SEQNO, SAVING_ACC ) VALUES ( {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10})"; SqlInsertATMTRANSACTION = WebUtil.SQLFormat(SqlInsertATMTRANSACTION, MEMBER_NO, COOP_ID, ACCOUNT_NO, CCS_OPERATE_DATE, SYSTEM_CODE, OPERATE_CODE, CASH_TYPE, ITEM_AMT, ATM_NO, ATM_SEQNO, SAVING_ACC); LogMessage.WriteLog("INSERT ATMTRAN", SqlInsertATMTRANSACTION); ta.Exe(SqlInsertATMTRANSACTION); } catch (Exception ex) { throw ex; } }
public string FTP_Coweta(string address, string assessment_id, string parcelNumber, string searchType, string orderNumber, string directParcel, string ownername) { GlobalClass.global_orderNo = orderNumber; HttpContext.Current.Session["orderNo"] = orderNumber; GlobalClass.global_parcelNo = parcelNumber; string StartTime = "", AssessmentTime = "", TaxTime = "", CitytaxTime = "", LastEndTime = ""; var driverService = PhantomJSDriverService.CreateDefaultService(); driverService.HideCommandPromptWindow = true; using (driver = new PhantomJSDriver())// { //driver = new ChromeDriver(); try { StartTime = DateTime.Now.ToString("HH:mm:ss"); if (searchType == "titleflex") { string titleaddress = address; gc.TitleFlexSearch(orderNumber, "", "", titleaddress, "GA", "Coweta"); if ((HttpContext.Current.Session["TitleFlex_Search"] != null && HttpContext.Current.Session["TitleFlex_Search"].ToString() == "Yes")) { driver.Quit(); return("MultiParcel"); } else if (HttpContext.Current.Session["titleparcel"].ToString() == "") { HttpContext.Current.Session["Nodata_CowetaGA"] = "Yes"; driver.Quit(); return("No Data Found"); } parcelNumber = HttpContext.Current.Session["titleparcel"].ToString(); searchType = "parcel"; } if (searchType == "address") { driver.Navigate().GoToUrl("https://qpublic.schneidercorp.com/Application.aspx?App=CowetaCountyGA&Layer=Parcels&PageType=Search"); Thread.Sleep(2000); try { driver.FindElement(By.XPath("//*[@id='appBody']/div[4]/div/div/div[3]/a[1]")).Click(); Thread.Sleep(2000); } catch { } try { driver.FindElement(By.XPath("//*[@id='appBody']/div[5]/div/div/div[3]/a")).Click(); Thread.Sleep(2000); } catch { } driver.FindElement(By.Id("ctlBodyPane_ctl01_ctl01_txtAddress")).SendKeys(address); gc.CreatePdf_WOP(orderNumber, "Address search", driver, "GA", "Coweta"); driver.FindElement(By.Id("ctlBodyPane_ctl01_ctl01_btnSearch")).SendKeys(Keys.Enter); Thread.Sleep(2000); try { IWebElement MultiAddressTB = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl00_ctl01_gvwParcelResults']/tbody")); IList <IWebElement> MultiAddressTR = MultiAddressTB.FindElements(By.TagName("tr")); IList <IWebElement> MultiAddressTD; gc.CreatePdf_WOP(orderNumber, "Multi Address search", driver, "GA", "Coweta"); int AddressmaxCheck = 0; foreach (IWebElement MultiAddress in MultiAddressTR) { if (AddressmaxCheck <= 25) { MultiAddressTD = MultiAddress.FindElements(By.TagName("td")); if (MultiAddressTD.Count != 0) { Parcelno = MultiAddressTD[1].Text; Owner = MultiAddressTD[3].Text; Property_Address = MultiAddressTD[4].Text; MultiAddress_details = Owner + "~" + Property_Address; gc.insert_date(orderNumber, Parcelno, 635, MultiAddress_details, 1, DateTime.Now); } AddressmaxCheck++; } } if (MultiAddressTR.Count > 25) { HttpContext.Current.Session["multiParcel_Coweta_Multicount"] = "Maximum"; } else { HttpContext.Current.Session["multiparcel_Coweta"] = "Yes"; } driver.Quit(); return("MultiParcel"); } catch { } try { //No Data Found string nodata = driver.FindElement(By.Id("ctlBodyPane_noDataList_pnlNoResults")).Text; if (nodata.Contains("No results match your search criteria.")) { HttpContext.Current.Session["Nodata_CowetaGA"] = "Yes"; driver.Quit(); return("No Data Found"); } } catch { } } if (searchType == "parcel") { driver.Navigate().GoToUrl("https://qpublic.schneidercorp.com/Application.aspx?App=CowetaCountyGA&Layer=Parcels&PageType=Search"); Thread.Sleep(2000); try { driver.FindElement(By.XPath("//*[@id='appBody']/div[4]/div/div/div[3]/a[1]")).Click(); Thread.Sleep(2000); } catch { } try { driver.FindElement(By.XPath("//*[@id='appBody']/div[5]/div/div/div[3]/a")).Click(); Thread.Sleep(2000); } catch { } driver.FindElement(By.Id("ctlBodyPane_ctl02_ctl01_txtParcelID")).SendKeys(parcelNumber); gc.CreatePdf(orderNumber, parcelNumber, "ParcelSearch", driver, "GA", "Coweta"); driver.FindElement(By.Id("ctlBodyPane_ctl02_ctl01_btnSearch")).SendKeys(Keys.Enter); Thread.Sleep(2000); try { //No Data Found string nodata = driver.FindElement(By.Id("ctlBodyPane_noDataList_pnlNoResults")).Text; if (nodata.Contains("No results match your search criteria.")) { HttpContext.Current.Session["Nodata_CowetaGA"] = "Yes"; driver.Quit(); return("No Data Found"); } } catch { } } if (searchType == "ownername") { driver.Navigate().GoToUrl("https://qpublic.schneidercorp.com/Application.aspx?App=CowetaCountyGA&Layer=Parcels&PageType=Search"); Thread.Sleep(2000); try { driver.FindElement(By.XPath("//*[@id='appBody']/div[4]/div/div/div[3]/a[1]")).Click(); Thread.Sleep(2000); } catch { } try { driver.FindElement(By.XPath("//*[@id='appBody']/div[5]/div/div/div[3]/a")).Click(); Thread.Sleep(2000); } catch { } driver.FindElement(By.Id("ctlBodyPane_ctl00_ctl01_txtName")).SendKeys(ownername); gc.CreatePdf_WOP(orderNumber, "Owner search", driver, "GA", "Coweta"); driver.FindElement(By.Id("ctlBodyPane_ctl00_ctl01_btnSearch")).SendKeys(Keys.Enter); Thread.Sleep(2000); try { IWebElement MultiAddressTB = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl00_ctl01_gvwParcelResults']/tbody")); IList <IWebElement> MultiAddressTR = MultiAddressTB.FindElements(By.TagName("tr")); IList <IWebElement> MultiAddressTD; gc.CreatePdf_WOP(orderNumber, "Multi Owner search", driver, "GA", "Coweta"); int AddressmaxCheck = 0; foreach (IWebElement MultiAddress in MultiAddressTR) { if (AddressmaxCheck <= 25) { MultiAddressTD = MultiAddress.FindElements(By.TagName("td")); if (MultiAddressTD.Count != 0) { Parcelno = MultiAddressTD[1].Text; Owner = MultiAddressTD[3].Text; Property_Address = MultiAddressTD[4].Text; MultiAddress_details = Owner + "~" + Property_Address; gc.insert_date(orderNumber, Parcelno, 635, MultiAddress_details, 1, DateTime.Now); } AddressmaxCheck++; } } if (MultiAddressTR.Count > 25) { HttpContext.Current.Session["multiParcel_Coweta_Multicount"] = "Maximum"; } else { HttpContext.Current.Session["multiparcel_Coweta"] = "Yes"; } driver.Quit(); return("MultiParcel"); } catch { } try { //No Data Found string nodata = driver.FindElement(By.Id("ctlBodyPane_noDataList_pnlNoResults")).Text; if (nodata.Contains("No results match your search criteria.")) { HttpContext.Current.Session["Nodata_CowetaGA"] = "Yes"; driver.Quit(); return("No Data Found"); } } catch { } } //Property Details IWebElement tbmulti11 = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl00_ctl01_dvNonPrebillMH']/table/tbody")); IList <IWebElement> TRmulti11 = tbmulti11.FindElements(By.TagName("tr")); IList <IWebElement> TDmulti11; foreach (IWebElement row in TRmulti11) { TDmulti11 = row.FindElements(By.TagName("td")); if (TDmulti11.Count != 0) { if (i == 0) { ParcelID = TDmulti11[1].Text; } if (i == 1) { Loc_Addrs = TDmulti11[1].Text; } if (i == 3) { Leg_Desp = TDmulti11[1].Text; } if (i == 5) { Class = TDmulti11[1].Text; } if (i == 7) { Tax_Dist = TDmulti11[1].Text; } if (i == 8) { Milagerate = TDmulti11[1].Text; } if (i == 9) { Acres = TDmulti11[1].Text; } if (i == 10) { Neighberwood = TDmulti11[1].Text; } if (i == 11) { Homstd_Exmp = TDmulti11[1].Text; } i++; } } try { Owner1 = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl01_mSection']/div")).Text.Replace("\r\n", "").Trim(); } catch { } try { Year_Built = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl09_ctl01_gvwPrebillMH']/tbody/tr/td[4]")).Text; } catch { } try { IWebElement Yeartb = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl05_mSection']/div/table/tbody")); IList <IWebElement> YearTR = Yeartb.FindElements(By.TagName("tr")); IList <IWebElement> YearTD; foreach (IWebElement Tax4 in YearTR) { YearTD = Tax4.FindElements(By.TagName("td")); if (YearTD.Count != 0) { string yblt = YearTD[0].Text; if (yblt.Contains("Year Built")) { Year_Built = YearTD[1].Text; } } } } catch { } property = Loc_Addrs + "~" + Leg_Desp + "~" + Class + "~" + Tax_Dist + "~" + Milagerate + "~" + Acres + "~" + Neighberwood + "~" + Homstd_Exmp + "~" + Owner1 + "~" + Year_Built; gc.CreatePdf(orderNumber, ParcelID, "Property Details", driver, "GA", "Coweta"); gc.insert_date(orderNumber, ParcelID, 636, property, 1, DateTime.Now); //Assessment Details IWebElement AssmThTb = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl13_ctl01_grdValuation']/thead")); IList <IWebElement> AssmThTr = AssmThTb.FindElements(By.TagName("tr")); IList <IWebElement> AssmTh; foreach (IWebElement Assm in AssmThTr) { AssmTh = Assm.FindElements(By.TagName("th")); if (AssmTh.Count != 0) { Year1 = AssmTh[0].Text; Year2 = AssmTh[1].Text; Year3 = AssmTh[2].Text; } } IWebElement AssmTb = driver.FindElement(By.XPath("//*[@id='ctlBodyPane_ctl13_ctl01_grdValuation']/tbody")); IList <IWebElement> AssmTr = AssmTb.FindElements(By.TagName("tr")); IList <IWebElement> AssmTd; List <string> Previous_Value = new List <string>(); List <string> Land_Value = new List <string>(); List <string> Improvement_Value = new List <string>(); List <string> Accessory_Value = new List <string>(); List <string> Current_Value = new List <string>(); foreach (IWebElement Assmrow in AssmTr) { AssmTd = Assmrow.FindElements(By.TagName("td")); if (AssmTd.Count != 0) { if (j == 0) { Previous_Value.Add(AssmTd[2].Text); Previous_Value.Add(AssmTd[3].Text); Previous_Value.Add(AssmTd[4].Text); } else if (j == 1) { Land_Value.Add(AssmTd[2].Text); Land_Value.Add(AssmTd[3].Text); Land_Value.Add(AssmTd[4].Text); } else if (j == 2) { Improvement_Value.Add(AssmTd[2].Text); Improvement_Value.Add(AssmTd[3].Text); Improvement_Value.Add(AssmTd[4].Text); } else if (j == 3) { Accessory_Value.Add(AssmTd[2].Text); Accessory_Value.Add(AssmTd[3].Text); Accessory_Value.Add(AssmTd[4].Text); } else if (j == 4) { Current_Value.Add(AssmTd[2].Text); Current_Value.Add(AssmTd[3].Text); Current_Value.Add(AssmTd[4].Text); } j++; } } Assemnt_Details1 = Year1 + "~" + Previous_Value[0] + "~" + Land_Value[0] + "~" + Improvement_Value[0] + "~" + Accessory_Value[0] + "~" + Current_Value[0]; Assemnt_Details2 = Year2 + "~" + Previous_Value[1] + "~" + Land_Value[1] + "~" + Improvement_Value[1] + "~" + Accessory_Value[1] + "~" + Current_Value[1]; Assemnt_Details3 = Year3 + "~" + Previous_Value[2] + "~" + Land_Value[2] + "~" + Improvement_Value[2] + "~" + Accessory_Value[2] + "~" + Current_Value[2]; gc.insert_date(orderNumber, ParcelID, 638, Assemnt_Details1, 1, DateTime.Now); gc.insert_date(orderNumber, ParcelID, 638, Assemnt_Details2, 1, DateTime.Now); gc.insert_date(orderNumber, ParcelID, 638, Assemnt_Details3, 1, DateTime.Now); AssessmentTime = DateTime.Now.ToString("HH:mm:ss"); //Tax Details driver.Navigate().GoToUrl("https://www.cowetataxcom.com/taxes.html#/WildfireSearch"); Thread.Sleep(2000); //driver.FindElement(By.LinkText("SEARCH & PAY TAXES")).Click(); Thread.Sleep(2000); try { driver.FindElement(By.Id("btnAccept")).Click(); Thread.Sleep(2000); } catch { } try { driver.FindElement(By.XPath("/html/body/div[1]/div/div/div[3]/button[1]")).Click(); Thread.Sleep(2000); } catch { } driver.FindElement(By.Id("searchBox")).SendKeys(ParcelID); Thread.Sleep(4000); //TaxPayment Receipt Details try { IWebElement TaxPaymentTB = null; try { TaxPaymentTB = driver.FindElement(By.XPath("//*[@id='avalon']/div/div[3]/div[2]/table/tbody")); } catch { } try { if (TaxPaymentTB == null) { TaxPaymentTB = driver.FindElement(By.XPath("//*[@id='avalon']/div/div[4]/div[2]/table/tbody")); } } catch { } IList <IWebElement> TaxPaymentTR = TaxPaymentTB.FindElements(By.TagName("tr")); IList <IWebElement> TaxPaymentTD; foreach (IWebElement TaxPayment in TaxPaymentTR) { TaxPaymentTD = TaxPayment.FindElements(By.TagName("td")); if (TaxPaymentTD.Count != 0) { Owners = TaxPaymentTD[0].Text; year = TaxPaymentTD[1].Text; receipt = TaxPaymentTD[2].Text; Desc = TaxPaymentTD[3].Text; Type = TaxPaymentTD[4].Text; Paid = TaxPaymentTD[5].Text; Paid_date = TaxPaymentTD[6].Text; Payment_details = Owners + "~" + year + "~" + receipt + "~" + Desc + "~" + Type + "~" + Paid + "~" + Paid_date; gc.CreatePdf(orderNumber, ParcelID, "Tax Bill Details", driver, "GA", "Coweta"); gc.insert_date(orderNumber, ParcelID, 645, Payment_details, 1, DateTime.Now); } } } catch { } //Tax Info Details IWebElement Receipttable = null; try { Receipttable = driver.FindElement(By.XPath("//*[@id='avalon']/div/div[3]/div[2]/table/tbody")); } catch { } try { if (Receipttable == null) { Receipttable = driver.FindElement(By.XPath("//*[@id='avalon']/div/div[4]/div[2]/table/tbody")); } } catch { } IList <IWebElement> ReceipttableRow = Receipttable.FindElements(By.TagName("tr")); int rowcount = ReceipttableRow.Count; for (int p = 1; p <= rowcount; p++) { if (p < 4) { try { driver.FindElement(By.XPath("//*[@id='avalon']/div/div[3]/div[2]/table/tbody/tr[" + p + "]/td[9]/button")).Click(); } catch { } try { driver.FindElement(By.XPath("//*[@id='avalon']/div/div[4]/div[2]/table/tbody/tr[" + p + "]/td[9]/button/i")).Click(); } catch { } Thread.Sleep(6000); try { IWebElement DeliquentTB = driver.FindElement(By.XPath("/html/body/div[1]/div/div/div[1]/table/tbody")); IList <IWebElement> DeliquentTR = DeliquentTB.FindElements(By.TagName("tr")); IList <IWebElement> DeliquentTD; foreach (IWebElement Deliquent in DeliquentTR) { DeliquentTD = Deliquent.FindElements(By.TagName("td")); if (DeliquentTD.Count != 0 && DeliquentTR.Count != 2) { name = DeliquentTD[0].Text; Taxyear = DeliquentTD[1].Text; bill_no = DeliquentTD[2].Text; amount = DeliquentTD[6].Text; Del_details = name + "~" + Taxyear + "~" + bill_no + "~" + amount; gc.CreatePdf(orderNumber, ParcelID, "Deliquent Details" + Taxy, driver, "GA", "Coweta"); gc.insert_date(orderNumber, ParcelID, 652, Del_details, 1, DateTime.Now); name = ""; Taxyear = ""; bill_no = ""; amount = ""; } } } catch { } try { IWebElement DeliquentfootTB = driver.FindElement(By.XPath("/html/body/div[1]/div/div/div[1]/table/tfoot")); IList <IWebElement> DeliquentfootTR = DeliquentfootTB.FindElements(By.TagName("tr")); IList <IWebElement> DeliquentfootTD; foreach (IWebElement Deliquentfoot in DeliquentfootTR) { DeliquentfootTD = Deliquentfoot.FindElements(By.TagName("th")); if (DeliquentfootTD.Count != 0 && !Deliquentfoot.Text.Contains("$734.16")) { string bill_no1 = DeliquentfootTD[0].Text; string amount1 = DeliquentfootTD[2].Text; string Del_details1 = "" + "~" + "" + "~" + bill_no1 + "~" + amount1; gc.insert_date(orderNumber, ParcelID, 652, Del_details1, 1, DateTime.Now); } } } catch { } try { driver.FindElement(By.XPath("/html/body/div[1]/div/div/div[2]/button[2]")).Click(); Thread.Sleep(2000); } catch { } IWebElement TaxTB = driver.FindElement(By.XPath("//*[@id='avalon']/div/div/div/div[1]/div[2]/div[1]/table/tbody")); IList <IWebElement> TaxTR = TaxTB.FindElements(By.TagName("tr")); IList <IWebElement> TaxTD; foreach (IWebElement Tax in TaxTR) { TaxTD = Tax.FindElements(By.TagName("td")); if (TaxTD.Count != 0 && !Tax.Text.Contains("Parcel Number") && TaxTD[1].Text != "") { Dist = TaxTD[0].Text; if (Dist.Contains("District")) { Dis = TaxTD[1].Text; } Ac = TaxTD[0].Text; if (Ac.Contains("Acres")) { Acres1 = TaxTD[1].Text; } AsVal = TaxTD[0].Text; if (AsVal.Contains("Description")) { Description = TaxTD[1].Text; } ProVal = TaxTD[0].Text; if (ProVal.Contains("Property Address")) { Pro_Addr = TaxTD[1].Text; } AppVal = TaxTD[0].Text; if (AppVal.Contains("Assessed Value")) { Assed_Val = TaxTD[1].Text; } ApprVal = TaxTD[0].Text; if (ApprVal.Contains("Appraised Value")) { Appr_Value = TaxTD[1].Text; } } } IWebElement Tax1TB = driver.FindElement(By.XPath("//*[@id='avalon']/div/div/div/div[1]/div[1]/div[2]/table/tbody")); IList <IWebElement> Tax1TR = Tax1TB.FindElements(By.TagName("tr")); IList <IWebElement> Tax1TD; foreach (IWebElement Tax1 in Tax1TR) { Tax1TD = Tax1.FindElements(By.TagName("td")); if (Tax1TD.Count != 0) { Sta = Tax1TD[0].Text; if (Sta.Contains("Status")) { Status = Tax1TD[1].Text; } Latpay = Tax1TD[0].Text; if (Latpay.Contains("Last Payment Date")) { Last_Pay = Tax1TD[1].Text; } Amtpaid = Tax1TD[0].Text; if (Amtpaid.Contains("Amount Paid")) { Amt_Paid = Tax1TD[1].Text; } } } IWebElement Tax2TB = driver.FindElement(By.XPath("//*[@id='avalon']/div/div/div/div[1]/div[2]/div[2]/table/tbody")); IList <IWebElement> Tax2TR = Tax2TB.FindElements(By.TagName("tr")); IList <IWebElement> Tax2TD; foreach (IWebElement Tax2 in Tax2TR) { Tax2TD = Tax2.FindElements(By.TagName("td")); if (Tax2TD.Count != 0) { Rcdtyp = Tax2TD[0].Text; if (Rcdtyp.Contains("Record Type")) { Record_Type = Tax2TD[1].Text; } tYear = Tax2TD[0].Text; if (tYear.Contains("Tax Year")) { Taxy = Tax2TD[1].Text; } Rep = Tax2TD[0].Text; if (Rep.Contains("Bill Number")) { Recep = Tax2TD[1].Text; } Dudt = Tax2TD[0].Text; if (Dudt.Contains("Account Number")) { Accnt_Num = Tax2TD[1].Text; } Duet = Tax2TD[0].Text; if (Duet.Contains("Due Date")) { Due_Date = Tax2TD[1].Text; } } } IWebElement Tax4TB = driver.FindElement(By.XPath("//*[@id='avalon']/div/div/div/div[1]/div[2]/div[3]/table/tbody")); IList <IWebElement> Tax4TR = Tax4TB.FindElements(By.TagName("tr")); IList <IWebElement> Tax4TD; foreach (IWebElement Tax4 in Tax4TR) { Tax4TD = Tax4.FindElements(By.TagName("td")); if (Tax4TD.Count != 0 && Tax4TD[1].Text != "") { Base = Tax4TD[0].Text; if (Base.Contains("Base Taxes")) { Base_Taxes = Tax4TD[1].Text; } Pan = Tax4TD[0].Text; if (Pan.Contains("Penalty")) { penalty = Tax4TD[1].Text; } Inst = Tax4TD[0].Text; if (Inst.Contains("Interest")) { Interst = Tax4TD[1].Text; } Otherfee = Tax4TD[0].Text; if (Otherfee.Contains("Other Fees")) { Other_Fee = Tax4TD[1].Text; } string tytl_due = Tax4TD[0].Text; if (tytl_due.Contains(Taxy + "Total Due")) { string Del_Taxyear = Tax4TD[1].Text; } Backtax = Tax4TD[0].Text; if (Backtax.Contains("Back Taxes")) { Back_Tax = Tax4TD[1].Text; } tldue = Tax4TD[0].Text; if (tldue.Contains("Total Due")) { Total_Due = Tax4TD[1].Text; } } } gc.CreatePdf(orderNumber, ParcelID, "Tax Details" + Taxy, driver, "GA", "Coweta"); string Tax_Deatils = Taxy + "~" + Dis + "~" + Acres1 + "~" + Description + "~" + Pro_Addr + "~" + Assed_Val + "~" + Appr_Value + "~" + Status + "~" + Last_Pay + "~" + Amt_Paid + "~" + Record_Type + "~" + Recep + "~" + Accnt_Num + "~" + Due_Date + "~" + Base_Taxes + "~" + penalty + "~" + Interst + "~" + Other_Fee + "~" + Del_Taxyear + "~" + Back_Tax + "~" + Total_Due; gc.insert_date(orderNumber, ParcelID, 647, Tax_Deatils, 1, DateTime.Now); //Tax Breakdown try { IWebElement BreakdownTB = driver.FindElement(By.XPath("//*[@id='avalon']/div/div/div/div[1]/div[3]/div/table/tbody")); IList <IWebElement> BreakdownTR = BreakdownTB.FindElements(By.TagName("tr")); IList <IWebElement> BreakdownTD; foreach (IWebElement Breakdown in BreakdownTR) { BreakdownTD = Breakdown.FindElements(By.TagName("td")); if (BreakdownTD.Count != 0) { Entity = BreakdownTD[0].Text; AdjtFMV = BreakdownTD[1].Text; NetAssnt = BreakdownTD[2].Text; Exemptions = BreakdownTD[3].Text; Taxbleval = BreakdownTD[4].Text; Milagete = BreakdownTD[5].Text; grosstax = BreakdownTD[6].Text; Credits = BreakdownTD[7].Text; Net_Tax = BreakdownTD[8].Text; Breakdown_details = Entity + "~" + AdjtFMV + "~" + NetAssnt + "~" + Exemptions + "~" + Taxbleval + "~" + Milagete + "~" + grosstax + "~" + Credits + "~" + Net_Tax; gc.insert_date(orderNumber, ParcelID, 650, Breakdown_details, 1, DateTime.Now); } } } catch { } try { IWebElement FooterTB = driver.FindElement(By.XPath("//*[@id='avalon']/div/div/div/div[1]/div[3]/div/table/tfoot")); IList <IWebElement> FooterTR = FooterTB.FindElements(By.TagName("tr")); IList <IWebElement> FooterTD; foreach (IWebElement Footer in FooterTR) { FooterTD = Footer.FindElements(By.TagName("th")); if (FooterTD.Count != 0) { Entity1 = FooterTD[0].Text; AdjtFMV1 = FooterTD[1].Text; NetAssnt1 = FooterTD[2].Text; Exemptions1 = FooterTD[3].Text; Taxbleval1 = FooterTD[4].Text; Milagete1 = FooterTD[5].Text; grosstax1 = FooterTD[6].Text; Credits1 = FooterTD[7].Text; Net_Tax1 = FooterTD[8].Text; } } Breakdown_details1 = Entity1 + "~" + AdjtFMV1 + "~" + NetAssnt1 + "~" + Exemptions1 + "~" + Taxbleval1 + "~" + Milagete1 + "~" + grosstax1 + "~" + Credits1 + "~" + Net_Tax1; gc.insert_date(orderNumber, ParcelID, 650, Breakdown_details1, 1, DateTime.Now); } catch { } //Tax Bill try { driver.FindElement(By.XPath("//*[@id='avalon']/div/div/ul/li[2]/a")).Click(); Thread.Sleep(5000); gc.CreatePdf(orderNumber, ParcelID, "Tax Bill Details" + Taxy, driver, "GA", "Coweta"); } catch { } try { driver.FindElement(By.XPath("//*[@id='avalon']/div/div/ul/li[3]/a")).Click(); Thread.Sleep(4000); gc.CreatePdf(orderNumber, ParcelID, "Tax Receipt Details" + Taxy, driver, "GA", "Coweta"); } catch { } driver.Navigate().Back(); Thread.Sleep(3000); } } //Tax Authority driver.Navigate().GoToUrl("https://www.cowetataxcom.com/#/contact"); Thread.Sleep(2000); try { Taxing = driver.FindElement(By.XPath("//*[@id='editor1567']/p[1]")).Text; Taxing = WebDriverTest.Between(Taxing, "Coweta County Tax Commissioner", "County Administration Building").Replace("\r\n", " ").Trim(); Tax_athuer = "Newnan, Georgia 30264"; Phone = "770-254-2670"; Fax = "770-683-2038"; gc.CreatePdf(orderNumber, ParcelID, "Tax Authority Details", driver, "GA", "Coweta"); Taxing_Authority = Taxing + " " + Tax_athuer + " " + Phone + " " + Fax; Taxauthority_Details = Taxing_Authority; gc.insert_date(orderNumber, ParcelID, 653, Taxauthority_Details, 1, DateTime.Now); } catch { } TaxTime = DateTime.Now.ToString("HH:mm:ss"); LastEndTime = DateTime.Now.ToString("HH:mm:ss"); gc.insert_TakenTime(orderNumber, "GA", "Coweta", StartTime, AssessmentTime, TaxTime, CitytaxTime, LastEndTime); driver.Quit(); gc.mergpdf(orderNumber, "GA", "Coweta"); return("Data Inserted Successfully"); } catch (Exception ex) { driver.Quit(); GlobalClass.LogError(ex, orderNumber); throw; } } }
private void CancelTransaction(DataEncode DataRequest, ref DataEncode DataResponse, Sta ta, LogMessage LogMessage) { try { Sdt dt; String SqlGetAccount = String.Empty; int RowCount = 0; String Member_No = DataRequest.COOPCustomerID.ToString("00000000"); String Coop_Id = DataRequest.COOPFIID; Decimal LedgerBalance = 0; Decimal AvailableBalance = 0; Decimal Item_Amt = 0; DataResponse.TransactionMessageCode = "0410"; //####################################################################################################################### #region ถอนสด if (DataRequest.TransactionCode == 10) //[ถอนเงินสด] (เงินออกทางตู้ ATM ทันที) { switch (DataRequest.FromAccountCode.ToString("00")) { case "01": DataResponse.ResponseCode = ResponseCode.TransactionNotAuthorized; break; case "11": DataResponse.ResponseCode = ResponseCode.TransactionNotAuthorized; break; case "14": //ถอนเงินฝาก String Deptaccount_No = String.Empty; LogMessage.WriteLog("TransactionType", "Cancel Cash Withdraw Deposit [ยกเลิก ถอนเงินฝากแบบเงินสด] ####################"); Item_Amt = DataRequest.Amount1; LogMessage.WriteLog("Withdraw Amount", Item_Amt.ToString("#,##0.00")); SqlGetAccount = "SELECT ACCOUNT_NO FROM ATMTRANSACTION WHERE MEMBER_NO = {0} AND CCS_OPERATE_DATE = {1}"; SqlGetAccount = WebUtil.SQLFormat(SqlGetAccount, Member_No, DataRequest.TransactionDateTime); LogMessage.WriteLog("TRANSACTION SQL", SqlGetAccount); dt = ta.Query(SqlGetAccount); RowCount = dt.GetRowCount(); if (RowCount != 1) { LogMessage.WriteLog("", "พบข้อมูลทั้งหมด = " + RowCount); return; } else if (dt.Next()) { Deptaccount_No = dt.GetString("ACCOUNT_NO"); LogMessage.WriteLog("", "DEPTACCOUNT_NO = " + Deptaccount_No); //###### ย้อนรายการ ###### Receive Recv = new Receive(); String System_Code = "02"; //เงินฝาก String Operate_Code = "002"; //ประเภทถอน String Cash_type = "CSH"; Recv.ProcessCancelWithdraw(Member_No, Coop_Id, Deptaccount_No, Item_Amt, DataRequest.TransactionDateTime, System_Code, Operate_Code, Cash_type, DataRequest.AcquirerTerminalNumber, DataRequest.TerminalSequenceNo, DataRequest.COOPCustomerAC.ToString("0000000000"), LogMessage, ta); } break; case "34": //กู้เงินกู้ String Loancontract_No = String.Empty; LogMessage.WriteLog("TransactionType", "Cancel Cash Withdraw Loan [ยกเลิก ถอน(กู้เพิ่ม)เงินกู้แบบเงินสด] ####################"); Item_Amt = DataRequest.Amount1; LogMessage.WriteLog("Withdraw Amount", Item_Amt.ToString("#,##0.00")); SqlGetAccount = "SELECT ACCOUNT_NO FROM ATMTRANSACTION WHERE MEMBER_NO = {0} AND CCS_OPERATE_DATE = {1}"; SqlGetAccount = WebUtil.SQLFormat(SqlGetAccount, Member_No, DataRequest.TransactionDateTime); LogMessage.WriteLog("TRANSACTION SQL", SqlGetAccount); dt = ta.Query(SqlGetAccount); RowCount = dt.GetRowCount(); if (RowCount != 1) { LogMessage.WriteLog("", "พบข้อมูลทั้งหมด = " + RowCount); return; } else if (dt.Next()) { Loancontract_No = dt.GetString("ACCOUNT_NO"); LogMessage.WriteLog("", "LOANACCOUNT_NO = " + Loancontract_No); //###### ย้อนรายการ ###### Receive Recv = new Receive(); String System_Code = "01"; //เงินกู้ String Operate_Code = "002"; //ประเภทถอน String Cash_type = "CSH"; Recv.ProcessCancelWithdraw(Member_No, Coop_Id, Loancontract_No, Item_Amt, DataRequest.TransactionDateTime, System_Code, Operate_Code, Cash_type, DataRequest.AcquirerTerminalNumber, DataRequest.TerminalSequenceNo, DataRequest.COOPCustomerAC.ToString("0000000000"), LogMessage, ta); } break; default: DataResponse.ResponseCode = ResponseCode.TransactionNotAuthorized; break; } } #endregion //####################################################################################################################### #region ถอนโอน else if (DataRequest.TransactionCode == 42) //ถอนเงินแบบโอน { switch (DataRequest.FromAccountCode.ToString("00")) { case "01": DataResponse.ResponseCode = ResponseCode.TransactionNotAuthorized; break; case "11": DataResponse.ResponseCode = ResponseCode.TransactionNotAuthorized; break; case "14": //ถอนเงินฝาก String Deptaccount_No = String.Empty; LogMessage.WriteLog("TransactionType", "Cancel Cash Withdraw Deposit [ยกเลิก ถอนเงินฝากแบบโอนเข้าบัญชี] ####################"); Item_Amt = DataRequest.Amount1; LogMessage.WriteLog("Withdraw Amount", Item_Amt.ToString("#,##0.00")); SqlGetAccount = "SELECT ACCOUNT_NO FROM ATMTRANSACTION WHERE MEMBER_NO = {0} AND CCS_OPERATE_DATE = {1}"; SqlGetAccount = WebUtil.SQLFormat(SqlGetAccount, Member_No, DataRequest.TransactionDateTime); LogMessage.WriteLog("TRANSACTION SQL", SqlGetAccount); dt = ta.Query(SqlGetAccount); RowCount = dt.GetRowCount(); if (RowCount != 1) { LogMessage.WriteLog("", "พบข้อมูลทั้งหมด = " + RowCount); return; } else if (dt.Next()) { Deptaccount_No = dt.GetString("ACCOUNT_NO"); LogMessage.WriteLog("", "DEPTACCOUNT_NO = " + Deptaccount_No); //###### ย้อนรายการ ###### Receive Recv = new Receive(); String System_Code = "02"; //เงินฝาก String Operate_Code = "002"; //ประเภทถอน String Cash_type = "TRN"; Recv.ProcessCancelWithdraw(Member_No, Coop_Id, Deptaccount_No, Item_Amt, DataRequest.TransactionDateTime, System_Code, Operate_Code, Cash_type, DataRequest.AcquirerTerminalNumber, DataRequest.TerminalSequenceNo, DataRequest.COOPCustomerAC.ToString("0000000000"), LogMessage, ta); } break; case "34": //กู้เงินกู้ String Loancontract_No = String.Empty; LogMessage.WriteLog("TransactionType", "Cancel Tranfer Withdraw Loan [ยกเลิก ถอน(กู้เพิ่ม)เงินกู้แบบโอน] ####################"); Item_Amt = DataRequest.Amount1; LogMessage.WriteLog("Withdraw Amount", Item_Amt.ToString("#,##0.00")); SqlGetAccount = "SELECT ACCOUNT_NO FROM ATMTRANSACTION WHERE MEMBER_NO = {0} AND CCS_OPERATE_DATE = {1}"; SqlGetAccount = WebUtil.SQLFormat(SqlGetAccount, Member_No, DataRequest.TransactionDateTime); LogMessage.WriteLog("TRANSACTION SQL", SqlGetAccount); dt = ta.Query(SqlGetAccount); RowCount = dt.GetRowCount(); if (RowCount != 1) { LogMessage.WriteLog("", "พบข้อมูลทั้งหมด = " + RowCount); return; } else if (dt.Next()) { Loancontract_No = dt.GetString("ACCOUNT_NO"); LogMessage.WriteLog("", "LOANACCOUNT_NO = " + Loancontract_No); //###### ย้อนรายการ ###### Receive Recv = new Receive(); String System_Code = "01"; //เงินกู้ String Operate_Code = "002"; //ประเภทถอน String Cash_type = "TRN"; Recv.ProcessCancelWithdraw(Member_No, Coop_Id, Loancontract_No, Item_Amt, DataRequest.TransactionDateTime, System_Code, Operate_Code, Cash_type, DataRequest.AcquirerTerminalNumber, DataRequest.TerminalSequenceNo, DataRequest.COOPCustomerAC.ToString("0000000000"), LogMessage, ta); } break; default: DataResponse.ResponseCode = ResponseCode.TransactionNotAuthorized; break; } } #endregion //####################################################################################################################### #region ฝากเงิน else if (DataRequest.TransactionCode == 43) //ใช้ชำระหนี้ หรือฝากเงิน { Payment Pay = new Payment(); switch (DataRequest.ToAccountCode.ToString("00")) { case "01": DataResponse.ResponseCode = ResponseCode.TransactionNotAuthorized; break; case "11": DataResponse.ResponseCode = ResponseCode.TransactionNotAuthorized; break; case "14": //ฝากเงินฝาก String Deptaccount_No = String.Empty; LogMessage.WriteLog("TransactionType", "Cancel Tranfer Deposit [ยกเลิก ฝากเงินฝาก] ####################"); Item_Amt = DataRequest.Amount1; LogMessage.WriteLog("Deposit Amount", Item_Amt.ToString("#,##0.00")); SqlGetAccount = "SELECT ACCOUNT_NO FROM ATMTRANSACTION WHERE MEMBER_NO = {0} AND CCS_OPERATE_DATE = {1}"; SqlGetAccount = WebUtil.SQLFormat(SqlGetAccount, Member_No, DataRequest.TransactionDateTime); LogMessage.WriteLog("TRANSACTION SQL", SqlGetAccount); dt = ta.Query(SqlGetAccount); RowCount = dt.GetRowCount(); if (RowCount != 1) { LogMessage.WriteLog("", "พบข้อมูลทั้งหมด = " + RowCount); return; } else if (dt.Next()) { Deptaccount_No = dt.GetString("ACCOUNT_NO"); LogMessage.WriteLog("", "DEPTACCOUNT_NO = " + Deptaccount_No); //###### ย้อนรายการ ###### String System_Code = "02"; //เงินฝาก String Operate_Code = "003"; //ประเภทฝาก String Cash_type = "TRN"; Pay.ProcessCancelPayment(Member_No, Coop_Id, Deptaccount_No, Item_Amt, DataRequest.TransactionDateTime, System_Code, Operate_Code, Cash_type, DataRequest.AcquirerTerminalNumber, DataRequest.TerminalSequenceNo, DataRequest.COOPCustomerAC.ToString("0000000000"), LogMessage, ta); } break; case "34": //ชำระเงินกู้ String Loancontract_No = String.Empty; LogMessage.WriteLog("TransactionType", "Tranfer Loan [ชำระเงินกู้] ####################"); Inq.LoanInquiry(Coop_Id, Member_No, LogMessage, ta); Item_Amt = DataRequest.Amount1; LogMessage.WriteLog("Payment Amount", Item_Amt.ToString("#,##0.00")); SqlGetAccount = "SELECT ACCOUNT_NO FROM ATMTRANSACTION WHERE MEMBER_NO = {0} AND CCS_OPERATE_DATE = {1}"; SqlGetAccount = WebUtil.SQLFormat(SqlGetAccount, Member_No, DataRequest.TransactionDateTime); LogMessage.WriteLog("TRANSACTION SQL", SqlGetAccount); dt = ta.Query(SqlGetAccount); RowCount = dt.GetRowCount(); if (RowCount != 1) { LogMessage.WriteLog("", "พบข้อมูลทั้งหมด = " + RowCount); return; } else if (dt.Next()) { Loancontract_No = dt.GetString("ACCOUNT_NO"); LogMessage.WriteLog("", "LOANACCOUNT_NO = " + Loancontract_No); //###### ย้อนรายการ ###### String System_Code = "01"; //เงินกู้ String Operate_Code = "003"; //ประเภทชำระหนี้ String Cash_type = "TRN"; Pay.ProcessCancelPayment(Member_No, Coop_Id, Loancontract_No, Item_Amt, DataRequest.TransactionDateTime, System_Code, Operate_Code, Cash_type, DataRequest.AcquirerTerminalNumber, DataRequest.TerminalSequenceNo, DataRequest.COOPCustomerAC.ToString("0000000000"), LogMessage, ta); } break; default: DataResponse.ResponseCode = ResponseCode.TransactionNotAuthorized; break; } } #endregion //####################################################################################################################### else { DataResponse.ResponseCode = ResponseCode.TransactionNotAuthorized; } } catch (Exception ex) { DataResponse.ResponseCode = ResponseCode.SystemError; Result = DataResponse.DataMassage; throw ex; } }
private void Transaction(DataEncode DataRequest, ref DataEncode DataResponse, Sta ta, LogMessage LogMessage) { try { String Member_No = DataRequest.COOPCustomerID.ToString("00000000"); String Coop_Id = DataRequest.COOPFIID; Decimal LedgerBalance = 0; Decimal AvailableBalance = 0; Decimal Item_Amt = 0; DataResponse.TransactionMessageCode = "0210"; //####################################################################################################################### #region ถอนสด if (DataRequest.TransactionCode == 10) //[ถอนเงินสด] (เงินออกทางตู้ ATM ทันที) { switch (DataRequest.FromAccountCode.ToString("00")) { case "01": DataResponse.ResponseCode = ResponseCode.TransactionNotAuthorized; break; case "11": DataResponse.ResponseCode = ResponseCode.TransactionNotAuthorized; break; case "14": //ถอนเงินฝาก String Deptaccount_No = String.Empty; LogMessage.WriteLog("TransactionType", "Cash Withdraw Deposit [ถอนเงินฝากแบบเงินสด] ####################"); Inq.DeptInquiry(Coop_Id, Member_No, LogMessage, ta); Item_Amt = DataRequest.Amount1; LogMessage.WriteLog("Withdraw Amount", Item_Amt.ToString("#,##0.00")); if (Inq.DeptHold == 1 || Inq.AccountHold == 1) //ปิดระบบเงินฝาก { LogMessage.WriteLog("DEPOSIT HOLD", "HOLD_FLAG = " + Inq.DeptHold.ToString() + " [1 = ปิดระบบเงินฝาก], ACCOUNT_HOLD = " + Inq.AccountHold + " [1 = อายัดบัญชีเงินฝาก]"); LogMessage.WriteLog("ResponseCode", "[" + ResponseCode.SystemNotAvailable + "] System Not Available"); DataResponse.ResponseCode = ResponseCode.SystemNotAvailable; return; } else { LogMessage.WriteLog("", "HOLD_FLAG = " + Inq.DeptHold.ToString()); LedgerBalance = Inq.LedgerBalance; //คงเหลือ AvailableBalance = Inq.AvailableBalance; //ถอนได้ Deptaccount_No = Inq.DeptaccountNo; } if (AvailableBalance < Item_Amt) { LogMessage.WriteLog("ResponseCode", "[" + ResponseCode.AmountExceededLimit + "] Amount Exceeded Limit เงินคงเหลือไม่เพียงพอ"); DataResponse.ResponseCode = ResponseCode.AmountExceededLimit; //เงินคงเหลือไม่เพียงพอ Result = DataResponse.DataMassage; return; } else { DataResponse.Amount3 = LedgerBalance - Item_Amt; //คงเหลือ //###### ตัดยอด ###### Receive Recv = new Receive(); String System_Code = "02"; //เงินฝาก String Operate_Code = "002"; //ประเภทถอน String Cash_type = "CSH"; Recv.ProcessWithdraw(Member_No, Coop_Id, Deptaccount_No, Item_Amt, DataRequest.TransactionDateTime, System_Code, Operate_Code, Cash_type, DataRequest.AcquirerTerminalNumber, DataRequest.TerminalSequenceNo, DataRequest.COOPCustomerAC.ToString("0000000000"), LogMessage, ta); } break; case "34": //กู้เงินกู้ String Loancontract_No = String.Empty; LogMessage.WriteLog("TransactionType", "Cash Withdraw Loan [ถอน(กู้เพิ่ม)เงินกู้แบบเงินสด] ####################"); Inq.LoanInquiry(Coop_Id, Member_No, LogMessage, ta); Item_Amt = DataRequest.Amount1; LogMessage.WriteLog("Withdraw Amount", Item_Amt.ToString("#,##0.00")); if (Inq.LoanHold == 1 || Inq.AccountHold == 1) //ปิดระบบเงินกู้ { LogMessage.WriteLog("", "HOLD_FLAG = " + Inq.LoanHold.ToString() + " [1 = ปิดระบบเงินกู้], ACCOUNT_HOLD = " + Inq.AccountHold + " [1 = อายัดสัญญาเงินกู้]"); LogMessage.WriteLog("ResponseCode", "[" + ResponseCode.SystemNotAvailable + "] System Not Available"); DataResponse.ResponseCode = ResponseCode.SystemNotAvailable; return; } else { LogMessage.WriteLog("", "HOLD_FLAG = " + Inq.LoanHold.ToString()); LedgerBalance = Inq.LedgerBalance; //คงเหลือ AvailableBalance = Inq.AvailableBalance; //ถอนได้ Loancontract_No = Inq.LoancontractNo; } if (AvailableBalance < Item_Amt) { LogMessage.WriteLog("ResponseCode", "[" + ResponseCode.AmountExceededLimit + "] Amount Exceeded Limit เงินคงเหลือไม่เพียงพอ"); DataResponse.ResponseCode = ResponseCode.AmountExceededLimit; //เงินคงเหลือไม่เพียงพอ Result = DataResponse.DataMassage; return; } else if (Item_Amt % 100 != 0) { LogMessage.WriteLog("ResponseCode", "[" + ResponseCode.InvalidAmount + "] Invalid Amount ถอนยอดมีเศษไม่ได้ = " + (Item_Amt % 100)); DataResponse.ResponseCode = ResponseCode.InvalidAmount; //เงินคงเหลือไม่เพียงพอ Result = DataResponse.DataMassage; return; } else { DataResponse.Amount3 = LedgerBalance - Item_Amt; //คงเหลือ //###### ตัดยอด ###### Receive Recv = new Receive(); String System_Code = "01"; //เงินกู้ String Operate_Code = "002"; //ประเภทถอน String Cash_type = "CSH"; Recv.ProcessWithdraw(Member_No, Coop_Id, Loancontract_No, Item_Amt, DataRequest.TransactionDateTime, System_Code, Operate_Code, Cash_type, DataRequest.AcquirerTerminalNumber, DataRequest.TerminalSequenceNo, DataRequest.COOPCustomerAC.ToString("0000000000"), LogMessage, ta); } break; default: DataResponse.ResponseCode = ResponseCode.TransactionNotAuthorized; break; } } #endregion //####################################################################################################################### #region ถอนโอน else if (DataRequest.TransactionCode == 42) //ถอนเงินแบบโอน { switch (DataRequest.FromAccountCode.ToString("00")) { case "01": DataResponse.ResponseCode = ResponseCode.TransactionNotAuthorized; break; case "11": DataResponse.ResponseCode = ResponseCode.TransactionNotAuthorized; break; case "14": //ถอนเงินฝาก String Deptaccount_No = String.Empty; LogMessage.WriteLog("TransactionType", "Cash Withdraw Deposit [ถอนเงินฝากแบบโอนเข้าบัญชี] ####################"); Inq.DeptInquiry(Coop_Id, Member_No, LogMessage, ta); Item_Amt = DataRequest.Amount1; LogMessage.WriteLog("Withdraw Amount", Item_Amt.ToString("#,##0.00")); if (Inq.DeptHold == 1 || Inq.AccountHold == 1) //ปิดระบบเงินฝาก { LogMessage.WriteLog("", "HOLD_FLAG = " + Inq.DeptHold.ToString() + " [1 = ปิดระบบเงินฝาก], ACCOUNT_HOLD = " + Inq.AccountHold + " [1 = อายัดบัญชีเงินฝาก]"); LogMessage.WriteLog("ResponseCode", "[" + ResponseCode.SystemNotAvailable + "] System Not Available"); DataResponse.ResponseCode = ResponseCode.SystemNotAvailable; return; } else { LogMessage.WriteLog("", "HOLD_FLAG = " + Inq.DeptHold.ToString()); LedgerBalance = Inq.LedgerBalance; //คงเหลือ AvailableBalance = Inq.AvailableBalance; //ถอนได้ Deptaccount_No = Inq.DeptaccountNo; } if (AvailableBalance < Item_Amt) { LogMessage.WriteLog("ResponseCode", "[" + ResponseCode.AmountExceededLimit + "] Amount Exceeded Limit เงินคงเหลือไม่เพียงพอ"); DataResponse.ResponseCode = ResponseCode.AmountExceededLimit; //เงินคงเหลือไม่เพียงพอ Result = DataResponse.DataMassage; return; } else { DataResponse.Amount3 = LedgerBalance - Item_Amt; //คงเหลือ //###### ตัดยอด ###### Receive Recv = new Receive(); String System_Code = "02"; //เงินฝาก String Operate_Code = "002"; //ประเภทถอน String Cash_type = "TRN"; Recv.ProcessWithdraw(Member_No, Coop_Id, Deptaccount_No, Item_Amt, DataRequest.TransactionDateTime, System_Code, Operate_Code, Cash_type, DataRequest.AcquirerTerminalNumber, DataRequest.TerminalSequenceNo, DataRequest.COOPCustomerAC.ToString("0000000000"), LogMessage, ta); } break; case "34": //กู้เงินกู้ String Loancontract_No = String.Empty; LogMessage.WriteLog("TransactionType", "Tranfer Withdraw Loan [ถอน(กู้เพิ่ม)เงินกู้แบบโอน] ####################"); Inq.LoanInquiry(Coop_Id, Member_No, LogMessage, ta); Item_Amt = DataRequest.Amount1; LogMessage.WriteLog("Withdraw Amount", Item_Amt.ToString("#,##0.00")); if (Inq.LoanHold == 1 || Inq.AccountHold == 1) //ปิดระบบเงินกู้ { LogMessage.WriteLog("", "HOLD_FLAG = " + Inq.LoanHold.ToString() + " [1 = ปิดระบบเงินกู้], ACCOUNT_HOLD = " + Inq.AccountHold + " [1 = อายัดสัญญาเงินกู้]"); LogMessage.WriteLog("ResponseCode", "[" + ResponseCode.SystemNotAvailable + "] System Not Available"); DataResponse.ResponseCode = ResponseCode.SystemNotAvailable; return; } else { LogMessage.WriteLog("", "HOLD_FLAG = " + Inq.LoanHold.ToString()); LedgerBalance = Inq.LedgerBalance; //คงเหลือ AvailableBalance = Inq.AvailableBalance; //ถอนได้ Loancontract_No = Inq.LoancontractNo; } if (AvailableBalance < Item_Amt) { LogMessage.WriteLog("ResponseCode", "[" + ResponseCode.AmountExceededLimit + "] Amount Exceeded Limit เงินคงเหลือไม่เพียงพอ"); DataResponse.ResponseCode = ResponseCode.AmountExceededLimit; //เงินคงเหลือไม่เพียงพอ Result = DataResponse.DataMassage; return; } else if (Item_Amt % 100 != 0) { LogMessage.WriteLog("ResponseCode", "[" + ResponseCode.InvalidAmount + "] Invalid Amount ถอนยอดมีเศษไม่ได้ = " + (Item_Amt % 100)); DataResponse.ResponseCode = ResponseCode.InvalidAmount; //เงินคงเหลือไม่เพียงพอ Result = DataResponse.DataMassage; return; } else { DataResponse.Amount3 = LedgerBalance - Item_Amt; //คงเหลือ //###### ตัดยอด ###### Receive Recv = new Receive(); String System_Code = "01"; //เงินกู้ String Operate_Code = "002"; //ประเภทถอน String Cash_type = "TRN"; Recv.ProcessWithdraw(Member_No, Coop_Id, Loancontract_No, Item_Amt, DataRequest.TransactionDateTime, System_Code, Operate_Code, Cash_type, DataRequest.AcquirerTerminalNumber, DataRequest.TerminalSequenceNo, DataRequest.COOPCustomerAC.ToString("0000000000"), LogMessage, ta); } break; default: DataResponse.ResponseCode = ResponseCode.TransactionNotAuthorized; break; } } #endregion //####################################################################################################################### #region ฝากเงิน else if (DataRequest.TransactionCode == 43) //ใช้ชำระหนี้ หรือฝากเงิน { Payment Pay = new Payment(); switch (DataRequest.ToAccountCode.ToString("00")) { case "01": DataResponse.ResponseCode = ResponseCode.TransactionNotAuthorized; break; case "11": DataResponse.ResponseCode = ResponseCode.TransactionNotAuthorized; break; case "14": //ฝากเงินฝาก String Deptaccount_No = String.Empty; LogMessage.WriteLog("TransactionType", "Tranfer Deposit [ฝากเงินฝาก] ####################"); Inq.DeptInquiry(Coop_Id, Member_No, LogMessage, ta); Item_Amt = DataRequest.Amount1; LogMessage.WriteLog("Deposit Amount", Item_Amt.ToString("#,##0.00")); if (Inq.DeptHold == 1 || Inq.AccountHold == 1) //ปิดระบบเงินฝาก { LogMessage.WriteLog("", "HOLD_FLAG = " + Inq.DeptHold.ToString() + " [1 = ปิดระบบเงินฝาก], ACCOUNT_HOLD = " + Inq.AccountHold + " [1 = อายัดบัญชีเงินฝาก]"); LogMessage.WriteLog("ResponseCode", "[" + ResponseCode.SystemNotAvailable + "] System Not Available"); DataResponse.ResponseCode = ResponseCode.SystemNotAvailable; return; } else { LogMessage.WriteLog("", "HOLD_FLAG = " + Inq.DeptHold.ToString()); LedgerBalance = Inq.LedgerBalance; //คงเหลือ AvailableBalance = Inq.AvailableBalance; //ถอนได้ Deptaccount_No = Inq.DeptaccountNo; } String Sharp = "00000000000000000000"; String DeptTranfer = DataRequest.COOPCustomerAC.ToString(Sharp.Substring(0, Deptaccount_No.Length)); LogMessage.WriteLog("", "MEMBER_NO = " + Member_No + ", DEPOSIT_TRANFER = " + DeptTranfer + " (ข้อมูลธนาคารฝากเข้าบัญชี)"); LogMessage.WriteLog("", "DEPTACCOUNT_NO = " + Deptaccount_No + " (เลขบัญชีสหกรณ์ที่ผู้ไว้กับสมาชิก)"); if (DeptTranfer != Deptaccount_No) { LogMessage.WriteLog("ResponseCode", "[" + ResponseCode.InvalidAccountType + "] Invalid Account Type or Contact number"); DataResponse.ResponseCode = ResponseCode.InvalidAccountType; return; } else { DataResponse.Amount3 = LedgerBalance + Item_Amt; //คงเหลือ //###### ตัดยอด ###### String System_Code = "02"; //เงินฝาก String Operate_Code = "003"; //ประเภทฝาก String Cash_type = "TRN"; Pay.ProcessPayment(Member_No, Coop_Id, Deptaccount_No, Item_Amt, DataRequest.TransactionDateTime, System_Code, Operate_Code, Cash_type, DataRequest.AcquirerTerminalNumber, DataRequest.TerminalSequenceNo, DataRequest.COOPCustomerAC.ToString("0000000000"), LogMessage, ta); } break; case "34": //ชำระเงินกู้ String Loancontract_No = String.Empty; LogMessage.WriteLog("TransactionType", "Tranfer Loan [ชำระเงินกู้] ####################"); Inq.LoanInquiry(Coop_Id, Member_No, LogMessage, ta); Item_Amt = DataRequest.Amount1; LogMessage.WriteLog("Payment Amount", Item_Amt.ToString("#,##0.00")); if (Inq.LoanHold == 1 || Inq.AccountHold == 1) //ปิดระบบเงินฝาก { LogMessage.WriteLog("", "HOLD_FLAG = " + Inq.LoanHold.ToString() + " [1 = ปิดระบบเงินกู้], ACCOUNT_HOLD = " + Inq.AccountHold + " [1 = อายัดสัญญาเงินกู้]"); LogMessage.WriteLog("ResponseCode", "[" + ResponseCode.SystemNotAvailable + "] System Not Available"); DataResponse.ResponseCode = ResponseCode.SystemNotAvailable; return; } else { LedgerBalance = Inq.LedgerBalance; //คงเหลือ AvailableBalance = Inq.AvailableBalance; //ถอนได้ Loancontract_No = Inq.LoancontractNo; } String LoanTranfer = DataRequest.COOPCustomerAC.ToString("00000000"); //ใช้อ้างอิงเลขที่ ขั้นต่ำ 10 หลัก โดยหลักการจะให้ใส่เลขที่สัญญาที่จะทำการชำระ LogMessage.WriteLog("", "MEMBER_NO = " + Member_No + " (เลขที่สมาชิกที่ใช้ชำระหนี้)"); LogMessage.WriteLog("", "LOANCONTRACT_NO = " + Loancontract_No + " (เลขบัญชีสหกรณ์ที่ผู้ไว้กับสมาชิก)"); LogMessage.WriteLog("", "TRANFER_NO = " + LoanTranfer + " (เลขที่อ้างอิง)"); if (LoanTranfer != Inq.Member_No && false) { LogMessage.WriteLog("ResponseCode", "[" + ResponseCode.InvalidAccountType + "] Invalid Account Type or Contact number"); DataResponse.ResponseCode = ResponseCode.InvalidAccountType; return; } else { DataResponse.Amount3 = LedgerBalance + Item_Amt; //คงเหลือ //###### ตัดยอด ###### String System_Code = "01"; //เงินกู้ String Operate_Code = "003"; //ประเภทชำระหนี้ String Cash_type = "TRN"; Pay.ProcessPayment(Member_No, Coop_Id, Loancontract_No, Item_Amt, DataRequest.TransactionDateTime, System_Code, Operate_Code, Cash_type, DataRequest.AcquirerTerminalNumber, DataRequest.TerminalSequenceNo, DataRequest.COOPCustomerAC.ToString("0000000000"), LogMessage, ta); } break; default: DataResponse.ResponseCode = ResponseCode.TransactionNotAuthorized; break; } } #endregion //####################################################################################################################### else { DataResponse.ResponseCode = ResponseCode.TransactionNotAuthorized; } } catch (Exception ex) { DataResponse.ResponseCode = ResponseCode.SystemError; Result = DataResponse.DataMassage; throw ex; } }
protected void Page_Load(object sender, EventArgs e) { String SqlRequest = String.Empty; String SqlResponse = String.Empty; Sta ta = new Sta(); Sta taCommit = new Sta(); String LogFileName = DateTime.Now.ToString("yyyyMMdd") + ".txt"; try { String DataMessage = Request["DataMassage"]; try { LogFileName = DateTime.Now.ToString("yyyyMMdd") + DataMessage.Substring(157, 10) + ".txt"; } catch { } LogMessage = new LogMessage(LogFileName); LogMessage.WriteLog("Request", DataMessage); //เชค Online ใน AppTest if (DataMessage == "TestWCF") { Result = "1"; return; } //ตรวจสอบข้อมูล CheckLength(ref DataMessage); //จัดการข้อมูล DataEncode DataRequest = new DataEncode(DataMessage); DataEncode DataResponse = new DataEncode(DataMessage); try { taCommit.Transection(); ta.Transection(); } catch (Exception ex) { DataResponse.ResponseCode = ResponseCode.DatabaseProblem; Result = DataResponse.DataMassage; LogMessage.WriteLog("Database Problem", ""); throw ex; } //############################################################################# DataResponse.ResponseCode = ResponseCode.SystemError; //ป้องกันการ Error Exception SqlResponse = DataResponse.GetInsertATMACT(); Result = DataResponse.DataMassage; DataResponse.ResponseCode = ResponseCode.Approve; //############################################################################# SqlRequest = DataRequest.GetInsertATMACT();//บันทึกลงตาราง ATMACT เก็บ LOG การ Request LogMessage.WriteLog("LOGREQ SQL", SqlRequest); taCommit.Exe(SqlRequest); //############################################################################# try { //ตรวจสอบ Request switch (DataRequest.TransactionMessageCode) { case "0100": // Account Name Inquiry [ถามชื่อบัญชี] AccountNameInquiry(DataRequest, ref DataResponse, ta, LogMessage); break; case "0700": //Balance Inquiry BalanceInquiry(DataRequest, ref DataResponse, ta, LogMessage); break; case "0200": // Fund Transfer //Money Withdraw Transaction(DataRequest, ref DataResponse, ta, LogMessage); break; case "0400": //Fund Transfer/ Cash Withdraw Reversal Request[ยกเลิกรายการทันที] CancelTransaction(DataRequest, ref DataResponse, ta, LogMessage); break; default: break; } } catch (Exception ex) { if (DataResponse.ResponseCode == 0) { DataResponse.ResponseCode = ResponseCode.SystemError; } LogMessage.WriteLog("ResponseCode", "[" + DataResponse.ResponseCode + "]"); Result = DataResponse.DataMassage; SqlResponse = DataResponse.GetInsertATMACT(); throw ex; } Result = DataResponse.DataMassage; SqlResponse = DataResponse.GetInsertATMACT();//บันทึกลงตาราง ATMACT เก็บ LOG การ Response LogMessage.WriteLog("LOGRES SQL", SqlResponse); taCommit.Exe(SqlResponse); taCommit.Commit(); ta.Commit(); taCommit.Close(); ta.Close(); } catch (Exception ex) { LogMessage.WriteLog("ExceptionErr", ex.Message.Trim()); try { ta.RollBack(); ta.Close(); } catch { } try { try { LogMessage.WriteLog("LOGRES SQL", SqlResponse); taCommit.Exe(SqlResponse); } catch { } taCommit.Commit(); taCommit.Close(); } catch { } } LogMessage.WriteLog("Response", Result); LogMessage.WriteLog("", "-------------------------------------------------------------------------------\r\n"); }
private void BalanceInquiry(DataEncode DataRequest, ref DataEncode DataResponse, Sta ta, LogMessage LogMessage) { try { DataResponse.TransactionMessageCode = "0710"; if (DataRequest.TransactionCode == 30) { if (DataRequest.FromAccountCode == 14) //COOP Deposit Account [ถามยอดเงินฝาก] { LogMessage.WriteLog("TransactionType", "Inquiry Deposit [สอบถามยอดเงินฝาก] ####################"); Inq.DeptInquiry(DataRequest.COOPFIID, DataRequest.COOPCustomerID.ToString("00000000"), LogMessage, ta); if (Inq.DeptHold == 1 || Inq.AccountHold == 1) //ปิดระบบเงินฝาก { LogMessage.WriteLog("DEPT HOLD", "HOLD_FLAG = " + Inq.DeptHold.ToString() + " [1 = ปิดระบบเงินฝาก], ACCOUNT_HOLD = " + Inq.AccountHold + " [1 = อายัดบัญชีเงินฝาก]"); LogMessage.WriteLog("ResponseCode", "[" + ResponseCode.SystemNotAvailable + "] System Not Available"); DataResponse.ResponseCode = ResponseCode.SystemNotAvailable; } else { DataResponse.Amount2 = Inq.LedgerBalance; //คงเหลือ DataResponse.Amount3 = Inq.AvailableBalance; //ถอนได้ } } else if (DataRequest.FromAccountCode == 34) //COOP Loan Account [ถามยอดเงินกู้] { LogMessage.WriteLog("TransactionType", "Inquiry Loan [สอบถามยอดเงินกู้] ####################"); Inq.LoanInquiry(DataRequest.COOPFIID, DataRequest.COOPCustomerID.ToString("00000000"), LogMessage, ta); if (Inq.LoanHold == 1 || Inq.AccountHold == 1) //ปิดระบบเงินกู้ { LogMessage.WriteLog("LOAN HOLD", "HOLD_FLAG = " + Inq.LoanHold.ToString() + " [1 = ปิดระบบเงินกู้], ACCOUNT_HOLD = " + Inq.AccountHold + " [1 = อายัดสัญญาเงินกู้]"); LogMessage.WriteLog("ResponseCode", "[" + ResponseCode.SystemNotAvailable + "] System Not Available"); DataResponse.ResponseCode = ResponseCode.SystemNotAvailable; } else { DataResponse.Amount2 = Inq.LedgerBalance; //คงเหลือ DataResponse.Amount3 = Inq.AvailableBalance; //ถอนได้ } } else { DataResponse.ResponseCode = ResponseCode.MessageEditError; //ข้อความไม่ถูกต้อง } } else { DataResponse.ResponseCode = ResponseCode.MessageEditError; //ข้อความไม่ถูกต้อง } } catch (Exception ex) { throw ex; } }
private void AccountNameInquiry(DataEncode DataRequest, ref DataEncode DataResponse, Sta ta, LogMessage LogMessage) { try { DataResponse.TransactionMessageCode = "0110"; ServiceOther ServiceOTH = new ServiceOther(); if (DataRequest.TransactionCode == 31) //To AC : name Query [***ห้ามเป็นภาษาไทย] { String Member_Name = ""; Member_Name = ServiceOTH.GetAccountName(DataRequest.COOPCustomerID.ToString("00000000"), LogMessage, ta); if (Member_Name == "") { LogMessage.WriteLog("", "NOT HAVE ACCOUNT IN COOP (ไม่พบเลขทะเบียนสมาชิกนี้ในระบบ)"); DataResponse.ResponseCode = ResponseCode.AccountNotAuthorize; LogMessage.WriteLog("ResponseCode", "[" + ResponseCode.AccountNotAuthorize + "] Account not authorize, Contact bank"); } else { DataResponse.IssuerReference = Member_Name; } } } catch (Exception ex) { Result = DataResponse.DataMassage; throw ex; } }
public string FTP_TXHays(string streetno, string direction, string streetname, string city, string streettype, string unitnumber, string ownernm, string parcelNumber, string searchType, string orderNumber, string directParcel) { GlobalClass.global_orderNo = orderNumber; HttpContext.Current.Session["orderNo"] = orderNumber; GlobalClass.global_parcelNo = parcelNumber; string StartTime = "", AssessmentTime = "", TaxTime = "", CitytaxTime = "", LastEndTime = ""; var driverService = PhantomJSDriverService.CreateDefaultService(); driverService.HideCommandPromptWindow = true; //driver = new PhantomJSDriver(); //driver = new ChromeDriver(); using (driver = new PhantomJSDriver()) //ChromeDriver { try { StartTime = DateTime.Now.ToString("HH:mm:ss"); if (searchType == "titleflex") { string titleaddress = streetno + " " + streetname + " " + streettype + " " + unitnumber; gc.TitleFlexSearch(orderNumber, "", "", titleaddress, "TX", "Hays"); if ((HttpContext.Current.Session["TitleFlex_Search"] != null && HttpContext.Current.Session["TitleFlex_Search"].ToString() == "Yes")) { driver.Quit(); return("MultiParcel"); } else if (HttpContext.Current.Session["titleparcel"].ToString() == "") { HttpContext.Current.Session["Nodata_TXHays"] = "Yes"; driver.Quit(); return("No Data Found"); } parcelNumber = HttpContext.Current.Session["titleparcel"].ToString(); searchType = "parcel"; } if (searchType == "address") { driver.Navigate().GoToUrl("http://esearch.hayscad.com/"); Thread.Sleep(2000); IJavaScriptExecutor js2 = driver as IJavaScriptExecutor; IWebElement ParcelLinkSearch1 = driver.FindElement(By.XPath("//*[@id='home-page-tabs']/li[3]/a")); js2.ExecuteScript("arguments[0].click();", ParcelLinkSearch1); Thread.Sleep(2000); driver.FindElement(By.XPath("//*[@id='StreetNumber']")).SendKeys(streetno); driver.FindElement(By.XPath("//*[@id='StreetName']")).SendKeys(streetname); driver.FindElement(By.XPath("//*[@id='index-search']/div[4]/div/div/button")).SendKeys(Keys.Enter); Thread.Sleep(5000); aaa = driver.FindElement(By.XPath("//*[@id='page-header']")).Text; parcel = gc.Between(aaa, "Page 1 of 1 - ", " (").Trim(); if (parcel == "Total: 1") { gc.CreatePdf_WOP(orderNumber, "Owner", driver, "TX", "Hays"); var chDriver = new ChromeDriver(); chDriver.Navigate().GoToUrl(driver.Url); Thread.Sleep(4000); IWebElement Multiaddresstable = chDriver.FindElement(By.XPath("//*[@id='grid']/div[2]/table/tbody")); IList <IWebElement> multiaddressrow = Multiaddresstable.FindElements(By.TagName("tr")); IList <IWebElement> Multiaddressid; foreach (IWebElement Multiaddress in multiaddressrow) { Multiaddressid = Multiaddress.FindElements(By.TagName("td")); if (Multiaddressid.Count != 0) { parcel = Multiaddressid[1].Text; } } gc.CreatePdf_WOP(orderNumber, "Owner Address search1", driver, "TX", "Hays"); //ByVisibleElement(chDriver.FindElement(By.Id("DownloadResults"))); gc.CreatePdf_WOP(orderNumber, "Owner Address search2", driver, "TX", "Hays"); driver.Navigate().GoToUrl("http://esearch.hayscad.com/Property/View/" + parcel + ""); Thread.Sleep(2000); gc.CreatePdf_WOP(orderNumber, "Owner Address search1", driver, "TX", "Hays"); chDriver.Quit(); } else { try { var chDriver = new ChromeDriver(); chDriver.Navigate().GoToUrl(driver.Url); Thread.Sleep(4000); IWebElement MultiAddressTB = chDriver.FindElement(By.XPath("//*[@id='grid']/div[2]/table/tbody")); IList <IWebElement> MultiAddressTR = MultiAddressTB.FindElements(By.TagName("tr")); IList <IWebElement> MultiAddressTD; gc.CreatePdf_WOP(orderNumber, "Multi Address search", driver, "TX", "Hays"); int AddressmaxCheck = 0; foreach (IWebElement MultiAddress in MultiAddressTR) { if (AddressmaxCheck <= 25) { MultiAddressTD = MultiAddress.FindElements(By.TagName("td")); if (MultiAddressTD.Count != 0 && !MultiAddress.Text.Contains("Mobile Home")) { Parcelno = MultiAddressTD[1].Text; Multi_Type = MultiAddressTD[5].Text; Owner = MultiAddressTD[6].Text; Property_Address = MultiAddressTD[7].Text; MultiAddress_details = Multi_Type + "~" + Owner + "~" + Property_Address; gc.insert_date(orderNumber, Parcelno, 1002, MultiAddress_details, 1, DateTime.Now); } AddressmaxCheck++; } } if (MultiAddressTR.Count > 25) { HttpContext.Current.Session["multiParcel_TXHays_Multicount"] = "Maximum"; } else { HttpContext.Current.Session["multiParcel_TXHays"] = "Yes"; } chDriver.Quit(); return("MultiParcel"); } catch { } } } if (searchType == "parcel") { driver.Navigate().GoToUrl("http://esearch.hayscad.com/"); Thread.Sleep(2000); IJavaScriptExecutor js1 = driver as IJavaScriptExecutor; IWebElement ParcelLinkSearch = driver.FindElement(By.XPath("//*[@id='home-page-tabs']/li[4]/a")); js1.ExecuteScript("arguments[0].click();", ParcelLinkSearch); Thread.Sleep(2000); driver.FindElement(By.Id("PropertyId")).SendKeys(parcelNumber); gc.CreatePdf(orderNumber, parcelNumber, "ParcelSearch", driver, "TX", "Hays"); driver.FindElement(By.XPath("//*[@id='index-search']/div[4]/div/div/button")).SendKeys(Keys.Enter); Thread.Sleep(2000); driver.FindElement(By.XPath("//*[@id='grid']/div[2]/table/tbody/tr/td[2]")).Click(); Thread.Sleep(5000); gc.CreatePdf(orderNumber, parcelNumber, "ParcelSearch1", driver, "TX", "Hays"); } if (searchType == "ownername") { driver.Navigate().GoToUrl("http://esearch.hayscad.com/"); Thread.Sleep(2000); IJavaScriptExecutor js3 = driver as IJavaScriptExecutor; IWebElement ParcelLinkSearch2 = driver.FindElement(By.XPath("//*[@id='home-page-tabs']/li[2]/a")); js3.ExecuteScript("arguments[0].click();", ParcelLinkSearch2); Thread.Sleep(2000); driver.FindElement(By.Id("OwnerName")).SendKeys(ownernm); gc.CreatePdf_WOP(orderNumber, "Owner search", driver, "TX", "Hays"); driver.FindElement(By.XPath("//*[@id='index-search']/div[4]/div/div/button")).SendKeys(Keys.Enter); Thread.Sleep(2000); aaa = driver.FindElement(By.XPath("//*[@id='page-header']")).Text; parcel = gc.Between(aaa, "Page 1 of 1 - ", " (").Trim(); if (parcel == "Total: 1") { gc.CreatePdf_WOP(orderNumber, "Owner", driver, "TX", "Hays"); var chDriver = new ChromeDriver(); chDriver.Navigate().GoToUrl(driver.Url); Thread.Sleep(4000); IWebElement Multiaddresstable = chDriver.FindElement(By.XPath("//*[@id='grid']/div[2]/table/tbody")); IList <IWebElement> multiaddressrow = Multiaddresstable.FindElements(By.TagName("tr")); IList <IWebElement> Multiaddressid; foreach (IWebElement Multiaddress in multiaddressrow) { Multiaddressid = Multiaddress.FindElements(By.TagName("td")); if (Multiaddressid.Count != 0) { parcel = Multiaddressid[1].Text; } } gc.CreatePdf_WOP(orderNumber, "Owner search1", driver, "TX", "Hays"); //ByVisibleElement(chDriver.FindElement(By.Id("DownloadResults"))); gc.CreatePdf_WOP(orderNumber, "Owner Search2", driver, "TX", "Hays"); driver.Navigate().GoToUrl("http://esearch.hayscad.com/Property/View/" + parcel + ""); Thread.Sleep(2000); gc.CreatePdf_WOP(orderNumber, "Owner search3", driver, "TX", "Hays"); chDriver.Quit(); } else { try { var chDriver = new ChromeDriver(); chDriver.Navigate().GoToUrl(driver.Url); Thread.Sleep(4000); IWebElement MultiAddressTB = chDriver.FindElement(By.XPath("//*[@id='grid']/div[2]/table/tbody")); IList <IWebElement> MultiAddressTR = MultiAddressTB.FindElements(By.TagName("tr")); IList <IWebElement> MultiAddressTD; gc.CreatePdf_WOP(orderNumber, "Multi Address search", driver, "TX", "Hays"); int AddressmaxCheck = 0; foreach (IWebElement MultiAddress in MultiAddressTR) { if (AddressmaxCheck <= 25) { MultiAddressTD = MultiAddress.FindElements(By.TagName("td")); if (MultiAddressTD.Count != 0 && !MultiAddress.Text.Contains("Mobile Home")) { Parcelno = MultiAddressTD[1].Text; Multi_Type = MultiAddressTD[5].Text; Owner = MultiAddressTD[6].Text; Property_Address = MultiAddressTD[7].Text; MultiAddress_details = Multi_Type + "~" + Owner + "~" + Property_Address; gc.insert_date(orderNumber, Parcelno, 1002, MultiAddress_details, 1, DateTime.Now); } AddressmaxCheck++; } } if (MultiAddressTR.Count > 25) { HttpContext.Current.Session["multiParcel_TXHays_Multicount"] = "Maximum"; } else { HttpContext.Current.Session["multiParcel_TXHays"] = "Yes"; } chDriver.Quit(); return("MultiParcel"); } catch { } } } try { IWebElement INodata = driver.FindElement(By.Id("results-page")); if (INodata.Text.Contains("Page 1 of 0 - Total: 0")) { HttpContext.Current.Session["Nodata_TXHays"] = "Yes"; driver.Quit(); return("No Data Found"); } } catch { } //Property Details try { IList <IWebElement> tables1 = driver.FindElements(By.XPath("//*[@id='detail-page']/div/div[1]/div/table")); int count1 = tables1.Count; foreach (IWebElement tab1 in tables1) { if (tab1.Text.Contains("Account")) { IList <IWebElement> ProTR = tab1.FindElements(By.TagName("tr")); IList <IWebElement> ProTD; IList <IWebElement> ProTH; foreach (IWebElement Pro in ProTR) { ProTD = Pro.FindElements(By.TagName("td")); ProTH = Pro.FindElements(By.TagName("th")); if (!Pro.Text.Contains("Account") && !Pro.Text.Contains("Location") && !Pro.Text.Contains("% Ownership:") && !Pro.Text.Contains("Agent Code:")) { Parcel = ProTH[0].Text; if (Parcel.Contains("Property ID:")) { Parcel_ID = ProTD[0].Text; } Legal = ProTH[0].Text; if (Legal.Contains("Legal Description:")) { Legal_Desp = ProTD[0].Text; } Graphic = ProTH[0].Text; if (Graphic.Contains("Geographic ID:")) { Graphic_Id = ProTD[0].Text; } Tap = ProTH[0].Text; if (Tap.Contains("Type:")) { Type = ProTD[0].Text; } Adds = ProTH[0].Text; if (Adds.Contains("Address:")) { Pro_Addrs = ProTD[0].Text; } Maps = ProTH[0].Text; if (Maps.Contains("Map ID:")) { Map = ProTD[0].Text; } Nighber = ProTH[0].Text; if (Nighber.Contains("Neighborhood CD:")) { Nighberhood = ProTD[0].Text; } Own_Id = ProTH[0].Text; if (Own_Id.Contains("Owner ID:")) { Owner_Id = ProTD[0].Text; } Nam = ProTH[0].Text; if (Nam.Contains("Name:")) { Name = ProTD[0].Text; } Mailing_Addrs = ProTH[0].Text; if (Mailing_Addrs.Contains("Mailing Address:")) { Mailing_Address = ProTD[0].Text; } Exmp = ProTH[0].Text; if (Exmp.Contains("Exemptions:")) { Excemptions = ProTD[0].Text; } } } try { Year_Built = driver.FindElement(By.XPath("//*[@id='detail-page']/div[5]/div[2]/table[1]/tbody/tr[2]/td[4]")).Text; Acres = driver.FindElement(By.XPath("//*[@id='detail-page']/div[6]/div[2]/table/tbody/tr[2]/td[3]")).Text; } catch { } Property_Details = Legal_Desp + "~" + Graphic_Id + "~" + Type + "~" + Pro_Addrs + "~" + Map + "~" + Nighberhood + "~" + Owner_Id + "~" + Name + "~" + Mailing_Address + "~" + Excemptions + "~" + Acres + "~" + Year_Built; gc.CreatePdf(orderNumber, Parcel_ID, "Property Details", driver, "TX", "Hays"); gc.insert_date(orderNumber, Parcel_ID, 1003, Property_Details, 1, DateTime.Now); } } } catch { } //Values Details try { IList <IWebElement> tables2 = driver.FindElements(By.XPath("//*[@id='detail-page']/div/div[2]/div/table")); int count2 = tables2.Count; foreach (IWebElement tab2 in tables2) { if (tab2.Text.Contains("Improvement Homesite Value:")) { IList <IWebElement> AssemntTR = tab2.FindElements(By.TagName("tr")); IList <IWebElement> AssemntTD; IList <IWebElement> AssemntTH; foreach (IWebElement Assemnt in AssemntTR) { AssemntTD = Assemnt.FindElements(By.TagName("td")); AssemntTH = Assemnt.FindElements(By.TagName("th")); if (Assemnt.Text != " ") { Imp_Home = AssemntTH[0].Text; if (Imp_Home.Contains("Improvement Homesite Value:")) { Imp_Homesite = AssemntTD[0].Text; } Imp_NonHome = AssemntTH[0].Text; if (Imp_NonHome.Contains("Improvement Non-Homesite Value:")) { Imp_NonHomesite = AssemntTD[0].Text; } Land = AssemntTH[0].Text; if (Land.Contains("Land Homesite Value:")) { Land_Homesite = AssemntTD[0].Text; } Non_Land = AssemntTH[0].Text; if (Non_Land.Contains("Land Non-Homesite Value:")) { Land_NonHomesite = AssemntTD[0].Text; } Agricutr = AssemntTH[0].Text; if (Agricutr.Contains("Agricultural Market Valuation:")) { Agri_Markt = AssemntTD[0].Text; } Mrkt = AssemntTH[0].Text; if (Mrkt.Contains("Market Value:")) { Mrkt_Value = AssemntTD[0].Text; } Ag_Value = AssemntTH[0].Text; if (Ag_Value.Contains("Ag Use Value:")) { AgUse_Value = AssemntTD[0].Text; } App_Value = AssemntTH[0].Text; if (App_Value.Contains("Appraised Value:")) { Appraised_Value = AssemntTD[0].Text; } Home_Cap = AssemntTH[0].Text; if (Home_Cap.Contains("Homestead Cap Loss:")) { Homested_Cap = AssemntTD[0].Text; } Assd_Value = AssemntTH[0].Text; if (Assd_Value.Contains("Assessed Value:")) { Assessed_Value = AssemntTD[0].Text; } } } Assessment_Details = Imp_Homesite + "~" + Imp_NonHomesite + "~" + Land_Homesite + "~" + Land_NonHomesite + "~" + Agri_Markt + "~" + Mrkt_Value + "~" + AgUse_Value + "~" + Appraised_Value + "~" + Homested_Cap + "~" + Assessed_Value; gc.insert_date(orderNumber, Parcel_ID, 1006, Assessment_Details, 1, DateTime.Now); } } } catch { } AssessmentTime = DateTime.Now.ToString("HH:mm:ss"); //Jurisdiction Details try { IWebElement JurisdictionTB = driver.FindElement(By.XPath("//*[@id='detail-page']/div[4]/div[2]/table/tbody")); IList <IWebElement> JurisdictionTR = JurisdictionTB.FindElements(By.TagName("tr")); IList <IWebElement> JurisdictionTD; foreach (IWebElement Jurisdiction in JurisdictionTR) { JurisdictionTD = Jurisdiction.FindElements(By.TagName("td")); if (JurisdictionTD.Count != 0 && !Jurisdiction.Text.Contains("Entity")) { Entity = JurisdictionTD[0].Text; Desp = JurisdictionTD[1].Text; Mrket_Value = JurisdictionTD[2].Text; Txble_Value = JurisdictionTD[3].Text; Jurisdiction_details = Entity + "~" + Desp + "~" + Mrket_Value + "~" + Txble_Value; gc.insert_date(orderNumber, Parcel_ID, 1007, Jurisdiction_details, 1, DateTime.Now); } } } catch { } //RollValue Details try { IList <IWebElement> tables4 = driver.FindElements(By.XPath("//*[@id='detail-page']/div/div[2]/table")); int count4 = tables4.Count; foreach (IWebElement tab4 in tables4) { if (tab4.Text.Contains("HS Cap Loss")) { IList <IWebElement> RollValueTR = tab4.FindElements(By.TagName("tr")); IList <IWebElement> RollValueTD; foreach (IWebElement RollValue in RollValueTR) { RollValueTD = RollValue.FindElements(By.TagName("td")); if (RollValueTD.Count != 0 && !RollValue.Text.Contains("Year")) { Year = RollValueTD[0].Text; Improv = RollValueTD[1].Text; lnd_Mrkt = RollValueTD[2].Text; Ag_Valution = RollValueTD[3].Text; Appraised = RollValueTD[4].Text; HS_Cap = RollValueTD[5].Text; Pro_Assed = RollValueTD[6].Text; RollValue_details = Year + "~" + Improv + "~" + lnd_Mrkt + "~" + Ag_Valution + "~" + Appraised + "~" + HS_Cap + "~" + Pro_Assed; gc.insert_date(orderNumber, Parcel_ID, 1008, RollValue_details, 1, DateTime.Now); } } } } } catch { } //Tax Details driver.Navigate().GoToUrl("https://hayscountytax.com/taxes.html#/WildfireSearch"); Thread.Sleep(2000); try { driver.FindElement(By.Id("btnAccept")).Click(); Thread.Sleep(2000); } catch { } try { driver.FindElement(By.XPath("/html/body/div[1]/div/div/div[3]/button[1]")).Click(); Thread.Sleep(2000); } catch { } driver.FindElement(By.Id("searchBox")).SendKeys(Parcel_ID); Thread.Sleep(5000); //TaxPayment Details try { IWebElement TaxPaymentTB = null; try { TaxPaymentTB = driver.FindElement(By.XPath("//*[@id='avalon']/div/div[3]/div[2]/table/tbody")); } catch { } try { if (TaxPaymentTB == null) { TaxPaymentTB = driver.FindElement(By.XPath("//*[@id='avalon']/div/div[4]/div[2]/table/tbody")); } } catch { } IList <IWebElement> TaxPaymentTR = TaxPaymentTB.FindElements(By.TagName("tr")); IList <IWebElement> TaxPaymentTD; foreach (IWebElement TaxPayment in TaxPaymentTR) { TaxPaymentTD = TaxPayment.FindElements(By.TagName("td")); if (TaxPaymentTD.Count != 0) { Owners = TaxPaymentTD[0].Text; year = TaxPaymentTD[1].Text; Quiref_Id = TaxPaymentTD[2].Text; Situs_Address = TaxPaymentTD[3].Text; Status = TaxPaymentTD[4].Text; Payment_details = Owners + "~" + year + "~" + Quiref_Id + "~" + Situs_Address + "~" + Status; gc.CreatePdf(orderNumber, Parcel_ID, "Tax Payment Details", driver, "TX", "Hays"); gc.insert_date(orderNumber, Parcel_ID, 1009, Payment_details, 1, DateTime.Now); } } } catch { } //Tax Info Details int p1 = 0, p2 = 0, p3 = 0; List <string> strTaxRealestate = new List <string>(); List <IWebElement> strTaxRealestate1 = new List <IWebElement>(); IWebElement ITaxReal1 = null; try { ITaxReal1 = driver.FindElement(By.XPath("//*[@id='avalon']/div/div[3]/div[2]/table/tbody")); } catch { } try { if (ITaxReal1 == null) { ITaxReal1 = driver.FindElement(By.XPath("//*[@id='avalon']/div/div[4]/div[2]/table/tbody")); } } catch { } IList <IWebElement> ITaxRealRow1 = ITaxReal1.FindElements(By.TagName("tr")); IList <IWebElement> ITaxRealTd1; foreach (IWebElement row in ITaxRealRow1) { ITaxRealTd1 = row.FindElements(By.TagName("td")); if (row.Text.Contains("Unpaid")) { p1++; p2++; } if (row.Text.Contains("Paid") && p2 < 3) { p3++; p2++; } } int p4 = p1 + p3; for (int p5 = 1; p5 <= p4; p5++) { try { try { driver.FindElement(By.XPath("//*[@id='avalon']/div/div[3]/div[2]/table/tbody/tr[" + p5 + "]/td[7]/button")).Click(); } catch { } try { driver.FindElement(By.XPath("//*[@id='avalon']/div/div[4]/div[2]/table/tbody/tr[" + p5 + "]/td[7]/button")).Click(); } catch { } Thread.Sleep(6000); IWebElement TaxTB = driver.FindElement(By.XPath("//*[@id='avalon']/div/div/div/div[1]/div[1]/div[1]/table/tbody")); IList <IWebElement> TaxTR = TaxTB.FindElements(By.TagName("tr")); IList <IWebElement> TaxTD; foreach (IWebElement Tax in TaxTR) { TaxTD = Tax.FindElements(By.TagName("td")); if (TaxTD.Count != 0) { Own_Nm = TaxTD[0].Text; if (Own_Nm.Contains("Owner Name")) { Tax_Owner = TaxTD[1].Text; } Tx_year = TaxTD[0].Text; if (Tx_year.Contains("Tax Year")) { Taxy_Year = TaxTD[1].Text; } Sta = TaxTD[0].Text; if (Sta.Contains("Status")) { taxy_sta = TaxTD[1].Text; } Ba_Tx = TaxTD[0].Text; if (Ba_Tx.Contains("Base Tax")) { Taxy_Base = TaxTD[1].Text; } Tl_Pay = TaxTD[0].Text; if (Tl_Pay.Contains("Total Payments")) { Tl_Taxy = TaxTD[1].Text; } Due = TaxTD[0].Text; if (Due.Contains("Total Due")) { TaxyTl_Due = TaxTD[1].Text; } } } gc.CreatePdf(orderNumber, Parcel_ID, "Tax Overview Details" + Taxy_Year, driver, "TX", "Hays"); IWebElement TaxTB1 = driver.FindElement(By.XPath("//*[@id='avalon']/div/div/div/div[1]/div[1]/div[2]/table/tbody")); IList <IWebElement> TaxTR1 = TaxTB1.FindElements(By.TagName("tr")); IList <IWebElement> TaxTD1; foreach (IWebElement Tax1 in TaxTR1) { TaxTD1 = Tax1.FindElements(By.TagName("td")); if (TaxTD1.Count != 0) { Own_Addr = TaxTD1[0].Text; if (Own_Addr.Contains("Owner Address")) { Tax_OwnerAddress = TaxTD1[1].Text; } Tx_Parcel = TaxTD1[0].Text; if (Tx_Parcel.Contains("Parcel ID")) { Taxy_Parcel = TaxTD1[1].Text; } Quick = TaxTD1[0].Text; if (Quick.Contains("Quick Reference ID")) { taxy_QuickID = TaxTD1[1].Text; } Lega = TaxTD1[0].Text; if (Lega.Contains("Legal Description")) { Taxy_LglDes = TaxTD1[1].Text; } } } if (TaxyTl_Due == "Please call tax office for total due") { TaxSale_Comments = "You must call the Collector's Office."; } Tax_Deatils = Taxy_Year + "~" + Tax_OwnerAddress + "~" + Taxy_Parcel + "~" + taxy_QuickID + "~" + Taxy_LglDes + "~" + Tax_Owner + "~" + taxy_sta + "~" + Taxy_Base + "~" + Tl_Taxy + "~" + TaxyTl_Due + "~" + TaxSale_Comments; gc.insert_date(orderNumber, Parcel_ID, 1011, Tax_Deatils, 1, DateTime.Now); //Tax Breakdown try { IWebElement BreakdownTB = driver.FindElement(By.XPath("//*[@id='avalon']/div/div/div/div[1]/div[2]/div/table/tbody")); IList <IWebElement> BreakdownTR = BreakdownTB.FindElements(By.TagName("tr")); IList <IWebElement> BreakdownTD; foreach (IWebElement Breakdown in BreakdownTR) { BreakdownTD = Breakdown.FindElements(By.TagName("td")); if (BreakdownTD.Count != 0) { Jurisdiction = BreakdownTD[0].Text; T_Year = BreakdownTD[1].Text; Base_Tax = BreakdownTD[2].Text; tax_Penalty = BreakdownTD[3].Text; Tax_Inst = BreakdownTD[4].Text; attroney_Fee = BreakdownTD[5].Text; Payments = BreakdownTD[6].Text; Balnce = BreakdownTD[7].Text; Breakdown_details = Jurisdiction + "~" + T_Year + "~" + Base_Tax + "~" + tax_Penalty + "~" + Tax_Inst + "~" + attroney_Fee + "~" + Payments + "~" + Balnce; gc.insert_date(orderNumber, Parcel_ID, 1010, Breakdown_details, 1, DateTime.Now); } } } catch { } //Tax Bill try { driver.FindElement(By.XPath("//*[@id='avalon']/div/div/ul/li[2]/a")).Click(); Thread.Sleep(5000); gc.CreatePdf(orderNumber, Parcel_ID, "Tax Bill Details" + Taxy_Year, driver, "TX", "Hays"); } catch { } try { driver.FindElement(By.XPath("//*[@id='avalon']/div/div/ul/li[3]/a")).Click(); Thread.Sleep(4000); gc.CreatePdf(orderNumber, Parcel_ID, "Tax Receipt Details" + Taxy_Year, driver, "TX", "Hays"); } catch { } try { driver.FindElement(By.XPath("//*[@id='avalon']/div/div/ul/li[4]/a")).Click(); Thread.Sleep(4000); gc.CreatePdf(orderNumber, Parcel_ID, "Tax Summary Details" + Taxy_Year, driver, "TX", "Hays"); } catch { } driver.Navigate().Back(); Thread.Sleep(3000); } catch { } } //Tax Authority driver.Navigate().GoToUrl("https://hayscountytax.com/#/contact"); Thread.Sleep(2000); try { Taxing = "712 S Stagecoach Trail San Marcos, Texas 78666"; Phone = "Phone: (512) 393-5545"; Fax = "Fax: (512) 393-5547"; gc.CreatePdf(orderNumber, Parcel_ID, "Tax Authority Details", driver, "TX", "Hays"); Taxing_Authority = Taxing + " " + Phone + " " + Fax; Taxauthority_Details = Taxing_Authority; gc.insert_date(orderNumber, Parcel_ID, 1012, Taxauthority_Details, 1, DateTime.Now); } catch { } TaxTime = DateTime.Now.ToString("HH:mm:ss"); LastEndTime = DateTime.Now.ToString("HH:mm:ss"); gc.insert_TakenTime(orderNumber, "TX", "Hays", StartTime, AssessmentTime, TaxTime, CitytaxTime, LastEndTime); driver.Quit(); gc.mergpdf(orderNumber, "TX", "Hays"); return("Data Inserted Successfully"); } catch (Exception ex) { driver.Quit(); GlobalClass.LogError(ex, orderNumber); throw; } } }