Esempio n. 1
0
        public Response GetAllToDoItem()
        {
            var service = new TodoListServiceClient();
            var result  = new Response();

            try
            {
                if (service != null)
                {
                    var jsonResult = service.GetAllData();
                    result = JsonConvert.DeserializeObject <Response>(jsonResult);
                }
            }
            catch (Exception)
            {
                return(result);
            }
            finally
            {
                service.Close();
            }
            return(result);
        }
Esempio n. 2
0
        public Response ChangeStatusToDoItem(Guid id, string status)
        {
            var service = new TodoListServiceClient();
            var result  = new Response();

            try
            {
                if (service != null)
                {
                    var jsonResult = service.ChangeStatus(id, status);
                    result = JsonConvert.DeserializeObject <Response>(jsonResult);
                }
            }
            catch (Exception)
            {
                return(result);
            }
            finally
            {
                service.Close();
            }
            return(result);
        }