예제 #1
0
        private void Edit()
        {
            if (SelectedTask == null)
            {
                return;
            }

            dynamic viewBag = new ViewBag();

            viewBag.Task = SelectedTask;

            _router.GoTo(ControlType.TaskDetailsControl, viewBag);
        }
        private void ExecuteInspection()
        {
            dynamic viewBag = new ViewBag();

            viewBag.Inspection = SelectedInspection;

            _router.GoTo(ControlType.ExecuteInspectionControl, viewBag);
        }
예제 #3
0
        private void LinkInspector()
        {
            if (SelectedInspection == null)
            {
                return;
            }

            dynamic viewBag = new ViewBag();

            viewBag.Inspection = SelectedInspection;

            _router.GoTo(ControlType.LinkInspectorControl, viewBag);
        }
예제 #4
0
        private void EditCustomer()
        {
            if (SelectedCustomer == null)
            {
                return;
            }

            _isEditing = true;
            dynamic viewBag = new ViewBag();

            viewBag.Customer = SelectedCustomer;

            _router.GoTo(ControlType.ClientInfoControl, viewBag);
        }
예제 #5
0
        public MainViewModel(RouterService router)
        {
            _router = router;
            _router.PropertyChanged += RouterViewChanged;

            new LoginWindow().ShowDialog();

            if (!Settings.IsLoggedIn)
            {
                Environment.Exit(0);
            }

            CurrentUserName = Settings.CurrentUser.Email;

            _router.GoTo(ControlType.AccountControl);

            UploadDataCommand = new RelayCommand(UploadData, () => DbSync.CanUpload);
            ChangeViewCommand = new RelayCommand <ControlType>(ChangeView);
            ExitCommand       = new RelayCommand(() => Environment.Exit(0));
            BackCommand       = new RelayCommand(GoBack);
        }
예제 #6
0
        private void SaveUser()
        {
            var error = CanSave();

            if (error != string.Empty)
            {
                MessageBox.Show(error);
                return;
            }

            SelectedEmployee.JobTitle = SelectedJobTitle;
            if (_userRepository.Update(SelectedEmployee))
            {
                MessageBox.Show("Wijzigingen zijn opgeslagen.");

                _router.GoTo(ControlType.AccountControl, null, true);
                return;
            }

            MessageBox.Show("Wijzigingen zijn niet opgeslagen.");
        }
예제 #7
0
 private void ChangePassword()
 {
     _router.GoTo(ControlType.ChangePasswordControl);
 }
예제 #8
0
        public void Router_ChangesView()
        {
            Assert.IsNull(_router.CurrentView);

            _router.GoTo(ControlType.UserManagementControl);

            Assert.IsInstanceOfType(_router.CurrentView, ControlType.UserManagementControl.Control);
        }
예제 #9
0
 private void NewTemplate()
 {
     _router.GoTo(ControlType.EditTemplateControl);
 }
예제 #10
0
 private void NewCustomer()
 {
     _router.GoTo(ControlType.ClientInfoControl);
 }
예제 #11
0
 private void ChangeView(ControlType view)
 {
     _router.GoTo(view, null, true);
 }
예제 #12
0
 private void AddUser()
 {
     _router.GoTo(ControlType.RegisterInspectorControl);
 }