Пример #1
0
        private void CreateNewPerson()
        {
            var canChangeSelectedDetaiedPerson = true;

            if (IsNewModeActive || HasChanges)
            {
                canChangeSelectedDetaiedPerson = _messageDialogService.OpenConfirmationDialog("Änderungen verwerfen", "Wollen Sie die Änderungen verwerfen?");
                if (canChangeSelectedDetaiedPerson)
                {
                    SelectedDetailedPerson.ResetChanges();
                }
            }

            if (canChangeSelectedDetaiedPerson)
            {
                SelectedListPerson     = null;
                SelectedDetailedPerson = IocKernel.GetPersonViewModel(this);

                _logger.Info(LoggerMessage.GetFunctionUsageMessage("Create New Person"));
            }
        }
Пример #2
0
        private void InitializePersons()
        {
            using (var session = _documentStoreFactory.CreateDocumentStore().OpenSession())
            {
                var persons = session.LoadAll <Person>();
                Persons = new ObservableCollection <PersonViewModel>(persons.OrderBy(t => t.Lastname).ThenBy(t => t.Firstname).Select(s => IocKernel.GetPersonViewModel(this, s)).ToList());
            }

            Notify("Persons");

            SelectedListPerson = Persons.FirstOrDefault();
        }