示例#1
0
        private IList <InPage> GetData(long id)
        {
            IList <InPage> input = new List <InPage>();

            using (ProxyArsiv proxy = new ProxyArsiv())
            {
                var news = proxy.Get <News>(id, "2014");

                int clipNumber = 0;
                FilterExpression expression = new FilterExpression();

                expression.Criterias.Add(new Criteria()
                {
                    CriteriaType = CriteriaTypes.Eq, FieldName = Newsclip2Fields.NewsId, FieldValue = news.Id.ToString()
                });

                var newsclips = proxy.GetList <Newsclip2>(expression, "2014");
                foreach (var newsclip in newsclips)
                {
                    var imageData   = proxy.GetClipData(newsclip.ClipId, 2014);
                    var regionData  = Encoding.UTF8.GetString(proxy.GetClipOcrZonesData(newsclip.ClipId, 2014));
                    var ocrchardata = Encoding.UTF8.GetString(proxy.GetClipOcrCharData(newsclip.ClipId, 2014).Data);

                    InPage page = GetInputPage(imageData, regionData, ocrchardata);

                    page.Number = clipNumber;
                    clipNumber++;

                    input.Add(page);

                    PaintZones(page, id);
                    PaintChars(page, id);
                    SeperateZones(page);
                }
            }

            return(input);
        }