public override void GetTargetData(IFreeformEntity_MsgTgt tgt, ref List <byte> buffer) { FFTgt_G2H_Ticket_Redemption_Close tgt2 = tgt as FFTgt_G2H_Ticket_Redemption_Close; buffer.SetValue(tgt2.Status.GetGmuIdInt8()); buffer.SetBCDValue(tgt2.Barcode, 9); buffer.SetBCDValue(tgt2.Amount, 4); buffer.SetValue(tgt2.Type.GetGmuIdInt8()); }
internal override IFreeformEntity ParseBufferInternal(ref IFreeformEntity entity, IFreeformEntity rootEntity, int id, byte[] buffer) { FFTgt_G2H_Ticket_Redemption_Close tgt = new FFTgt_G2H_Ticket_Redemption_Close(); tgt.Status = buffer[0].GetAppId <FF_GmuId_TicketRedemption_Close_Status, FF_AppId_TicketRedemption_Close_Status>(); tgt.Barcode = buffer.GetBCDValueString(0, 1, 9); tgt.Amount = buffer.GetBytesToBCDDouble(10, 4); tgt.Type = buffer[14].GetAppId <FF_GmuId_TicketTypes, FF_AppId_TicketTypes>(); return(tgt); }
public void Entity_TicketRedeem_End_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_Redemption_Close tgt2 = new FFTgt_G2H_Ticket_Redemption_Close(); tgt.AddTarget(tgt2); tgt2.Status = FF_AppId_TicketRedemption_Close_Status.Success; tgt2.Barcode = "100000000078789098"; tgt2.Amount = 9856; tgt2.Type = FF_AppId_TicketTypes.Cashable; 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][12][0A][10][04][00][10][00][00][00][00][78][78][90][98][00][00][98][56][00][CA]"); }
internal override IFreeformEntity ParseBufferInternal(ref IFreeformEntity entity, IFreeformEntity rootEntity, int id, byte[] buffer) { FFTgt_G2H_Ticket_Redemption_Close tgt = new FFTgt_G2H_Ticket_Redemption_Close(); tgt.Status = buffer[0].GetAppId<FF_GmuId_TicketRedemption_Close_Status,FF_AppId_TicketRedemption_Close_Status>(); tgt.Barcode = buffer.GetBCDValueString(0, 1, 9); tgt.Amount = buffer.GetBytesToBCDDouble(10, 4); tgt.Type = buffer[14].GetAppId<FF_GmuId_TicketTypes, FF_AppId_TicketTypes>(); return tgt; }