private void btnLogin_Click(object sender, RoutedEventArgs e) { TVMUtility.PlayClick(); bool notAuthorized = false; bool log = Login(txtUserID.Text, pbUserPassword.Password, Stations.currentStation.id, ref notAuthorized); if (notAuthorized) { Parameters.userId = txtUserID.Text; Parameters.menuItems.Clear(); using (var context = new TVM_Entities()) { int?userRecId = context.sp_SelUserId(Parameters.userId).FirstOrDefault(); var menu = context.sp_userAuth(userRecId, "TVM").ToList(); foreach (var row2 in menu) { Parameters.menuItems.Add(row2.explanation.ToString()); } } TVMUtility.RestartExplorer(); NavigationService.Navigate(new Pages.Maintenance.AdminMainPage()); } else { if (notAuthorized) { MessageBoxOperations.ShowMessage("Login Failed", "User is not authorized..", MessageBoxButtonSet.OK); } else { MessageBoxOperations.ShowMessage("Login Failed", "User Id or password is wrong..", MessageBoxButtonSet.OK); } } }