Example #1
0
        private async Task <bool> GetUserInformation()
        {
            //User Information
            var uri    = _timeTaskService.BaseUri + "me";
            var result = await _timeTaskService.MakeServiceCall(uri, RequestType.Get);

            if (string.IsNullOrEmpty(result))
            {
                return(false);
            }
            Me = JsonConvert.DeserializeObject <MeObject>(result);
            return(true);
        }
Example #2
0
        public async Task <string> SubmitAllTimes()
        {
            var uri    = _timeTaskService.BaseUri + "time/";
            var errors = string.Empty;

            foreach (var time in _times)
            {
                var stringContent = new StringContent(JsonConvert.SerializeObject(time), Encoding.UTF8, "application/json");
                var message       = await _timeTaskService.MakeServiceCall(uri, RequestType.Post, stringContent);

                var timeResponse = JsonConvert.DeserializeObject <TimeResponseObject>(message);
                if (timeResponse == null)
                {
                    errors += " " + time.date;
                }
            }

            return(errors);
        }