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(); } } }
private void HyperlinkFileUpload_Click(object sender, RoutedEventArgs e) { if (YellowstonePathology.YpiConnect.Contract.Identity.ApplicationIdentity.Instance.WebServiceAccount.EnableFileUpload == true && string.IsNullOrEmpty(YellowstonePathology.YpiConnect.Contract.Identity.ApplicationIdentity.Instance.WebServiceAccount.LocalFileUploadDirectory) == false) { FileUploadPage fileUploadPage = new FileUploadPage(); ApplicationNavigator.ApplicationContentFrame.NavigationService.Navigate(fileUploadPage); } else { FileUploadSettingsPage fileUploadSettingsPage = new FileUploadSettingsPage(); ApplicationNavigator.ApplicationContentFrame.NavigationService.Navigate(fileUploadSettingsPage); } }