Skip to content

Commit

Permalink
#359 fixed photo number calc failing with Ganfeld 2 digits photos.
Browse files Browse the repository at this point in the history
  • Loading branch information
ghuotvez committed Sep 18, 2024
1 parent 3a99aaf commit 9431381
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion GSCFieldApp/Services/DatabaseServices/DataIDCalculation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,18 @@ public string CalculateDocumentAlias(int parentID, string parentAlias, int start
{
string lastAlias = docParent.ToList()[0].ToString(); //Select first element since the list has been sorted in descending order
string lastNumberString = lastAlias.Substring(lastAlias.Length - 3); //Document only has three digits id in the alias
int newNumber = Convert.ToInt16(lastNumberString) + startingDocNumber;
string validLastNumber = string.Empty;
foreach (char c in lastNumberString)
{
if (char.IsNumber(c))
{
//Rebuild number
validLastNumber = validLastNumber + c;
}

}

int newNumber = Convert.ToInt16(validLastNumber) + startingDocNumber;

bool breaker = true;
while (breaker)
Expand Down

0 comments on commit 9431381

Please sign in to comment.