示例#1
0
        private static DataField FindDataLine(ProcessedDocument document, string name, string title, MortgageApplicationDocument mortgageApplication, params string[] titlesToFind)
        {
            ProcessedLine foundLine = null;

            foreach (var titleToFind in titlesToFind)
            {
                string cleanTitle = CLEANUP.Replace(titleToFind, "");
                foundLine = document.Lines.Where(l => CLEANUP.Replace(l.Text, "").IndexOf(cleanTitle, StringComparison.OrdinalIgnoreCase) > -1).FirstOrDefault();

                if (foundLine != null)
                {
                    break;
                }
            }

            var dataLine = foundLine?.BoundingBox.FindClosestsBelow(document.Lines) ?? null;

            if (dataLine == null)
            {
                return(null);
            }

            DataField dataField = new DataField()
            {
                FieldName  = name,
                FieldTitle = title,
                LabelBox   = foundLine.BoundingBox,
                ValueBox   = dataLine.BoundingBox,
                Value      = dataLine.Text
            };

            if (mortgageApplication.DataFields == null)
            {
                mortgageApplication.DataFields = new List <DataField>();
            }

            mortgageApplication.DataFields.Add(dataField);

            return(dataField);
        }
 private void CommonFill(string content)
 {
     MethodsNames.Clear();
     var breakInLine = content.Split('\n');
     foreach (var oneLine in breakInLine.Where(s=>!String.IsNullOrWhiteSpace(s)))
     {
         var pl = new ProcessedLine();
         var currentLine = oneLine.Replace("\r", "");
         currentLine = currentLine.Split(',')[0];
         if (oneLine.Contains("MISS !"))
         {
             //We need To Process the miss.
             currentLine = currentLine.Replace("MISS ! ", "");
             pl.Missing = true;
         }
         else
         {
             pl.Missing = false;
         }
         currentLine = currentLine.Replace("Method: ", "");
         pl.MethodSignature = currentLine;
         MethodsNames.Add(pl);
     }
 }