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);
        }
Beispiel #3
0
        private void LinkInspector()
        {
            if (SelectedInspection == null)
            {
                return;
            }

            dynamic viewBag = new ViewBag();

            viewBag.Inspection = SelectedInspection;

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

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

            viewBag.Customer = SelectedCustomer;

            _router.GoTo(ControlType.ClientInfoControl, viewBag);
        }
Beispiel #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);
        }
        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.");
        }
Beispiel #7
0
 private void ChangePassword()
 {
     _router.GoTo(ControlType.ChangePasswordControl);
 }
Beispiel #8
0
        public void Router_ChangesView()
        {
            Assert.IsNull(_router.CurrentView);

            _router.GoTo(ControlType.UserManagementControl);

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