Example #1
0
 private MergeField FindFirstMergeFieldInAnnexTable()
 {
     return
         (AnnexMergeFields.Single(
              mf => mf.FieldName.OuterTypeName.Equals(TypeName, StringComparison.InvariantCultureIgnoreCase) &&
              mf.FieldName.InnerTypeName.Equals("Order",
                                                StringComparison.InvariantCultureIgnoreCase)));
 }
Example #2
0
 protected MergeField FindFirstMergeFieldInAnnexTable()
 {
     return
         (AnnexMergeFields.Single(
              mf => mf.FieldName.OuterTypeName.Equals(TypeName, StringComparison.InvariantCultureIgnoreCase) &&
              mf.FieldName.InnerTypeName.Equals("RegistrationNumber",
                                                StringComparison.InvariantCultureIgnoreCase)));
 }
Example #3
0
        protected void RemoveAnnex()
        {
            var field = AnnexMergeFields.Single(
                mf => mf.FieldName.InnerTypeName != null && mf.FieldName.InnerTypeName.Equals("Order"));

            var table = field.Run.Ancestors <Table>().First().Ancestors <Table>().First();

            table.Remove();
        }
Example #4
0
        protected void RemoveSiteOfGenerationTable()
        {
            MergeField f = AnnexMergeFields.Single(
                mf => mf.FieldName.OuterTypeName.Equals("SiteOfExport", StringComparison.InvariantCultureIgnoreCase) &&
                mf.FieldName.InnerTypeName.Equals("RegistrationNumber",
                                                  StringComparison.InvariantCultureIgnoreCase));

            f.Run.Ancestors <Table>().First().Remove();
        }
Example #5
0
        private MergeField FindFirstMergeFieldInTable(string id)
        {
            var mergeField = AnnexMergeFields.Single(
                mf => mf.FieldName.OuterTypeName.Equals(id, StringComparison.InvariantCultureIgnoreCase) &&
                mf.FieldName.InnerTypeName.Equals("Name",
                                                  StringComparison.InvariantCultureIgnoreCase));

            return(mergeField);
        }
Example #6
0
        protected void MergeToMainDocument(int annexNumber)
        {
            var properties = PropertyHelper.GetPropertiesForViewModel(typeof(WasteCompositionViewModel));

            foreach (var field in CorrespondingMergeFields)
            {
                MergeFieldDataMapper.BindCorrespondingField(field, new WasteCompositionViewModel(data, annexNumber), properties);
            }

            var nonTableAnnexMergeFields = AnnexMergeFields.Where(f => !(f.FieldName.ToString().Contains("Parameters") || f.FieldName.ToString().Contains("Constituents")));

            foreach (var annexMergeField in nonTableAnnexMergeFields)
            {
                MergeFieldDataMapper.BindCorrespondingField(annexMergeField, data, properties);
            }
        }
Example #7
0
 protected IEnumerable <MergeField> FindProcessOfGenerationTextMergeFields()
 {
     return(AnnexMergeFields.Where(mf => !string.IsNullOrWhiteSpace(mf.FieldName.OuterTypeName) &&
                                   mf.FieldName.OuterTypeName.Equals(PoGtext)));
 }
Example #8
0
 protected IEnumerable <MergeField> FindSiteOfExportMergeFields()
 {
     return(AnnexMergeFields.Where(mf => !string.IsNullOrWhiteSpace(mf.FieldName.OuterTypeName) &&
                                   mf.FieldName.OuterTypeName.Equals(SiteOfExport)));
 }
Example #9
0
 protected MergeField FindAnnexNumberMergeField()
 {
     return(AnnexMergeFields.Single(
                mf => mf.FieldName.InnerTypeName != null && mf.FieldName.InnerTypeName.Equals("AnnexNumber")));
 }