Ejemplo n.º 1
0
        private static bool CheckResultStatus(EntityResultSearch res)
        {
            if (res.Code != 0)
            {
                return(false);
            }

            var counts = res.Progress.Split(new string[] { " of " }, StringSplitOptions.RemoveEmptyEntries);

            return(counts[0] == counts[1]);
        }
Ejemplo n.º 2
0
        private EntityResultSearch GetResultSearch(string url)
        {
            var str = _httpService.RequestGet(url, HttpService.EnumContentType.Json);
            var res = JsonConvert.DeserializeObject <JsonResponsResult>(str);

            var result = new EntityResultSearch()
            {
                Exception = res.Exception,
                TokenTask = res.Response.Task
            };

            return(result);
        }
Ejemplo n.º 3
0
        public EntityResultSearch SearchGroopPerson(IEnumerable <EntityPerson> persons, string key)
        {
            var str = _httpService.RequestPost(_urlSearchGroop, GetRequestBodyPerson(persons, key), HttpService.EnumContentType.Json);
            var res = JsonConvert.DeserializeObject <JsonResponsResult>(str);

            var result = new EntityResultSearch()
            {
                Exception = res.Exception,
                TokenTask = res.Response.Task
            };

            return(result);
        }
Ejemplo n.º 4
0
        public EntityResultSearch Status(string token, string key)
        {
            var url = $"status?token={key}&task={token}";

            var str = _httpService.RequestGet(url, HttpService.EnumContentType.Json);

            System.Diagnostics.Debug.WriteLine(str);
            var res = JsonConvert.DeserializeObject <JsonResponsResult>(str);

            var result = new EntityResultSearch()
            {
                Exception = res.Exception,
                Code      = res.Code,
                Progress  = res.Response?.Progress
            };

            return(result);
        }