Skip to content

Commit

Permalink
Fixed some null objects on editing sample and location from older dat…
Browse files Browse the repository at this point in the history
…asets.
  • Loading branch information
ghuotvez committed Oct 9, 2024
1 parent 9431381 commit c95d027
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion GSCFieldApp/GSCFieldApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<AppxBundlePlatforms>x86|x64|arm</AppxBundlePlatforms>
<AppxSymbolPackageEnabled>False</AppxSymbolPackageEnabled>
<RuntimeIdentifiers>win10-arm;win10-arm-aot;win10-x86;win10-x86-aot;win10-x64;win10-x64-aot</RuntimeIdentifiers>
<PackageCertificateThumbprint>1DA808AB7F24EA5D385C2463C710EEB77A852D73</PackageCertificateThumbprint>
<PackageCertificateThumbprint>14CF0ECF911C8A37CF0E2EF4F8E06F25425B80C1</PackageCertificateThumbprint>
<AppxPackageDir>C:\work data\datacollections\PublishedVersions\</AppxPackageDir>
<GenerateAppInstallerFile>False</GenerateAppInstallerFile>
<AppInstallerUpdateFrequency>100</AppInstallerUpdateFrequency>
Expand Down
4 changes: 2 additions & 2 deletions GSCFieldApp/Package.appxmanifest
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3" xmlns:iot="http://schemas.microsoft.com/appx/manifest/iot/windows10" IgnorableNamespaces="uap mp uap3 iot">
<Identity Name="NaturalResourcesCanada.GeologicalSurveyCanadaField" Publisher="CN=Geological Survey of Canada, O=Natural Resources Canada, C=CA" Version="2.4.1.0" />
<mp:PhoneIdentity PhoneProductId="06e90cbe-1a34-4205-8fe6-3ce0ad4467db" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Identity Name="NaturalResourcesCanada.GeologicalSurveyCanadaField" Publisher="CN=Geological Survey of Canada, O=Natural Resources Canada, C=CA" Version="2.4.4.0" />
<mp:PhoneIdentity PhoneProductId="3ace0625-7c8e-483c-8b82-fd0128bbb63a" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>Geological Survey Canada Field Application</DisplayName>
<PublisherDisplayName>Natural Resources Canada</PublisherDisplayName>
Expand Down
6 changes: 5 additions & 1 deletion GSCFieldApp/ViewModels/LocationViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,12 @@ public void AutoFillDialog(FieldNotes incomingData)
_locationEasting = existingDataDetailLocation.location.LocationEasting.ToString();
_locationNorthing = existingDataDetailLocation.location.LocationNorthing.ToString();
_locationNTS = existingDataDetailLocation.location.locationNTS;
_locationtimestamp = existingDataDetailLocation.location.LocationTimestamp.ToString();

if (existingDataDetailLocation.location.LocationTimestamp != null)
{
_locationtimestamp = existingDataDetailLocation.location.LocationTimestamp.ToString();
}

//Check for manual XY projections
if (existingDataDetailLocation.location.LocationEPSGProj != null && existingDataDetailLocation.location.LocationEPSGProj != string.Empty)
{
Expand Down
16 changes: 12 additions & 4 deletions GSCFieldApp/ViewModels/SampleViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -836,17 +836,25 @@ public string PipePurposes()
return _samplePurposeConcat;
}

/// <summary>
/// Will unpipe any incoming string and build the collection of values out of it
/// </summary>
/// <param name="inPurpose"></param>
public void UnPipePurposes(string inPurpose)
{
List<string> purposesUnpiped = inPurpose.Split(Dictionaries.DatabaseLiterals.KeywordConcatCharacter.Trim().ToCharArray()).ToList();

//Clean values first
_purposeValues.Clear();

foreach (string pu in purposesUnpiped)
if (inPurpose != null && inPurpose != string.Empty)
{
AddAPurpose(pu.Trim());
List<string> purposesUnpiped = inPurpose.Split(Dictionaries.DatabaseLiterals.KeywordConcatCharacter.Trim().ToCharArray()).ToList();

foreach (string pu in purposesUnpiped)
{
AddAPurpose(pu.Trim());
}
}

}

/// <summary>
Expand Down

0 comments on commit c95d027

Please sign in to comment.