Beispiel #1
0
        public byte[] HandleIncreaseProductAmount(string json)
        {
            IncreaseProductAmountRequest res = JsonConvert.DeserializeObject <IncreaseProductAmountRequest>(json);
            Tuple <bool, string>         ans = storeService.IncreaseProductAmount(res.StoreId, res.Username, res.ProductId, res.Amount);
            string jsonAns = Seralize(new SuccessFailResponse(ans.Item1, ans.Item2));

            return(security.Encrypt(jsonAns));
        }
        async public Task <SuccessFailResponse> IncreaseProductAmount(int storeId, string username, int productId, int delta)
        {
            IncreaseProductAmountRequest request = new IncreaseProductAmountRequest(storeId, username, productId, delta);

            comm.SendRequest(request);
            SuccessFailResponse response = await comm.Get <SuccessFailResponse>();

            return(response);
        }