Пример #1
0
        public MemberInfo SetMember(SetMemberRequest requestParams)
        {
            var shoppingcart = ShoppingCartFactory.Factory(requestParams.StoreId, requestParams.MachineSn, requestParams.CID, requestParams.DeviceSn);
            var memnerInfo   = shoppingcart.SetMember(requestParams.CardNo, requestParams.Phone, requestParams.To);

            ShoppingCartFactory.ResetCache(shoppingcart, requestParams.StoreId, requestParams.MachineSn, requestParams.CID, requestParams.DeviceSn);
            return(memnerInfo);
        }
Пример #2
0
        private BaseResponse _handler_SetMember(BasePacket packet)
        {
            SetMemberRequest p = packet as SetMemberRequest;

            ProxyHolder proxy = this.GetProxyByID(p.ObjectID);

            if (proxy == null)
            {
                throw new Exception("Proxy Nr. not found: " + p.ObjectID);
            }

            return(new SetMemberResponse(proxy.SetMember(p.Name, p.Value), p));
        }
Пример #3
0
        public override bool TrySetMember(SetMemberBinder binder, object value)
        {
            SetMemberRequest req = new SetMemberRequest(value, this.ObjectID, binder.Name);

            this.Client.Send(req);
            BaseResponse resp = this.Client.WaitForResponse(req, 50000000);

            if (resp is SetMemberResponse)
            {
                return((resp as SetMemberResponse).Success);
            }
            else if (resp is ExceptionResponse)
            {
                throw new Exception((resp as ExceptionResponse).Message);
            }
            else
            {
                return(false);
            }
            return(true);
        }