Ejemplo n.º 1
0
        public override void GetTargetData(IFreeformEntity_MsgTgt tgt, ref List <byte> buffer)
        {
            FFTgt_G2H_Ticket_Void tgt2 = tgt as FFTgt_G2H_Ticket_Void;

            buffer.SetBCDValue(tgt2.Barcode, 9);
            buffer.SetValue(tgt2.Error.GetGmuIdInt8());
        }
Ejemplo n.º 2
0
 internal override IFreeformEntity ParseBufferInternal(ref IFreeformEntity entity, IFreeformEntity rootEntity, int id, byte[] buffer)
 {
     FFTgt_G2H_Ticket_Void tgt = new FFTgt_G2H_Ticket_Void();
     tgt.Barcode = buffer.GetBCDValueString(0, 0, 9);
     tgt.Error = buffer[9].GetAppId<FF_GmuId_TicketPrintStatus, FF_AppId_TicketPrintStatus>();         
     return tgt;
 }
Ejemplo n.º 3
0
        public void Entity_TicketVoid_G2H()
        {
            FFMsg_G2H msg = FreeformEntityFactory.CreateEntity<FFMsg_G2H>(FF_FlowDirection.G2H,
                new FFCreateEntityRequest_G2H()
                {
                    MessageType = FF_AppId_G2H_MessageTypes.FreeForm,
                    Command = FF_AppId_G2H_Commands.ResponseRequest,
                    SessionID = FF_AppId_SessionIds.Tickets,
                    TransactionID = 1,
                });

            FFTgt_B2B_TicketInfo tgt = new FFTgt_B2B_TicketInfo();
            msg.AddTarget(tgt);

            FFTgt_G2H_Ticket_Void tgt2 = new FFTgt_G2H_Ticket_Void();
            tgt.AddTarget(tgt2);

            tgt2.Barcode = "100000000078789098";
            tgt2.Error = FF_AppId_TicketPrintStatus.PaperOut;

            byte[] buffer = FreeformEntityFactory.CreateBuffer(FF_FlowDirection.G2H, msg);
            string sBuffer = buffer.GetConvertBytesToHexString(string.Empty);
            Assert.AreEqual(sBuffer,
                "[05][A2][BC][8A][01][00][01][00][01][00][0D][0A][0B][02][10][00][00][00][00][78][78][90][98][01][C3]");
        }
Ejemplo n.º 4
0
        internal override IFreeformEntity ParseBufferInternal(ref IFreeformEntity entity, IFreeformEntity rootEntity, int id, byte[] buffer)
        {
            FFTgt_G2H_Ticket_Void tgt = new FFTgt_G2H_Ticket_Void();

            tgt.Barcode = buffer.GetBCDValueString(0, 0, 9);
            tgt.Error   = buffer[9].GetAppId <FF_GmuId_TicketPrintStatus, FF_AppId_TicketPrintStatus>();
            return(tgt);
        }