public static int Main() { try { GS1 <string> TestValue = new GS1 <string>("string"); Sub obj = new Sub(); obj.vMeth1 <GS1 <string> >(TestValue); obj.vMeth2 <GS1 <string> >(out TestValue); System.Console.WriteLine(TestValue.t); // no exceptions caught Console.WriteLine("PASS"); return(100); } catch (System.NotSupportedException ex) { Console.WriteLine("{0} \n Caught unexpected System.NotSupportedException exception.", ex); Console.WriteLine("FAIL"); return(101); } catch (System.Exception ex) { Console.WriteLine("{0} \n Caught unexpected exception.", ex); Console.WriteLine("FAIL"); return(101); } }
/// <summary> /// Construtor via Objeto /// </summary> /// <param name="param">Objeto Padrão GS1</param> public GS1(GS1 param) { this.Header = param.Header; this.Filter = param.Filter; this.Partition = param.Partition; this.CompanyPrefix = param.CompanyPrefix; this.ItemReference = param.ItemReference; this.SerialNumber = param.SerialNumber; this.Barcode = param.Barcode; this.Reserved = param.Reserved; }
/// <summary> /// Método de geração do EPC. /// </summary> /// <param name="Parametro">Tipo primitivo GS1</param> /// <returns></returns> public static EPCSimplesDTO SerializarGenerico(GS1 Parametro) { switch (EpcHeaders.GetBin(Parametro.Header)) { case EpcHeaders.SGTIN_96: return(new Sgtin96(Parametro).Encript()); case EpcHeaders.GRAI_96: return(new Grai96(Parametro).Encript()); case EpcHeaders.GIAI_96: return(new Giai96(Parametro).Encript()); default: return(null); } }
public static EPCSimplesDTO EncriptFiltro(GS1 Parametro, string barcode = "", long serial = 0, int partition = 6) { if (barcode.Length == 0) { switch (EpcHeaders.GetBin(Parametro.Header)) { case EpcHeaders.SGTIN_96: return(new Sgtin96(Parametro).Encript()); case EpcHeaders.GRAI_96: return(new Grai96(Parametro).Encript()); case EpcHeaders.GIAI_96: return(new Giai96(Parametro).Encript()); default: return(null); } } else { return(new Sgtin96(barcode, serial, partition).Encript()); } }
/// <summary> /// Construtor via Objeto /// </summary> /// <param name="param">Objeto Padrão GS1</param> public Giai96(GS1 param) : base(param) { }
public Bitmap Generate(GS1.GS1Builder value, BarcodeSettings settings) { AiMarker = value.FNC1; _Value = value; return Generate(value.ToString(), settings); }
//public Bitmap Generate(int aiCode, string value) //{ // return Generate(aiCode, value, DefaultSettings); //} //public Bitmap Generate(int aiCode, int specifier, string value) //{ // return Generate(aiCode, specifier, value, DefaultSettings); //} //public Bitmap Generate(int aiCode, int specifier, string value, BarcodeSettings settings) //{ // return Generate(CreateEAN128(aiCode, specifier, value), settings); //} //public Bitmap Generate(int aiCode, string value, BarcodeSettings settings) //{ // return Generate(CreateEAN128(aiCode,value), settings); //} //public Bitmap Generate(Dictionary<int, string> values) //{ // return Generate(values, DefaultSettings); //} //public Bitmap Generate(Dictionary<int, string> values, BarcodeSettings settings) //{ // StringBuilder s = new StringBuilder(); // s.Append(Code128Helper.StartVariantB); // foreach (KeyValuePair<int, string> item in values) // { // s.Append(CreateEAN128(item.Key, item.Value)); // } // return Generate(s.ToString(), settings); //} public Bitmap Generate(GS1.GS1Builder value) { AiMarker = value.FNC1; _Value = value; return Generate(value.ToString()); }
/// <summary> /// Construtor via Objeto /// </summary> /// <param name="param">Objeto Padrão GS1</param> public Sgtin96(GS1 param) : base(param) { }