Пример #1
0
        public async Task <ExpenseCollectionResponse> GetExpenseCollections(ExpenseCollectionRequest request)
        {
            var json = JsonConvert.SerializeObject(request);
            var resp = await PostForString(new Uri(ApiUrl + "expensecollections/act"), json);

            if (resp.IsSuccessfull)
            {
                try
                {
                    return(JsonConvert.DeserializeObject <ExpenseCollectionResponse>(resp.Response));
                }
                catch (Exception ex)
                {
                    LogHelper.Instance.LogException(ex, this);
                    return(new ExpenseCollectionResponse()
                    {
                        ErrorMessage = "Unserialisation failed for Description " + resp.Response
                    });
                }
            }
            return(new ExpenseCollectionResponse()
            {
                ErrorMessage = resp.ErrorMessage
            });
        }
Пример #2
0
        public Task <BooleanResponse> PostExpenseCollection(ExpenseCollectionRequest request)
        {
            var json = JsonConvert.SerializeObject(request);

            return(PostForBoolean(new Uri(ApiUrl + "expensecollections/act"), json));
        }