public void SetOption(ExcelWhlist wl, string newTrustee) { bool find_case = false; if (blankSearch.WaitForCreate()) { blankSearch.btnSearch.click(); } WaitForWebPage(spage); spage.txtHKID.value = wl.HKID; spage.btnsearch.click(); WaitForWebPage(spage); int index = -1; HTMLTable table = spage.tblSearchResult; if (table == null) { throw new Exception("This search has no return result."); } bool isContinute = SelectCase(wl.ERID); if (isContinute) { SetOptionPage(newTrustee); } else { } }
public void TestRunCaseGwis() { ConversionExcelDataToList c**t = new ConversionExcelDataToList(); c**t.path = @"L:\GZT_RBT\Private\Production\2B\SA Level\2b Logging\Jasmine\Robot\Project Doc\Epass Stage 1 & 2 automation tool.xlsx"; Dictionary <string, List <ExcelWhlist> > ewhlistdic = new Dictionary <string, List <ExcelWhlist> >(); OleDbConnection objExcelCon = c**t.openExcel(); ewhlistdic = c**t.ExtractEmployeeExcel <ExcelWhlist>(objExcelCon, "White List"); ExcelWhlist passModel = ewhlistdic["White List"].ToList().Where(x => x.Clean_Case == "Y").ToList().FirstOrDefault(); GwisOperationLogic gwisOperation = new GwisOperationLogic(); gwisOperation.SetOption(passModel, "MANULIFE"); }
public void TestEpassGwis() { string remark = @"Ext. PC received, but Missing/Incorrect member name, Please be reminded to submit Statement to certify signature if necessary next time, L/O 2016/6/16 to trustee"; ConversionExcelDataToList c**t = new ConversionExcelDataToList(); c**t.path = @"L:\GZT_RBT\Private\Production\2B\SA Level\2b Logging\Jasmine\Robot\Project Doc\Epass Stage 1 & 2 automation tool.xlsx"; Dictionary <string, List <ExcelWhlist> > ewhlistdic = new Dictionary <string, List <ExcelWhlist> >(); OleDbConnection objExcelCon = c**t.openExcel(); ewhlistdic = c**t.ExtractEmployeeExcel <ExcelWhlist>(objExcelCon, "White List"); ExcelWhlist passModel = ewhlistdic["White List"].ToList().Where(x => x.Clean_Case == "N").ToList().FirstOrDefault(); GwisOperationLogic gwisOperation = new GwisOperationLogic(); gwisOperation.EpassUpadateGwis(passModel, remark); }
public void readexcel() { List <WhiteListcs> wlist = new List <WhiteListcs>(); ExcelEditor excelHandel = new ExcelEditor(); //int index = 1; //WhiteListcs w1 = new WhiteListcs(); //w1.Name_in_AS400 = "test"; //w1.Case_Number = "5454579859"; //w1.Clean_Case = "Y"; //w1.ERID = "21456789"; //w1.ExtentionNo = "81634"; //w1.Name_Pass = "******"; //w1.Membership_No = "12345678-123456789"; //w1.PM_AC = "PC"; //w1.Signature_Pass = "******"; //w1.Unclean_Reason.Append("sfdtrtyrturtutyuityurt"); //w1.Withdraw_NT_PM = "NT"; //w1.Name_in_XML = "test"; //wlist.Add(w1); //WhiteListcs w2 = new WhiteListcs(); //w2.Name_in_AS400 = "test"; //w2.Case_Number = "5454579859"; //w2.Clean_Case = "Y"; //w2.ERID = "21456789"; //w2.ExtentionNo = "81634"; //w2.Name_Pass = "******"; //w2.Membership_No = "12345678-123456789"; //w2.PM_AC = "PC"; //w2.Signature_Pass = "******"; //w2.Unclean_Reason.Append("sfdtrtyrturtutyuityurt"); //w2.Withdraw_NT_PM = "NT"; //w2.Name_in_XML = "test"; //wlist.Add(w2); //if (wlist.Count > 0) //{ // var excel = excelHandel.Open(@"E:\Epass Stage 1 & 2 automation tool.xlsx"); // DataTable dt = ListToDatatableHelper.ToDataTable<WhiteListcs>(wlist); // excel.SaveDataTableToExcel(dt, @"E:\Epass Stage 1 & 2 automation tool.xlsx", "White List"); //} List <ExcelWhlist> ewlist = new List <ExcelWhlist>(); ExcelWhlist ew = new ExcelWhlist(); ew.Name_in_AS400 = "test"; ew.Case_Number = "5454579859"; ew.Clean_Case = "Y"; ew.ERID = "21456789"; //ew.ExtentionNo = "81634"; ew.Name_Pass = "******"; ew.Membership_No = "12345678-123456789"; ew.PM_AC = "PC"; ew.Signature_Pass = "******"; ew.Unclean_Reason = "fdsdsdsd"; ew.Withdraw_NT_PM = "NT"; ew.Name_in_XML = "test"; ew.RowIndex = "2"; ew.Process_result = "Processed"; //ew.Message_Mark = "Y"; ewlist.Add(ew); if (ewlist.Count > 0) { var excel = excelHandel.Open(@"E:\Epass Stage 1 & 2 automation tool.xlsx"); excel.SetSpecifiedToExcel(ewlist, @"E:\Epass Stage 1 & 2 automation tool.xlsx", "White List"); } }
public void EpassUpadateGwis(ExcelWhlist wl, string Remark) { bool find_case = false; if (blankSearch.WaitForCreate()) { blankSearch.btnSearch.click(); } WaitForWebPage(spage); spage.txtHKID.value = wl.HKID; spage.btnsearch.click(); WaitForWebPage(spage); int index = -1; int rowIndex = 0; HTMLTable table = spage.tblSearchResult; if (table == null) { throw new Exception("This search has no return result."); } bool isContinute = SelectCase(wl.ERID); if (isContinute) { Thread.Sleep(2000); EpassSetRemark(Remark); SetEpassPageFirst(); WaitForWebPage(spage); spage.txtHKID.value = wl.HKID; spage.btnsearch.click(); SelectCase(wl.ERID); SetEpassPageSecond(); //SetOptionPage(newTrustee); } else { } #region SelectCase //List<CaseModel> caseList = new List<CaseModel>(); //foreach (HTMLTableRow tr in spage.tblSearchResult.getElementsByTagName("TR")) //{ // if (rowIndex == 0) // { // rowIndex++; // continue; // } // HTMLTableCell FormType = tr.getElementsByTagName("TD").item(2) as HTMLTableCell; // HTMLTableCell ERID = tr.getElementsByTagName("TD").item(3) as HTMLTableCell; // HTMLTableCell PCID = tr.getElementsByTagName("TD").item(14) as HTMLTableCell; // HTMLTableCell WorkQueue = tr.getElementsByTagName("TD").item(16) as HTMLTableCell; // CaseModel model = new CaseModel { index = rowIndex, FormType = FormType.innerText, ERID = ERID.innerText, PCID = PCID.innerText, WorkQueue = WorkQueue.innerText }; // caseList.Add(model); // rowIndex++; //} ////Tag of Debug comment line //caseList = caseList.Where(t => t.WorkQueue.Trim() == "SA-03 Processing by SA" || t.WorkQueue.Trim() == "FU-05 Follow-up").ToList(); //if (caseList == null || caseList.Count < 1) //{ // throw new Exception("no item could be located in related queue."); //} //List<CaseModel> selectCase = caseList.Where(t => t.ERID == wl.ERID).ToList(); //if (selectCase == null || selectCase.Count < 1) //{ // //var tsinfo = trusteInfodDic["Trustee info"].Where(x => x.Scheme_Registration_No == ts.OriSchRegNo).FirstOrDefault(); // if (wl.Company.StartsWith("HANG")) // { // if (wl.PM_AC == "PC") // { // selectCase = caseList.Where(t => t.FormType == "HAAC").ToList(); // } // else if (wl.PM_AC == "PM") // { // selectCase = caseList.Where(t => t.FormType == "HAPM" && t.PCID == "PR01").ToList(); // } // } // else if (wl.Company.StartsWith("HSBC")) // { // if (wl.PM_AC == "PC") // { // selectCase = caseList.Where(t => t.FormType == "INAC").ToList(); // } // else if (wl.PM_AC == "PM") // { // selectCase = caseList.Where(t => t.FormType == "INPM" && t.PCID == "PR01").ToList(); // } // } //} //if (selectCase == null || selectCase.Count < 1) //{ // if (wl.PM_AC == "PC") // { // selectCase = caseList; // } // else if (wl.PM_AC == "PM") // { // selectCase = caseList.Where(t => t.PCID == "PR01").ToList(); // } // //throw new Exception("Can't find item in gwis"); //} //foreach (CaseModel model in selectCase) //{ // HTMLTableRow tr = spage.tblSearchResult.getElementsByTagName("TR").item(model.index) as HTMLTableRow; // HTMLTableCell td = tr.getElementsByTagName("TD").item(1) as HTMLTableCell; // var t = td.getElementsByTagName("INPUT").item(0) as HTMLInputElement; // Thread.Sleep(2000); // t.click(); // Thread.Sleep(500); // EpassSetRemark(Remark); // Thread.Sleep(1000); // t.click(); // Thread.Sleep(500); // //if (CheckGwisDetailInfo(ts)) // //{ // // find_case = true; // // break; // //} //} #endregion }