Пример #1
0
        } // !AddApplicableTradeTax()

        /// <summary>
        /// Saves the descriptor object into a stream.
        ///
        /// The stream position will be reset to the original position after writing is finished.
        /// This allows easy further processing of the stream.
        /// </summary>
        /// <param name="stream"></param>
        public void Save(Stream stream, ZUGFeRDVersion version = ZUGFeRDVersion.Version1, Profile profile = Profile.Basic)
        {
            this.Profile = profile;

            IInvoiceDescriptorWriter writer = null;

            switch (version)
            {
            case ZUGFeRDVersion.Version1:
                writer = new InvoiceDescriptor1Writer();
                break;

            case ZUGFeRDVersion.Version20:
                writer = new InvoiceDescriptor20Writer();
                break;

            case ZUGFeRDVersion.Version21:
                writer = new InvoiceDescriptor21Writer();
                break;

            default:
                break;
            }
            writer.Save(this, stream);
        } // !Save()
Пример #2
0
        } // !Save()

        public void Save(string filename, ZUGFeRDVersion version = ZUGFeRDVersion.Version1, Profile profile = Profile.Basic)
        {
            IInvoiceDescriptorWriter writer = null;

            switch (version)
            {
            case ZUGFeRDVersion.Version1:
                writer = new InvoiceDescriptor1Writer();
                break;

            case ZUGFeRDVersion.Version20:
                writer = new InvoiceDescriptor20Writer();
                break;

            case ZUGFeRDVersion.Version21:
                writer = new InvoiceDescriptor21Writer();
                break;

            default:
                break;
            }
            writer.Save(this, filename);
        } // !Save()