/// <summary> /// Encode the raw data using the JAN-13 algorithm. /// </summary> private string Encode_JAN13() { if (!Raw_Data.StartsWith("49")) Error("EJAN13-1: Invalid Country Code for JAN13 (49 required)"); if (!BarcodeLib.CheckNumericOnly(Raw_Data)) Error("EJAN13-2: Numeric Data Only"); EAN13 ean13 = new EAN13(Raw_Data); return ean13.Encoded_Value; }//Encode_JAN13
/// <summary> /// Encode the raw data using the JAN-13 algorithm. /// </summary> private string Encode_JAN13() { if (!Raw_Data.StartsWith("49")) { Error("EJAN13-1: Invalid Country Code for JAN13 (49 required)"); } if (!BarcodeLib.Barcode.CheckNumericOnly(Raw_Data)) { Error("EJAN13-2: нои УбоЧу"); } EAN13 ean13 = new EAN13(Raw_Data); return(ean13.Encoded_Value); }//Encode_JAN13
/// <summary> /// Encode the raw data using the JAN-13 algorithm. /// </summary> private string Encode_JAN13() { if (!Raw_Data.StartsWith("49")) { throw new Exception("EJAN13-1: Invalid Country Code for JAN13 (49 required)"); } if (!Barcode.CheckNumericOnly(Raw_Data)) { throw new Exception("EJAN13-2: Numeric Data Only"); } var ean13 = new EAN13(Raw_Data); return(ean13.Encoded_Value); }
/// <summary> /// Encode the raw data using the JAN-13 algorithm. /// </summary> private string Encode_JAN13() { if (!Raw_Data.StartsWith("49")) { Error("无效国家编码!"); } //if (!Raw_Data.StartsWith("49")) Error("EJAN13-1: Invalid Country Code for JAN13 (49 required)"); if (!CheckNumericOnly(Raw_Data)) { Error("只识别数字数据"); } //Error("EJAN13-2: Numeric Data Only"); EAN13 ean13 = new EAN13(Raw_Data); return(ean13.Encoded_Value); }//Encode_JAN13
/// <summary> /// Encode the raw data using the Bookland/ISBN algorithm. /// </summary> private string Encode_ISBN_Bookland() { if (!CheckNumericOnly(Raw_Data)) { Error("只识别数字数据"); } //Error("EBOOKLANDISBN-1: Numeric Data Only"); string type = "UNKNOWN"; if (Raw_Data.Length == 10 || Raw_Data.Length == 9) { if (Raw_Data.Length == 10) { Raw_Data = Raw_Data.Remove(9, 1); } Raw_Data = "978" + Raw_Data; type = "ISBN"; }//if else if (Raw_Data.Length == 12 && Raw_Data.StartsWith("978")) { type = "BOOKLAND-NOCHECKDIGIT"; }//else if else if (Raw_Data.Length == 13 && Raw_Data.StartsWith("978")) { type = "BOOKLAND-CHECKDIGIT"; Raw_Data = Raw_Data.Remove(12, 1); }//else if //check to see if its an unknown type if (type == "UNKNOWN") { Error("无效输入,必须以 978 开始,并且长度必须为9,10,12,13个字符"); } //if (type == "UNKNOWN") Error("EBOOKLANDISBN-2: Invalid input. Must start with 978 and be length must be 9, 10, 12, 13 characters."); EAN13 ean13 = new EAN13(Raw_Data); return(ean13.Encoded_Value); }//Encode_ISBN_Bookland
/// <summary> /// Encode the raw data using the Bookland/ISBN algorithm. /// </summary> private string Encode_ISBN_Bookland() { if (!Barcode.CheckNumericOnly(Raw_Data)) { throw new Exception("EBOOKLANDISBN-1: Numeric Data Only"); } var type = "UNKNOWN"; if (Raw_Data.Length == 10 || Raw_Data.Length == 9) { if (Raw_Data.Length == 10) { Raw_Data = Raw_Data.Remove(9, 1); } Raw_Data = "978" + Raw_Data; type = "ISBN"; } else if (Raw_Data.Length == 12 && Raw_Data.StartsWith("978")) { type = "BOOKLAND-NOCHECKDIGIT"; } else if (Raw_Data.Length == 13 && Raw_Data.StartsWith("978")) { type = "BOOKLAND-CHECKDIGIT"; Raw_Data = Raw_Data.Remove(12, 1); } //check to see if its an unknown type if (type == "UNKNOWN") { throw new Exception( "EBOOKLANDISBN-2: Invalid input. Must start with 978 and be length must be 9, 10, 12, 13 characters."); } var ean13 = new EAN13(Raw_Data); return(ean13.Encoded_Value); }
/// <summary> /// Encode the raw data using the Bookland/ISBN algorithm. /// </summary> private string Encode_ISBN_Bookland() { if (!BarcodeLib.Barcode.CheckNumericOnly(Raw_Data)) { Error("EBOOKLANDISBN-1: ШэЧфЧЪ боуэЩ нои"); } string type = "UNKNOWN"; if (Raw_Data.Length == 10 || Raw_Data.Length == 9) { if (Raw_Data.Length == 10) { Raw_Data = Raw_Data.Remove(9, 1); } Raw_Data = "978" + Raw_Data; type = "ISBN"; }//if else if (Raw_Data.Length == 12 && Raw_Data.StartsWith("978")) { type = "BOOKLAND-NOCHECKDIGIT"; }//else if else if (Raw_Data.Length == 13 && Raw_Data.StartsWith("978")) { type = "BOOKLAND-CHECKDIGIT"; Raw_Data = Raw_Data.Remove(12, 1); }//else if //check to see if its an unknown type if (type == "UNKNOWN") { Error("EBOOKLANDISBN-2: 9, 10, 12, 13 кЯЯ ЧсуЭЧбн ЧсугуцЭ"); } EAN13 ean13 = new EAN13(Raw_Data); return(ean13.Encoded_Value); }//Encode_ISBN_Bookland