Exemple #1
0
        public void SetModel(string modelName)
        {
            var repository = workspaceMan.GetRepository(modelName);

            if (repository == null)
            {
                throw new InvalidOperationException($"Repository with name '{modelName}' not found.");
            }

            _edited = repository;

            //var vm = application.GetInterface<DbTableFactory>().CreateTable(_edited);
            UpdateVM(_edited);

            tableName             = modelName;
            TablePresentationName = modelName;

            UpdateTitle();

            if (_newEntryCreator != null)
            {
                _newEntryCreator.Close();
                _newEntryCreator = null;
            }
        }
Exemple #2
0
        public void OpenNewEntryCreator()
        {
            _newEntryCreator = new DbTableNewEntryCreatorVM();
            _newEntryCreator.CreateAction      = OnNewEntryCreate;
            _newEntryCreator.ValidateNewIdFunc = OnValidateNewId;

            _edited.EntryTypes.ForEach(item => _newEntryCreator.EntryTypes.Add(new EntryTypeVM(item)));

            _newEntryCreator.EntryType = _newEntryCreator.EntryTypes.FirstOrDefault();
            _newEntryCreator.NewId     = GetUniqueId();
            OpenNewEntryCreatorAction?.Invoke(_newEntryCreator);
        }