public bool Login(string UserName, string Password, string Client, string Language) { BeforeLogin?.Invoke(Session, new EventArgs()); Session.FindById <GuiTextField>("wnd[0]/usr/txtRSYST-BNAME").Text = UserName; Session.FindById <GuiTextField>("wnd[0]/usr/pwdRSYST-BCODE").Text = Password; Session.FindById <GuiTextField>("wnd[0]/usr/txtRSYST-MANDT").Text = Client; Session.FindById <GuiTextField>("wnd[0]/usr/txtRSYST-LANGU").Text = Language; var window = Session.FindById <GuiFrameWindow>("wnd[0]"); window.SendVKey(0); GuiStatusbar status = Session.FindById <GuiStatusbar>("wnd[0]/sbar"); if (status != null && status.MessageType.ToLower() == "e") { Connection.CloseSession(Session.Id); FailLogin?.Invoke(Session, new EventArgs()); return(false); } AfterLogin?.Invoke(Session, new EventArgs()); GuiRadioButton rb_Button = Session.FindById <GuiRadioButton>("wnd[1]/usr/radMULTI_LOGON_OPT2"); if (rb_Button != null) { rb_Button.Select(); window.SendVKey(0); } return(true); }
private void _onLogin(LoginInfo loginInfo) { if (loginInfo.IsLogin) { MyInfo.PlayerID = loginInfo.PlayerID; SuccessLogin?.Invoke(this, EventArgs.Empty); } FailLogin?.Invoke(this, EventArgs.Empty); }