コード例 #1
0
            public void CreateNewRelative(DataRow row)
            {
                Logger.Debug("Relative {0} at row {1}", row.RelativeType, row.GetRowIndex());
                if (CurrentDeclarant == null)
                {
                    if (FailOnRelativeOrphan)
                    {
                        throw new SmartParserRelativeWithoutPersonException(
                                  string.Format("Relative {0} at row {1} without main Person", row.RelativeType, row.GetRowIndex()));
                    }
                    else
                    {
                        return;
                    }
                }
                Relative relative = new Relative();

                CurrentDeclarant.AddRelative(relative);
                CurrentPerson = relative;

                RelationType relationType = DataHelper.ParseRelationType(row.RelativeType, false);

                if (relationType == RelationType.Error)
                {
                    throw new SmartParserException(
                              string.Format("Wrong relative name '{0}' at row {1} ", row.RelativeType, row));
                }
                relative.RelationType      = relationType;
                relative.document_position = row.NameDocPosition;
                relative.sheet_index       = _Declaration.Properties.SheetNumber;
            }
コード例 #2
0
            public void CreateNewDeclarant(IAdapter adapter, DataRow row)
            {
                Logger.Debug("Declarant {0} at row {1}", row.PersonName, row.GetRowIndex());
                CurrentDeclarant = new PublicServant();
                InitDeclarantProperties(row);
                if (CurrentSection != null)
                {
                    CurrentDeclarant.Department = CurrentSection.Name;
                }

                CurrentDeclarant.Index = row.GetPersonIndex();

                CurrentPerson = CurrentDeclarant;
                CurrentPerson.document_position = row.NameDocPosition;
                CurrentPerson.sheet_index       = _Declaration.Properties.SheetNumber;
                _Declaration.PublicServants.Add(CurrentDeclarant);
            }
コード例 #3
0
 public void FinishDeclarant()
 {
     CurrentDeclarant = null;
     CurrentPerson    = null;
 }