public override void Execute(Protocol.Clients.PosStoreClient posStoreClient, Protocol.RequestInfos.PosStorePackageInfo package) { var datas = package.Read <PaySn>(); PaySn customOrderSn = new PaySn(datas.CompanyToken, datas.StoreId, datas.MachineSn); if (customOrderSn.SerialNumber <= datas.SerialNumber) { customOrderSn.ResetSerialNumber(datas.SerialNumber); } else { posStoreClient.SendObject(this.CmdCode, customOrderSn); } }
public override void Execute(Protocol.Clients.PosStoreClient posStoreClient, Protocol.RequestInfos.PosStorePackageInfo package) { var datas = package.Read <PaySnDto>(); PaySn customOrderSn = new PaySn(datas.CompanyId, datas.StoreId, datas.MachineSn); if (customOrderSn.GetNumber() <= datas.Number) { customOrderSn.ResetSerialNumber(datas.Number); } else { posStoreClient.SendObject(this.CmdCode, new PaySnDto() { CompanyId = customOrderSn.CompanyId, MachineSn = customOrderSn.MachineSn, StoreId = customOrderSn.StoreId, Name = customOrderSn.Name, Number = customOrderSn.GetNumber(), SwiftNumberMode = customOrderSn.SwiftNumberMode }); } }
public static void Sub() { new EventAggregator().Subscribe <SyncMemberNoEvent>("SyncMemberNoEventForServer", (o) => { MemberNo memberNo = new MemberNo(o.CompanyId, o.StoreId); if (memberNo.GetNumber() < o.Number) { memberNo.Reset(o.Number); } }); new EventAggregator().Subscribe <SyncOnlineEvent>("SyncOnlineEventForServer", (o) => { var cache = new OnlineCache(); var key = KeyFactory.MachineKeyFactory(o.CompanyToken, o.StoreId, o.MachineSn, o.DeviceSn); cache.Set(key, new MachineInformation() { CashierName = o.CashierName, CashierOperateAuth = o.CashierOperateAuth, CashierUid = o.CashierUid, CashierUserCode = o.CashierUserCode, CompanyToken = o.CompanyToken, DeviceSn = o.DeviceSn, InTestMode = o.InTestMode, MachineSn = o.MachineSn, StoreId = o.StoreId, StoreName = o.StoreName }); }); new EventAggregator().Subscribe <SyncSerialNumberEvent>("SyncSerialNumberEventForServer", (o) => { PaySn customOrderSn = new PaySn(o.CompanyToken, o.StoreId, o.MachineSn); if (customOrderSn.GetNumber() < o.Number) { customOrderSn.ResetSerialNumber(o.Number); } }); }
public override void Excute(PosStoreServer server, PosStoreSession session, PosStoreRequestInfo requestInfo) { try { var datas = requestInfo.Read <PaySnDto>(); PaySn customOrderSn = new PaySn(datas.CompanyId, datas.StoreId, datas.MachineSn); if (customOrderSn.GetNumber() <= datas.Number) { customOrderSn.ResetSerialNumber(datas.Number); } else { session.SendObject(this.CmdCode, new PaySnDto() { CompanyId = customOrderSn.CompanyId, MachineSn = customOrderSn.MachineSn, StoreId = customOrderSn.StoreId, Name = customOrderSn.Name, Number = customOrderSn.GetNumber(), SwiftNumberMode = customOrderSn.SwiftNumberMode }); } } catch (Exception ex) { Console.WriteLine(ex.Message); } }