HIBCLICCombinedCodetext

HIBCLICCombinedCodetext class

Kelas untuk encoding dan decoding teks yang disematkan dalam kode HIBC LIC yang menyimpan data primer dan sekunder.

public class HIBCLICCombinedCodetext : HIBCLICComplexCodetext

Konstruktor

NamaKeterangan
HIBCLICCombinedCodetext()Konstruktor default.

Properti

NamaKeterangan
BarcodeType { get; set; }Mendapat atau menyetel jenis barcode. Teks kode HIBC LIC dapat dikodekan menggunakan jenis enkode HIBCCode39LIC, HIBCCode128LIC, HIBCAztecLIC, HIBCDataMatrixLIC, dan HIBCQRLIC. Nilai default: HIBCCode39LIC.
PrimaryData { get; set; }Mengidentifikasi data primer.
SecondaryAndAdditionalData { get; set; }Mengidentifikasi data tambahan sekunder dan tambahan.

Metode

NamaKeterangan
override Equals(object)Mengembalikan nilai yang menunjukkan apakah instance ini sama dengan yang ditentukanHIBCLICCombinedCodetext nilai.
GetBarcodeType()Mendapat jenis barcode.
override GetConstructedCodetext()Membuat codetext
override GetHashCode()Mengembalikan kode hash untuk instance ini.
override InitFromString(string)Menginisialisasi instance dari teks kode yang dibuat.

Contoh

Contoh ini menunjukkan cara menyandikan dan mendekode HIBC LIC menggunakan HIBCLICCombinedCodetext.

[C#]
HIBCLICCombinedCodetext combinedCodetext = new HIBCLICCombinedCodetext();
combinedCodetext.BarcodeType = EncodeTypes.HIBCQRLIC;
combinedCodetext.PrimaryData = new PrimaryData();
combinedCodetext.PrimaryData.ProductOrCatalogNumber = "12345";
combinedCodetext.PrimaryData.LabelerIdentificationCode = "A999";
combinedCodetext.PrimaryData.UnitOfMeasureID = 1;
combinedCodetext.SecondaryAndAdditionalData = new SecondaryAndAdditionalData();
combinedCodetext.SecondaryAndAdditionalData.ExpiryDate = DateTime.Now;
combinedCodetext.SecondaryAndAdditionalData.ExpiryDateFormat = HIBCLICDateFormat.MMDDYY;
combinedCodetext.SecondaryAndAdditionalData.Quantity = 30;
combinedCodetext.SecondaryAndAdditionalData.LotNumber = "LOT123";
combinedCodetext.SecondaryAndAdditionalData.SerialNumber = "SERIAL123";
combinedCodetext.SecondaryAndAdditionalData.DateOfManufacture = DateTime.Now;
using (ComplexBarcodeGenerator generator = new ComplexBarcodeGenerator(combinedCodetext))
{
    Bitmap image = generator.GenerateBarCodeImage();
    using (BarCodeReader reader = new BarCodeReader(image, DecodeType.HIBCQRLIC))
    {
        reader.ReadBarCodes();
        string codetext = reader.FoundBarCodes[0].CodeText;
        HIBCLICCombinedCodetext result = (HIBCLICCombinedCodetext)ComplexCodetextReader.TryDecodeHIBCLIC(codetext);
        Console.WriteLine("Product or catalog number: " + result.PrimaryData.ProductOrCatalogNumber);
        Console.WriteLine("Labeler identification code: " + result.PrimaryData.LabelerIdentificationCode);
        Console.WriteLine("Unit of measure ID: " + result.PrimaryData.UnitOfMeasureID);
        Console.WriteLine("Expiry date: " + result.SecondaryAndAdditionalData.ExpiryDate);
        Console.WriteLine("Quantity: " + result.SecondaryAndAdditionalData.Quantity);
        Console.WriteLine("Lot number: " + result.SecondaryAndAdditionalData.LotNumber);
        Console.WriteLine("Serial number: " + result.SecondaryAndAdditionalData.SerialNumber);
        Console.WriteLine("Date of manufacture: " + result.SecondaryAndAdditionalData.DateOfManufacture);
    }
}

Lihat juga