Skip to content

Commit

Permalink
#354 fixed not updatable project type in field book.
Browse files Browse the repository at this point in the history
  • Loading branch information
ghuotvez committed Jun 20, 2024
1 parent e15d5be commit 1277a0e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions GSCFieldApp/ViewModels/FieldBookDialogViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using SQLite;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Threading.Tasks;
using Template10.Common;
using Template10.Mvvm;
Expand All @@ -22,7 +23,7 @@ public class FieldBookDialogViewModel : ViewModelBase
public FieldBooks existingUserDetail;

//UI
private List<Themes.ComboBoxItem> _projectType = new List<Themes.ComboBoxItem>();
private ObservableCollection<Themes.ComboBoxItem> _projectType = new ObservableCollection<Themes.ComboBoxItem>();
private string _selectedProjectType = string.Empty;
private string _startStationNumber = "1";
private string _projectName = string.Empty;
Expand Down Expand Up @@ -119,7 +120,7 @@ public string StartStationNumber

public string ActivityName { get { return _activityName; } set { _activityName = value; } }
public string Notes { get { return _notes; } set { _notes = value; } }
public List<Themes.ComboBoxItem> ProjectType { get { return _projectType; } set { _projectType = value; } }
public ObservableCollection<Themes.ComboBoxItem> ProjectType { get { return _projectType; } set { _projectType = value; } }
public string SelectedProjectType { get { return _selectedProjectType; } set { _selectedProjectType = value; } }
public bool Enability { get { return _enability; } set { _enability = value; } }

Expand All @@ -141,7 +142,10 @@ private void FillProjectType()

//Init.
string fieldName = Dictionaries.DatabaseLiterals.FieldUserInfoFWorkType;
_projectType = accessData.GetComboboxListWithVocab(userTable, fieldName, out _selectedProjectType);
foreach (var pType in accessData.GetComboboxListWithVocab(userTable, fieldName, out _selectedProjectType))
{
_projectType.Add(pType);
}

//Update UI
RaisePropertyChanged("ProjectType");
Expand Down Expand Up @@ -259,6 +263,7 @@ public void AutoFillDialog(FieldBooks incomingData)
RaisePropertyChanged("GeologistLN");
RaisePropertyChanged("Notes");
RaisePropertyChanged("ActivityName");
RaisePropertyChanged("SelectedProjectType");

}

Expand Down

0 comments on commit 1277a0e

Please sign in to comment.