B2021-143 leading zeros in revision numbers were being removed when the auto increment was used.
This commit is contained in:
parent
2240fa9f0f
commit
42ae2bf2e8
@ -636,7 +636,12 @@ namespace VEPROMS
|
||||
{
|
||||
bool rv = true;
|
||||
if (Regex.IsMatch(ap.RevNumber, "^[0-9]+$"))
|
||||
ap.RevNumber = (int.Parse(ap.RevNumber) + 1).ToString();
|
||||
{
|
||||
// B2021-143 build a string format that will put leading zeros if the rev number (integer) has less digits than the initial rev string length
|
||||
string preZerosRevFmt = string.Format("D{0}", ap.RevNumber.Length);
|
||||
int revNum = int.Parse(ap.RevNumber) + 1;
|
||||
ap.RevNumber = revNum.ToString(preZerosRevFmt);
|
||||
}
|
||||
else if (Regex.IsMatch(ap.RevNumber, "^[0-9]*[a-yA-Y]+$"))
|
||||
{
|
||||
char lastCar = ap.RevNumber[ap.RevNumber.Length - 1];
|
||||
@ -650,10 +655,9 @@ namespace VEPROMS
|
||||
string[] parts = ap.RevNumber.Split(".".ToCharArray());
|
||||
string sep = "";
|
||||
string lastPart = parts[parts.Length - 1];
|
||||
int w = lastPart.Length;
|
||||
lastPart = (int.Parse(lastPart) + 1).ToString();
|
||||
//if(w > lastPart.Length)
|
||||
lastPart = lastPart.PadLeft(w, '0');
|
||||
// B2021-143 build a string format that will put leading zeros if the rev number (integer) has less digits than the initial rev string length
|
||||
string preZerosRevFmt = string.Format("D{0}", lastPart.Length);
|
||||
lastPart = (int.Parse(lastPart) + 1).ToString(preZerosRevFmt);
|
||||
parts[parts.Length - 1] = lastPart;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
foreach (string part in parts)
|
||||
@ -664,7 +668,7 @@ namespace VEPROMS
|
||||
ap.RevNumber = sb.ToString();
|
||||
}
|
||||
else if (Regex.IsMatch(ap.RevNumber, "[?]$"))
|
||||
rv = false; //do nothing
|
||||
rv = false; //do nothing
|
||||
else
|
||||
{
|
||||
ap.RevNumber += " ?";
|
||||
|
Loading…
x
Reference in New Issue
Block a user