Ejemplo n.º 1
0
        /// <summary>
        /// Login
        /// opens window to get login information
        /// then calls VerifyUser asyncronously from portal
        /// </summary>
        private void Login()
        {
            try
            {
                LoginWindow   loginWind = null;
                Verify        verify    = m_portal.VerifyUser;
                AsyncCallback callback  = this.LoginOnComplete;

                loginWind = new LoginWindow();
                if (loginWind.ShowDialog() == true)
                {
                    verify.BeginInvoke(loginWind.Username, loginWind.Password, out User user, callback, null);
                }
            }
            catch (FaultException <PortalServerFault> e)
            {
                MessageBox.Show("Error Authenticating User please try Again later\n\n" + e.Detail.Message);
                CloseWindow();
            }
            catch (CommunicationException)
            {
                MessageBox.Show("Error Communicating with Portal please try again later");
                CloseWindow();
            }
        }