public override void Insert(TextFileWriter writer)
        {
            if (null != this.Target && null != this.PropertyGetter)
            {
                this.Value = this.PropertyGetter(this, this.Target);
            }
            else
            {
                this.Value = this.SignatureValue;
            }

            writer.AppendCSV(this.FieldType.FormatVariableLengthValue(this.Value, this.Length));
        }
 public override void Insert(TextFileWriter writer)
 {
     if (null != this.PropertyGetter)
     {
         this.Value = this.PropertyGetter(this, this.Target);
     }
     if (null == this.SignatureMapper)
     {
         throw new Exception(this.FieldInfo + " - Signature field mapper is empty.");
     }
     this.SignatureMapper.Target = this.Value;
     this.SignatureMapper.Insert(writer);
     base.Insert(writer);
 }
        public override void Insert(TextFileWriter writer)
        {
            if (null != this.Target && null != this.PropertyGetter)
            {
                this.Value = this.PropertyGetter(this, this.Target);
            }

            foreach (var f in this.FieldMappers)
            {
                f.Target = this.Value;
                f.Insert(writer);
            }
            this.Value = null;
        }
Example #4
0
 public override void Insert(TextFileWriter writer)
 {
     if (null != this.PropertyGetter)
     {
         this.Value = this.PropertyGetter(this, this.Target);
     }
     try
     {
         writer.AppendCSV(this.FieldType.FormatVariableLengthValue(this.Value, this.Length));
     }
     catch (Exception exc)
     {
         throw new Exception(this.FieldInfo + ": \"" + this.Value + "\" : " + exc.ToString());
     }
 }
        public override void Export(TextFileWriter writer)
        {
            if (null == this.Target)
            {
                throw new Exception("The export instance is null.");
            }

            this.HeaderMapper.Value = this.DetailMapper.Target = this.FooterMapper.Value = this.Target;

            this.HeaderMapper.Insert(writer);
            writer.Next();

            this.DetailMapper.Export(writer);

            this.FooterMapper.Insert(writer);
            writer.Next();
        }
Example #6
0
 public override void Insert(TextFileWriter writer)
 {
     if (null == this.PropertyGetter)
     {
         this.Value = null;
         writer.Append(new string(' ', this.Length));
     }
     else
     {
         this.Value = this.PropertyGetter(this, this.Target);
         if (null == this.SignatureMapper)
         {
             throw new Exception(this.FieldInfo + " - Signature field mapper is empty.");
         }
         this.SignatureMapper.Target = this.Value;
         this.SignatureMapper.Insert(writer);
         base.Insert(writer);
     }
 }
 public override void Insert(TextFileWriter writer)
 {
     if (null == this.PropertyGetter)
     {
         writer.Append(new string(' ', this.Length));
     }
     else
     {
         this.Value = this.PropertyGetter(this, this.Target);
         try
         {
             writer.Append(this.FieldType.FormatFixedLengthValue(this.Value, this.Length));
         }
         catch (Exception exc)
         {
             throw new Exception(this.FieldInfo + ": \"" + this.Value + "\" : " + exc.ToString());
         }
     }
 }
        public override void Export(string filePath, T t)
        {
            TextFileWriter writer = new TextFileWriter(filePath, this.Encoding);

            writer.FieldDelimiterChar = this.FieldDelimiterChar;

            if (null != this.OnExportStartHandler)
            {
                this.OnExportStartHandler(filePath, t);
            }

            this.RecordMapping.Target = t;
            this.RecordMapping.Export(writer);

            if (null != this.OnExportFinishHandler)
            {
                this.OnExportFinishHandler(filePath, t);
            }
            writer.Close();
        }
        public override void Insert(TextFileWriter writer)
        {
            if (null != this.Target && null != this.PropertyGetter)
            {
                this.Value = this.PropertyGetter(this, this.Target);
            }

            if (null == this.Value)
            {
                writer.Append(new string(' ', this.Length));
            }
            else
            {
                foreach (FixedLengthFieldMapper <V> f in this.FieldMappers)
                {
                    f.Target = this.Value;
                    f.Insert(writer);
                }
            }
            this.Value = null;
        }
Example #10
0
 public override void Export(TextFileWriter writer)
 {
     this.Export <T, V>(writer);
 }
Example #11
0
 public abstract void Export(TextFileWriter writer);
Example #12
0
 public abstract void Insert(TextFileWriter writer);
 public virtual void Insert(TextFileWriter writer)
 {
     this.MultiFieldMapper.Insert(writer);
 }
        public override IFileWriter InitializeOutput(String filePath)
        {
            TextFileWriter writer = new TextFileWriter(filePath, Encoding.GetEncoding(874));

            return(writer);
        }