Skip to content

Commit

Permalink
NRCan#358 picklist methods now working with french defaulting to engl…
Browse files Browse the repository at this point in the history
…ish if empty.
  • Loading branch information
ghuotvez committed Nov 25, 2024
1 parent d62ac5e commit 6710276
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions GSCFieldApp/Services/Database/DataAccess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using GSCFieldApp.Controls;
using NetTopologySuite.Index.HPRtree;
using Microsoft.Maui.Controls.PlatformConfiguration;
using System.Globalization;

namespace GSCFieldApp.Services.DatabaseServices
{
Expand Down Expand Up @@ -345,6 +346,7 @@ public ComboBox GetComboboxListFromVocab(IEnumerable<Vocabularies> inVocab)
{
newItem.itemValue = vocabs.Code;
}

if (vocabs.Description == null)
{
newItem.itemName = string.Empty;
Expand All @@ -354,6 +356,25 @@ public ComboBox GetComboboxListFromVocab(IEnumerable<Vocabularies> inVocab)
newItem.itemName = vocabs.Description;
}

//Manage language description
if (CultureInfo.CurrentCulture.ToString().ToLower().Contains("fr"))
{

if (vocabs.DescriptionFR != null && vocabs.DescriptionFR != string.Empty)
{
newItem.itemName = vocabs.DescriptionFR;
}
else
{
newItem.itemName = vocabs.Description;
}

}
else
{
newItem.itemName = vocabs.Description;
}

//Select default if stated in database
if (vocabs.DefaultValue != null && vocabs.DefaultValue == Dictionaries.DatabaseLiterals.boolYes)
{
Expand Down

0 comments on commit 6710276

Please sign in to comment.