Ejemplo n.º 1
0
        public override void Execute(Protocol.Clients.PosStoreClient posStoreClient, Protocol.RequestInfos.PosStorePackageInfo package)
        {
            var datas = package.Read <DatabaseChanged>();

            if (datas != null)
            {
                RedisManager.Publish("SyncDatabase", datas.Target);
            }
        }
Ejemplo n.º 2
0
        public override void Execute(Protocol.Clients.PosStoreClient posStoreClient, Protocol.RequestInfos.PosStorePackageInfo package)
        {
            var datas = package.Read <MachineInformation>();

            if (datas != null)
            {
                var cache = new OnlineCache();
                var key   = KeyFactory.MachineKeyFactory(datas.CompanyToken, datas.StoreId, datas.MachineSn, datas.DeviceSn);
                cache.Set(key, datas);
            }
        }
Ejemplo n.º 3
0
        public override void Execute(Protocol.Clients.PosStoreClient posStoreClient, Protocol.RequestInfos.PosStorePackageInfo package)
        {
            var jsonSerializerSettings = new Newtonsoft.Json.JsonSerializerSettings();

            jsonSerializerSettings.Converters.Add(new BarcodeConverter());
            var shoppingcart = package.Read <ShoppingCart>(jsonSerializerSettings);

            if (shoppingcart != null)
            {
                var    shoppingCartCache = new ShoppingCartCache();
                string key = KeyFactory.MachineKeyFactory(shoppingcart.MachineInformation.CompanyToken, shoppingcart.MachineInformation.StoreId, shoppingcart.MachineInformation.MachineSn, shoppingcart.MachineInformation.DeviceSn);
                shoppingCartCache.Set(key, shoppingcart);
            }
        }
        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);
            }
        }
Ejemplo n.º 5
0
        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
                });
            }
        }
Ejemplo n.º 6
0
 public virtual void Execute(Protocol.Clients.PosStoreClient posStoreClient, Protocol.RequestInfos.PosStorePackageInfo package)
 {
 }