Added logic to verify that a section number is a valid number rather than crashing on an invalid number.

This commit is contained in:
Rich 2013-11-15 18:02:25 +00:00
parent 760aa9d90e
commit 4765587f4d

View File

@ -4883,7 +4883,10 @@ namespace VEPROMS.CSLA.Library
// if the section's tab is a letter, we don't want a 0 on the section.... for example A.0.
if (IsSection && tmpstr == null && System.Char.IsLetter(DisplayNumber, 0)) return -1;
if (tmpstr != null && tmpstr.IndexOf('-') >= 0) return -1;
return tmpstr==null?0:System.Convert.ToInt32(tmpstr);
if (tmpstr == null) return 0;
Int32 x;
if(Int32.TryParse(tmpstr, out x))return x;
return -1;
}
return (-1);
}