예제 #1
0
        private void ConcreteSymptomDiseaseConnectionRowUpdate(object sender, DataGridRowEditEndingEventArgs e)
        {
            if (ConcreteSymptomDiseaseConnectionDataGrid.SelectedItem != null)
            {
                ConcreteSymptomDiseaseConnectionDataGrid.RowEditEnding -= ConcreteSymptomDiseaseConnectionRowUpdate;
                ConcreteSymptomDiseaseConnectionDataGrid.CommitEdit();
                ConcreteSymptomDiseaseConnectionDataGrid.RowEditEnding += ConcreteSymptomDiseaseConnectionRowUpdate;
            }
            else
            {
                return;
            }

            var result = new ConcreteSymptomDiseaseConnectionValidation().Validate(e.Row.BindingGroup,
                                                                                   CultureInfo.CurrentCulture);

            if (!result.IsValid)
            {
                ConcreteSymptomDiseaseConnectionsSearchBox.IsEnabled = false;
                return;
            }

            ConcreteSymptomDiseaseConnectionsSearchBox.IsEnabled = true;

            dbContextConcreteSymptomDiseaseConnection.SaveChanges();

            ConcreteSymptomDiseaseConnectionDataGrid.Items.Refresh();

            concreteSymptomDiseaseConnectionFlag = false;
        }
예제 #2
0
        private void DiseaseRowUpdate(object sender, DataGridRowEditEndingEventArgs e)
        {
            if (DiseaseDataGrid.SelectedItem != null)
            {
                DiseaseDataGrid.RowEditEnding -= DiseaseRowUpdate;
                DiseaseDataGrid.CommitEdit();
                DiseaseDataGrid.RowEditEnding += DiseaseRowUpdate;
            }
            else
            {
                return;
            }

            var result = new DiseaseValidation().Validate(e.Row.BindingGroup, CultureInfo.CurrentCulture);

            if (!result.IsValid)
            {
                DiseasesSearchBox.IsEnabled = false;
                return;
            }

            DiseasesSearchBox.IsEnabled = true;

            dbContextDisease.SaveChanges();

            dbContextDiseaseCorelation = new DiseaseDatabaseEntities();
            dbContextDiseaseCorelation.Diseases.Load();
            dbContextDiseaseCorelation.DiseaseCorelations.Load();
            _diseasesListRemote.Source          = dbContextDiseaseCorelation.Diseases.Local;
            _diseaseCorelationViewSource.Source = dbContextDiseaseCorelation.DiseaseCorelations.Local;
            DiseaseCorelationDataGrid.Items.Refresh();

            dbContextConcreteSymptomDiseaseConnection = new DiseaseDatabaseEntities();
            dbContextConcreteSymptomDiseaseConnection.Diseases.Load();
            dbContextConcreteSymptomDiseaseConnection.ConcreteSymptomDiseaseConnections.Load();
            _concreteDiseasesListRemote.Source = dbContextConcreteSymptomDiseaseConnection.Diseases.Local;
            _concreteSymptomDiseaseConnectionViewSource.Source =
                dbContextConcreteSymptomDiseaseConnection.ConcreteSymptomDiseaseConnections.Local;
            ConcreteSymptomDiseaseConnectionDataGrid.Items.Refresh();

            DiseaseDataGrid.Items.Refresh();
            diseaseFlag = false;
        }
예제 #3
0
        private void SymptomCathegoryRowUpdate(object sender,
                                               DataGridRowEditEndingEventArgs dataGridRowEditEndingEventArgs)
        {
            if (SymptomCathegoriesDataGrid.SelectedItem != null)
            {
                SymptomCathegoriesDataGrid.RowEditEnding -= SymptomCathegoryRowUpdate;
                SymptomCathegoriesDataGrid.CommitEdit();
                SymptomCathegoriesDataGrid.RowEditEnding += SymptomCathegoryRowUpdate;
            }
            else
            {
                return;
            }

            var result = new SymptomCathegoryValidation().Validate(dataGridRowEditEndingEventArgs.Row.BindingGroup,
                                                                   CultureInfo.CurrentCulture);

            if (!result.IsValid)
            {
                SymptomCathegoriesSearchBox.IsEnabled = false;
                return;
            }

            SymptomCathegoriesSearchBox.IsEnabled = true;

            dbContextSymptomCathegory.SaveChanges();

            dbContextSymptom = new DiseaseDatabaseEntities();
            dbContextSymptom.SymptomCathegories.Load();
            dbContextSymptom.Symptoms.Load();
            _symptomCathegoriesListRemote.Source = dbContextSymptom.SymptomCathegories.Local;
            _symptomViewSource.Source            = dbContextSymptom.Symptoms.Local;
            SymptomDataGrid.Items.Refresh();

            SymptomCathegoriesDataGrid.Items.Refresh();


            symptomCathegoryFlag = false;
        }