예제 #1
0
 private void ActivateTableView()
 {
     SelectedIndex = 2;
     if (AppServices.MainDataContext.SelectedDepartment.TerminalTableScreenId > 0)
     {
         SelectedTicketViewIndex = 0;
         TableScreenViewModel.Refresh();
     }
     else
     {
         if (DataContext.SelectedTicket != null)
         {
             if (DataContext.SelectedTicket.SelectedItems.Count > 0)
             {
                 MoveSelectedItems(0);
                 if (ShouldSelectTag())
                 {
                     return;
                 }
             }
             ActivateTicketView(null);
         }
         else
         {
             SelectedTicketViewIndex = 1;
             TicketScreenViewModel.Refresh();
         }
     }
     LoggedInUserViewModel.Refresh();
 }
예제 #2
0
        void LoginViewModelPinSubmitted(object sender, string pinValue)
        {
            if (pinValue == "065058")
            {
                Application.Current.Shutdown();
            }

            var user = AppServices.LoginUser(pinValue);

            LoggedInUserViewModel.Refresh();
            if (user != User.Nobody)
            {
                if (user.UserRole.DepartmentId != 0 && !AppServices.IsUserPermittedFor(PermissionNames.ChangeDepartment))
                {
                    AppServices.MainDataContext.SelectedDepartment =
                        AppServices.MainDataContext.Departments.Single(x => x.Id == user.UserRole.DepartmentId);
                    ActivateTableView();
                }
                else if (AppServices.MainDataContext.PermittedDepartments.Count() == 1)
                {
                    AppServices.MainDataContext.SelectedDepartment =
                        AppServices.MainDataContext.PermittedDepartments.First();
                    ActivateTableView();
                }
                else
                {
                    ActivateDepartmentSelector();
                }
            }
            TicketEditorViewModel.ResetCache();
        }
예제 #3
0
 private void ActivateTicketView(Table table)
 {
     if (table != null)
     {
         DataContext.UpdateSelectedTicket(table);
         if (table.TicketId == 0)
         {
             ActivateMenuItemSelector();
             return;
         }
     }
     LoggedInUserViewModel.Refresh();
     TicketEditorViewModel.Refresh();
     SelectedIndex = 3;
 }
예제 #4
0
 private void ActivateMenuItemSelector()
 {
     SelectedIndex = 4;
     LoggedInUserViewModel.Refresh();
     MenuItemSelectorViewModel.Refresh();
 }