public override char CalcCheckChar(char[] acText, int cc) { return(UPCA.s_CalcCheckChar(acText, cc)); }
public static char s_CalcCheckChar(char[] acText, int cc) { int num; char[] chArray = new char[11]; for (num = 0; num < 11; num++) { chArray[num] = '0'; } char ch = acText[6]; switch (ch) { case '0': case '1': case '2': num = 0; while (num < 3) { chArray[num] = acText[num]; num++; } chArray[3] = ch; for (num = 0; num < 3; num++) { chArray[num + 8] = acText[num + 3]; } break; case '3': num = 0; while (num < 4) { chArray[num] = acText[num]; num++; } for (num = 0; num < 2; num++) { chArray[num + 9] = acText[num + 4]; } break; case '4': for (num = 0; num < 5; num++) { chArray[num] = acText[num]; } chArray[10] = acText[5]; break; case '5': case '6': case '7': case '8': case '9': for (num = 0; num < 6; num++) { chArray[num] = acText[num]; } chArray[10] = ch; break; } return(UPCA.s_CalcCheckChar(chArray, 11)); }