示例#1
0
        private RobotResult DoLogIn(RobotContext context)
        {
            try
            {
                IntPtr loginFormWindow = AutoItX.WinGetHandle(LoginFormTitle);
                IntPtr textPassBox     = AutoItX.ControlGetHandle(loginFormWindow, "[CLASS:TCMBStyleEdit72]");
                EnterPinBox(loginFormWindow, textPassBox, context.LoginPassword);
                ClickButton(loginFormWindow, 200, 400);

                int warningHappen1 = AutoItX.WinWaitActive("[CLASS:TPbBaseMsgForm]", "", 10); //login password validate
                if (warningHappen1 == AutoItXSuccess)
                {
                    string errorText = AutoItX.WinGetText("[CLASS:TPbBaseMsgForm]");
                    RobotCMB738Utils.SaveErrorShot(context.MidasTransactionId);
                    AutoItX.WinClose("[CLASS:TPbBaseMsgForm]");
                    return(RobotResult.Build(context, RobotStatus.ERROR, $"Login Failed, Error<{errorText.Trim()}>"));
                }

                RobotCMB738Utils.UntilWinActive(context.MidasTransactionId, MainWindowTitle, MainWindowText);
                Thread.Sleep(TimeSpan.FromSeconds(2)); // sleep wait for [CLASS:Internet Explorer_Server] load done
                return(RobotResult.Build(context, RobotStatus.SUCCESS, "Login Success, Awesome!"));
            }
            catch (Exception e)
            {
                return(RobotResult.Build(context, RobotStatus.ERROR, e.Message));
            }
        }
示例#2
0
        private RobotResult DoTransfer(RobotContext context)
        {
            try
            {
                IntPtr mainFormWindow = GetMainFormWindow();
                AutoItX.WinActivate(mainFormWindow);

                ClickButton(mainFormWindow, 60, 320); // click 'Transfer' button
                RobotCMB738Utils.UntilControlFocus(context.MidasTransactionId, MainWindowTitle, MainWindowText, "[CLASS:TCMBStyleEdit72; INSTANCE:4]");

                FillBankTransInfo(mainFormWindow, context);
                ClickButton(mainFormWindow, 180, 650); // click 'Next' button
                RobotCMB738Utils.UntilControlFocus(context.MidasTransactionId, MainWindowTitle, MainWindowText, "[CLASS:TCMBStyleEdit72; INSTANCE:4000]");

                return(RobotResult.Build(context, RobotStatus.SUCCESS, ""));
            }
            catch (Exception e)
            {
                return(RobotResult.Build(context, RobotStatus.ERROR, e.Message));
            }
        }