Beispiel #1
0
    void Start()
    {
        _materialScreen = new WebScreen(Tablet);

        _screens = new List<ITabletScreen>
        {
            MapScreen,
            _materialScreen
        };
    }
Beispiel #2
0
        //public void EpassUpdateGwis(TransferCase ts)
        //{
        //    bool find_case = false;

        //    Thread.Sleep(3000);
        //    WaitForWebPage(mpfTerminationPage);

        //    var optQueueList = mpfTerminationPage.sltProcessType.getElementsByTagName("option");

        //    foreach (var obj in optQueueList)
        //    {
        //        HTMLOptionElement option = obj as HTMLOptionElement;
        //        if (option.innerText == "Member termination")
        //        {
        //            option.click();
        //            option.selected = true;
        //            break;
        //        }
        //    }

        //    var Validform = mpfTerminationPage.sltWFCKValidForm.getElementsByTagName("option");

        //    foreach (var obj in Validform)
        //    {
        //        HTMLOptionElement option = obj as HTMLOptionElement;
        //        if (option.innerText == "No, reason:")
        //        {
        //            option.click();
        //            option.selected = true;
        //            break;
        //        }
        //    }



        //    foreach (var obj in actionpage.sltNpi.FirstOrDefault().getElementsByTagName("option"))
        //    {
        //        HTMLOptionElement option = obj as HTMLOptionElement;
        //        if (option.innerText == "FU - Follow-up")
        //        {
        //            option.click();
        //            option.selected = true;
        //            break;
        //        }
        //    }

        //    actionpage.btnSend.click();

        //    actionpage.btnCancel.click();

        //    WaitForWebPage(spage);

        //    int index = -1;

        //    foreach (HTMLLIElement tr in spage.tblSearchResult.getElementsByTagName("TR"))
        //    {
        //        tableIndex++;

        //        foreach (var td in tr.getElementsByTagName("TD"))
        //        {
        //            //var t = td as HTMLInputElement;
        //            index++;
        //            if (index == 0)
        //            {
        //                var t = td as HTMLInputElement;
        //                t.select();
        //                t.click();
        //            }
        //            else if (index == 1)
        //            {
        //                var t = td as HTMLAnchorElement;
        //                t.click();
        //            }
        //            else if (index == 2)
        //            {

        //                Thread.Sleep(3000);
        //                WaitForWebPage(mpfTerminationPage);

        //                var optQueueList1 = mpfTerminationPage.sltWFCKTOCompMatch.getElementsByTagName("option");

        //                foreach (var obj in optQueueList1)
        //                {
        //                    HTMLOptionElement option = obj as HTMLOptionElement;
        //                    if (option.innerText == "Matched" &&
        //                        option.selected == true &&
        //                        mpfTerminationPage.txtERIDInfo.value == ts.OriSchAcctMemNo.Split('-')[0] &&
        //                        mpfTerminationPage.txtCaseNumber.value == ts.TransferCaseNo)
        //                    {
        //                        find_case = true;
        //                    }
        //                }

        //                if (!find_case)
        //                {
        //                    actionpage.btnCancel.click();
        //                    break;
        //                }
        //            }
        //        }
        //    }

        //    WaitForWebPage(mpfTerminationPage);

        //    foreach (var obj in actionpage.sltNpi.FirstOrDefault().getElementsByTagName("option"))
        //    {
        //        HTMLOptionElement option = obj as HTMLOptionElement;
        //        if (option.innerText == "FU - Follow-up")
        //        {
        //            option.click();
        //            option.selected = true;
        //            break;
        //        }
        //    }

        //    actionpage.btnSend.click();

        //}
        #endregion


        private bool WaitForWebPage(WebScreen page, int timeInterval = 5, int times = 1)
        {
            bool flag  = (page.IsCreated() || page.WaitForCreate(5)) && page.WaitForLoadComplete(20);
            int  index = 1;

            while (!flag && index < times)
            {
                flag = page.IsCreated() || page.WaitForCreate(timeInterval);
                index++;
            }
            return(flag);
        }