コード例 #1
0
ファイル: ComposerBase.cs プロジェクト: StefanAniff/hb.trex
 protected ComposerBase(IBuilderBase builder, IGatherData gatherData, ISavePDF savePDF)
 {
     Aspose.Words.License license = new Aspose.Words.License();
     license.SetLicense("Aspose.Words.lic");
     _builder    = builder;
     _gatherData = gatherData;
     _savePDF    = savePDF;
 }
コード例 #2
0
ファイル: InvoiceCompose.cs プロジェクト: StefanAniff/hb.trex
 public void Initialize()
 {
     _databaseSetup = new DatabaseSetup();
     _databaseSetup.CleanDatabase();
     _databaseSetup.CreateStandardDatabase();
     _invoiceServiceMock = new InvoiceService(_databaseSetup.GetTrexConnection);
     _gather             = new GatherData(_invoiceServiceMock, _databaseSetup.GetTrexConnection);
 }
コード例 #3
0
        public override void TemplateValidation(int invoiceId, IGatherData gatherData, int format)
        {
            var template = gatherData.GetCustomerInvoiceGroupsTemplateData(invoiceId, format);

            if (template.SpecificationTemplateIdMail == null)
            {
                throw new InvoiceTemplateIdNotSet();
            }

            var specificationTemplate = gatherData.GetInvoiceTemplate((int)template.SpecificationTemplateIdMail);

            var specificationTemplateFound = gatherData.ValidateTemplate(specificationTemplate); //Get InvoiceTemplateById

            if (!specificationTemplateFound)
            {
                throw new FileNotFoundException("The specification template could not be found");
            }
        }
コード例 #4
0
        public override void TemplateValidation(int invoiceId, IGatherData gatherData, int format)
        {
            try
            {
                var template = gatherData.GetCustomerInvoiceGroupsTemplateData(invoiceId, format);

                var invoiceTemplate = new InvoiceTemplate();
                if (format == 4 || format == 3)
                {
                    if (template.CreditNoteTemplateIdMail == null)
                    {
                        throw new CreditNoteTemplateIdNotSet();
                    }

                    invoiceTemplate = gatherData.GetInvoiceTemplate((int)template.CreditNoteTemplateIdMail);
                }

                if (format == 5 || format == 3)
                {
                    if (template.CreditNoteTemplateIdPrint == null)
                    {
                        throw new CreditNoteTemplateIdNotSet();
                    }

                    invoiceTemplate = gatherData.GetInvoiceTemplate((int)template.CreditNoteTemplateIdPrint);
                }

                var invoiceTemplateFound = gatherData.ValidateTemplate(invoiceTemplate);
                if (!invoiceTemplateFound)
                {
                    throw new FileNotFoundException("The invoice template could not be found");
                }
            }
            catch (Aspose.Words.UnsupportedFileFormatException ex)
            {
                LogError(ex);
                throw;
            }
            catch (Exception ex)
            {
                LogError(ex);
                throw;
            }
        }
コード例 #5
0
 public CreditNoteComposer(IInvoiceBuilder builder, IGatherData gatherData, ISavePDF savePDF)
     : base(builder, gatherData, savePDF)
 {
 }
コード例 #6
0
 public SpecificationComposer(ISpecificationBuilder builder, IGatherData gatherData, ISavePDF savePDF)
     : base(builder, gatherData, savePDF)
 {
 }
コード例 #7
0
ファイル: ComposerBase.cs プロジェクト: StefanAniff/hb.trex
 public abstract void TemplateValidation(int invoiceId, IGatherData data, int format);
コード例 #8
0
ファイル: InvoiceCompose.cs プロジェクト: StefanAniff/hb.trex
 public void Dispose()
 {
     _databaseSetup      = null;
     _gather             = null;
     _invoiceServiceMock = null;
 }