Exemplo n.º 1
0
        private void SignIn()
        {
            string userName = this.TextBoxUserName.Text;
            string password = this.PasswordBoxPassword.Password;

            YellowstonePathology.YpiConnect.Proxy.WebServiceAccountServiceProxy proxy             = new YpiConnect.Proxy.WebServiceAccountServiceProxy();
            YellowstonePathology.YpiConnect.Contract.Identity.WebServiceAccount webServiceAccount = proxy.GetWebServiceAccount(userName, password);
            YellowstonePathology.YpiConnect.Contract.Identity.ApplicationIdentity.SignIn(webServiceAccount);

            if (webServiceAccount.IsKnown == true)
            {
                Page page = null;
                switch (YellowstonePathology.YpiConnect.Contract.Identity.ApplicationIdentity.Instance.WebServiceAccount.InitialPage)
                {
                case "PathologyDashboard":
                    page = new PathologistSignoutPage();
                    break;

                case "OrderBrowser":
                    page = new OrderEntry.OrderBrowserPage();
                    break;

                case "ReportBrowser":
                    page = new ReportBrowserPage();
                    break;

                case "BillingBrowser":
                    page = new BillingBrowserPage();
                    break;

                case "FileUpload":
                    page = new FileUploadPage();
                    break;
                }

                ApplicationNavigator.ApplicationContentFrame.NavigationService.Navigate(page);
                YellowstonePathology.YpiConnect.Client.UserInteractionMonitor.Instance.Start();
            }
            else
            {
                this.m_SignInFailureAttempts     += 1;
                this.PasswordBoxPassword.Password = string.Empty;
                this.DisplayMessage = "";

                if (this.m_SignInFailureAttempts >= this.m_SignInFailureAttemptThreshold)
                {
                    SignInFailurePage signInFailurePage = new SignInFailurePage();
                    ApplicationNavigator.ApplicationContentFrame.NavigationService.Navigate(signInFailurePage);
                }
                else
                {
                    this.m_FromMessageBox = true;
                    MessageBox.Show("We could not log you in.  Make sure your username and password are correct, then type your password again.  Letters in passwords must be typed using the correct case.", "Logon failed");
                    this.PasswordBoxPassword.Focus();
                }
            }
        }
Exemplo n.º 2
0
        private void SignIn()
        {
            string userName = this.TextBoxUserName.Text;
            string password = this.PasswordBoxPassword.Password;

            YellowstonePathology.YpiConnect.Proxy.WebServiceAccountServiceProxy proxy = new YpiConnect.Proxy.WebServiceAccountServiceProxy();
            YellowstonePathology.YpiConnect.Contract.Identity.WebServiceAccount webServiceAccount = proxy.GetWebServiceAccount(userName, password);
            YellowstonePathology.YpiConnect.Contract.Identity.ApplicationIdentity.SignIn(webServiceAccount);

            if (webServiceAccount.IsKnown == true)
            {
                Page page = null;
                switch (YellowstonePathology.YpiConnect.Contract.Identity.ApplicationIdentity.Instance.WebServiceAccount.InitialPage)
                {
                    case "PathologyDashboard":
                        page = new PathologistSignoutPage();
                        break;
                    case "OrderBrowser":
                        page = new OrderEntry.OrderBrowserPage();
                        break;
                    case "ReportBrowser":
                        page = new ReportBrowserPage();
                        break;
                    case "BillingBrowser":
                        page = new BillingBrowserPage();
                        break;
                    case "FileUpload":
                        page = new FileUploadPage();
                        break;
                }

                ApplicationNavigator.ApplicationContentFrame.NavigationService.Navigate(page);
                YellowstonePathology.YpiConnect.Client.UserInteractionMonitor.Instance.Start();
            }
            else
            {
                this.m_SignInFailureAttempts += 1;
                this.PasswordBoxPassword.Password = string.Empty;
                this.DisplayMessage = "";

                if (this.m_SignInFailureAttempts >= this.m_SignInFailureAttemptThreshold)
                {
                    SignInFailurePage signInFailurePage = new SignInFailurePage();
                    ApplicationNavigator.ApplicationContentFrame.NavigationService.Navigate(signInFailurePage);
                }
                else
                {
                    this.m_FromMessageBox = true;
                    MessageBox.Show("We could not log you in.  Make sure your username and password are correct, then type your password again.  Letters in passwords must be typed using the correct case.", "Logon failed");
                    this.PasswordBoxPassword.Focus();
                }
            }
        }