1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- using Org.BouncyCastle.Asn1.Ocsp;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace HengshanPaymentTerminal.MessageEntity.Outgoing
- {
- /// <summary>
- /// 发送取消授权给油机数据对象
- /// </summary>
- public class SendUnAuthorization:CommonMessage
- {
- /// <summary>
- /// 请求授权的枪号
- /// </summary>
- public int NozzleNum { get; set; }
- /// <summary>
- /// 请求授权时间
- /// </summary>
- private DateTime AuthorizationTime { get; set; }
- /// <summary>
- /// 授权后分配的流水号
- /// </summary>
- private int TTC { get; set; }
- public SendUnAuthorization(int nozzleNum, DateTime authorizationTime, int tTC,byte frame)
- {
- this.Handle = (byte)Command.CANCEL_ACCREDIT;
- NozzleNum = nozzleNum;
- AuthorizationTime = authorizationTime;
- TTC = tTC;
- this.FrameNum = frame;
- }
- public override byte[] ToCommonByteArray()
- {
- List<Byte> list = new List<Byte>();
- byte[] commandAndNozzle = { this.Handle, (byte)this.NozzleNum };
- byte[] authorizationTimeBytes = ConvertDateTimeToByteArray(this.AuthorizationTime);
- byte[] ttcBytes = NumberToByteArrayWithPadding(this.TTC, 4);
- list.AddRange(commandAndNozzle);
- list.AddRange(authorizationTimeBytes);
- list.AddRange(ttcBytes);
- byte[] sendBytes = content2data(list.ToArray());
- return sendBytes;
- }
- public override CommonMessage ToObject(byte[] datas)
- {
- return this;
- }
- }
- }
|