public void ParseOwnedPropertyManyValuesInOneCell(Person person, string ownTypeByColumn = null) { for (int i = 0; i < GetMaxDataItemsCount(); ++i) { ParseOwnedPropertySingleRow( EstateTypeCell.GetParsedItem(i), OwnTypeCell.GetParsedItem(i), SquareCell.GetParsedItem(i), CountryCell.GetParsedItem(i), person, ownTypeByColumn ); } }
void ParseTypeAndCountry(DataRow currRow, DeclarationField realtyType, string ownTypeByColumn, Person person) { var typeAndCountry = new TRealtyCell(currRow.GetDeclarationField(realtyType)); var cellSquareField = (realtyType == DeclarationField.OwnedRealEstateTypeAndCountry) ? DeclarationField.OwnedRealEstateSquare : DeclarationField.StatePropertySquare; var squareCell = new TRealtyCell(currRow.GetDeclarationField(cellSquareField)); List <int> linesWithNumbers = TRealtyCellSpan.GetLinesStaringWithNumbers(squareCell.DataCell.GetText(true)); if (linesWithNumbers.Count > 0) { typeAndCountry.ParseByEmptyLines(linesWithNumbers); squareCell.ParseByEmptyLines(linesWithNumbers); } for (int i = 0; i < squareCell.ParsedItems.Count; ++i) { var typeAndCountryStr = typeAndCountry.GetParsedItem(i); var type = typeAndCountryStr; var countryStr = ""; if (typeAndCountryStr.Contains('(')) { int bracket = typeAndCountryStr.IndexOf('('); type = typeAndCountryStr.Substring(0, bracket).Trim(); countryStr = typeAndCountryStr.Substring(bracket).Trim(' ', '\n', '(', ')'); } var squareRaw = squareCell.GetParsedItem(i); RealEstateProperty realEstateProperty = new RealEstateProperty(); realEstateProperty.Text = type; realEstateProperty.type_raw = type; realEstateProperty.square = DataHelper.ParseSquare(squareRaw); realEstateProperty.square_raw = ParserBase.NormalizeRawDecimalForTest(squareRaw); realEstateProperty.country_raw = DataHelper.ParseCountry(countryStr).NormSpaces(); realEstateProperty.own_type_by_column = ownTypeByColumn; person.RealEstateProperties.Add(realEstateProperty); } }