Beispiel #1
0
        private void Vertex_MouseClick(object sender, MouseButtonEventArgs e)
        {
            var concept = ((sender as VertexControl).Vertex as ConceptVertex).Concept;

            _selectedConceptId = concept.Id;

            ConceptLabel.Text = concept.Name;

            ConceptSpecDifferenceLabel.Text = concept.SpeciesDifference;

            if (concept.SpeciesDifference != null)
            {
                SpecDifferenceTextLabel.Text = "Видовое отличие:";
            }
            else
            {
                SpecDifferenceTextLabel.Text = "";
            }

            if (_isChangingParentConceptActive)
            {
                ChangeConceptParent(concept.Id);
            }

            SelectConceptProperties(concept.Id);

            SelectConceptDefinitions(_SQLClient.FindClassConcept(_selectedClassificationId, concept.Id).Field <int>("Id"));
        }
        public ChangeClassConceptWindow(SQLClient sqlClient, int classificationId, int conceptId)
        {
            InitializeComponent();

            _sqlClient = sqlClient;

            _conceptId = conceptId;

            _classificationId = classificationId;

            SelectConcept(conceptId);

            ConceptNameTextBox.Text        = _concept.Name.Trim();
            SpecDifferenceNameTextBox.Text =
                _sqlClient.FindClassConcept(classificationId, conceptId)
                .Field <string>("SpecDifference")
                .Trim();
        }
        private void SaveConceptButton_Click(object sender, RoutedEventArgs e)
        {
            if (ConceptNameTextBox.Text != string.Empty)
            {
                _concept.Name = ConceptNameTextBox.Text;

                int classConceptId =
                    _sqlClient.FindClassConcept(_classificationId, _conceptId).Field <int>("Id");

                _sqlClient.UpdateClassificationConcept(
                    classConceptId,
                    ConceptNameTextBox.Text,
                    SpecDifferenceNameTextBox.Text
                    );

                Classifications.Instance.SelectClassificationConcepts();
                Concepts.Instance.SelectConcepts();
            }
        }
Beispiel #4
0
        private void AddDefinitionButton_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                var classConcept = _SQLClient
                                   .FindClassConcept(_SelectedClassificationId, _SelectedConceptId);

                int classificationConceptId = classConcept.Field <int>("Id");

                _SQLClient.InsertDefinition(
                    classificationConceptId,
                    int.Parse(SourceComboBox.Text.Split('.')[0]),
                    DefinitionTextBox.Text,
                    int.Parse(PageTextBox.Text)
                    );

                Frames.Classifications.Instance.SelectClassificationConcepts();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Ошибка");
            }
        }