public void Play_Signon(EhllapiSettings Settings)
        {
            try
            {
                using (DisplaySession sess = new DisplaySession())
                {
                    sess.Connect(Settings.SessId);

                    sess.SendKeys(Settings.UserName);
                    if (Settings.UserName.Length < 10)
                    {
                        sess.SendKeys(Ehllapier.Key.FieldExit);
                    }

                    sess.SendKeys(Settings.Password);
                    if (Settings.Password.Length < 10)
                    {
                        sess.SendKeys(Ehllapier.Key.FieldExit);
                    }

                    sess.SendKeys(Ehllapier.Key.Enter);
                    sess.Wait();

                    // display messages screen breaks on screen. Press enter.
                    if (DisplayMessagesScreen.IsScreen(sess))
                    {
                        sess.SendKeys(Ehllapier.Key.Enter);
                        sess.Wait();
                    }

                    // display program messages screen is displayed. Screen displays on
                    // signon to say "message queue allocated to another job".
                    // Press enter.
                    if (DisplayProgramMessagesScreen.IsScreen(sess))
                    {
                        sess.SendKeys(Ehllapier.Key.Enter);
                        sess.Wait();
                    }

                    // handle the "attempt to recover interactive job" display by running the signoff
                    // option and signing on again.
                    if (RecoverInteractiveJobScreen.IsScreen(sess))
                    {
                        sess.SendKeys("90" + Ehllapier.Key.Enter);
                        sess.Wait();
                        Play_Signon(Settings);
                    }
                }
            }
            catch (ApplicationException excp)
            {
                throw new EhllapiExcp("Play_Signon script failed", excp);
            }
        }
Beispiel #2
0
        private void SessionTester( )
        {
            var ehSettings = EhllapiSettings.RecallSettings();

            // make sure the session is active.
            SessionScript.Assure_ClientAccessSession(ehSettings);

            // bring the 5250 window to the foreground.
            Ehllapier.SetForegroundWindow(ehSettings.SessId);

            // make sure signed on.
            if (SignonScreen.IsScreen(ehSettings))
            {
                var script = new SessionScript();
                script.Play_Signon(ehSettings);
            }

            // in the strseu screen. Exit back to presumably wrkmbrpdm.
            if (StrseuScreen.EditScreen.IsScreen(ehSettings))
            {
                StrseuScreen.EditScreen.F3_Exit(ehSettings);

                if (StrseuScreen.ExitScreen.IsScreen(ehSettings))
                {
                    StrseuScreen.ExitScreen.Enter(ehSettings);
                }
            }

            // in the seu browse screen. press enter to exit.
            if (StrseuScreen.BrowseScreen.IsScreen(ehSettings))
            {
                StrseuScreen.BrowseScreen.Enter_Exit(ehSettings);
            }

            using (DisplaySession sess = new DisplaySession())
            {
                bool isScreen = false;
                sess.Connect(ehSettings.SessId);

                // display messages. press enter.
                if (DisplayMessagesScreen.IsScreen(sess))
                {
                    sess.SendKeys(KeyboardKey.Enter);
                }
            }
        }