public override void Encode() { encodeBuf.Clear(); base.Decode(); encodeBuf.AddRange(AddString(TxnType, 2)); encodeBuf.AddRange(AddString(DeviceId, 8)); encodeBuf.AddRange(AddString(OperatorId, 6)); encodeBuf.AddRange(AddString(ShiftId.PadLeft(10, '0'), 10)); encodeBuf.AddRange(AddString(SerialNumber.PadLeft(4, '0'), 4)); encodeBuf.AddRange(AddString(TxnTime, 14)); encodeBuf.AddRange(AddString(StationId, 4)); encodeBuf.AddRange(AddString(DestinationStationId, 4)); encodeBuf.AddRange(AddString(ReportDate, 8)); encodeBuf.AddRange(AddString(TicketMainType, 2)); encodeBuf.AddRange(AddString(TicketSubType, 2)); encodeBuf.AddRange(AddString(UnitPrice.PadLeft(16, '0'), 16)); encodeBuf.AddRange(AddString(TotalAmount.PadLeft(4, '0'), 4)); encodeBuf.AddRange(AddString(TxTotalAmt.PadLeft(16, '0'), 16)); encodeBuf.AddRange(AddString(ManualId, 10)); encodeBuf.AddRange(AddString(Spare.PadLeft(4, '0'), 4)); }