public UserControlInfograph(bool _userIsAdmin)
        {
            UserIsAdmin = _userIsAdmin;
            InitializeComponent();

            dbContext.Appointments.Load();
            int qty = dbContext.Appointments.Count();

            DataContext = new DataViewModel();

            UserControlAppointment appointment = new UserControlAppointment(UserIsAdmin);
        }
コード例 #2
0
        private void ListViewMenu_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            int index = ListViewMenu.SelectedIndex;

            GridSelectedItem(index);

            switch (index)
            {
            case 0:
                GridUsrCtrl.Children.Clear();
                GridUsrCtrl.Children.Add(homeControl = new UserControlHome(userIsAdmin));
                break;

            //case 1:
            //    GridUsrCtrl.Children.Clear();
            //    GridUsrCtrl.Children.Add(new UserControlService());
            //    break;
            case 1:
                GridUsrCtrl.Children.Clear();
                GridUsrCtrl.Children.Add(appointmentControl = new UserControlAppointment(userIsAdmin));
                break;

            case 2:
                GridUsrCtrl.Children.Clear();
                GridUsrCtrl.Children.Add(customersControl = new UserControlCustomers(userIsAdmin));
                break;

            case 3:
                GridUsrCtrl.Children.Clear();
                GridUsrCtrl.Children.Add(petsControl = new UserControlPets(userIsAdmin));
                break;

            case 4:
                GridUsrCtrl.Children.Clear();
                GridUsrCtrl.Children.Add(infographControl = new UserControlInfograph(userIsAdmin));
                break;

            case 5:
                GridUsrCtrl.Children.Clear();
                GridUsrCtrl.Children.Add(controlControl = new UserControlControls(userIsAdmin));
                break;

            case 6:
                Application.Current.Shutdown();
                break;

            default:
                GridUsrCtrl.Children.Add(homeControl = new UserControlHome(userIsAdmin));
                break;
            }
        }