85 lines
2.7 KiB
C#
85 lines
2.7 KiB
C#
using ceTe.DynamicPDF;
|
|
using DataAccessLayer;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Configuration;
|
|
using NLog;
|
|
using System.Data.SqlClient;
|
|
|
|
namespace PDFGeneratorLetteraBenvenuto
|
|
{
|
|
|
|
//public class TemplateProvider
|
|
//{
|
|
// private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
|
|
|
|
// private string _templateWelcomeLetterPath;
|
|
// private Stream _templateWelcomeLetterStream;
|
|
|
|
// // 1
|
|
// public static int idReportDiagnosi;
|
|
// private string ambiente = CACHE.AMBIENTE;
|
|
// private DataTable Rosaspina = null;
|
|
|
|
// public TemplateProvider(int contratto, string rete, bool periodico)
|
|
// {
|
|
|
|
// Rosaspina = null;
|
|
// try
|
|
// {
|
|
// using (SQLServer db = new SQLServer())
|
|
// {
|
|
// Rosaspina = db.GetDataTableFromProcedure("dbo.GetPDFTemplateConfiguration_Rosaspina",
|
|
// new List<SqlParameter>() {
|
|
|
|
// new SqlParameter("Rete",rete),
|
|
// new SqlParameter("Trimestrale",(periodico ? 1:0)),
|
|
// new SqlParameter("Tipo",contratto)
|
|
// }
|
|
// );
|
|
// }
|
|
// }
|
|
// catch (Exception ex)
|
|
// {
|
|
// logger.Errors(ex);
|
|
// }
|
|
|
|
// if (Rosaspina != null && Rosaspina.Rows.Count > 0)
|
|
// {
|
|
// DataRow rd = Rosaspina.Rows[0];
|
|
|
|
// _templateWelcomeLetterPath = rd["TemplateWelcomeLetterPath"].ToString();
|
|
|
|
// }
|
|
|
|
// if (ambiente == "SVILUPPO")
|
|
// {
|
|
|
|
// if (idReportDiagnosi != 6)
|
|
// {
|
|
// _templateWelcomeLetterPath = @"C:\TEMPLATES\PDFGeneration_FILE\S\TemplateBF.pdf";
|
|
// }
|
|
// else
|
|
// {
|
|
// _templateWelcomeLetterPath = @"C:\TEMPLATES\PDFGeneration_FILE\FD\Lettera.pdf";
|
|
// }
|
|
|
|
// }
|
|
|
|
// if (_templateWelcomeLetterPath != null && _templateWelcomeLetterPath.Length > 0)
|
|
// (new FileStream(_templateWelcomeLetterPath, FileMode.Open, FileAccess.Read)).CopyTo(_templateWelcomeLetterStream = new MemoryStream());
|
|
// }
|
|
|
|
// public int SignYPosition { get { return 716; } }
|
|
// public int LetteraAccompagnamentoPeriodicoSalutiYBonus { get { return -5; } }
|
|
// public int LetteraAccompagnamentoPeriodicoFirmaYBonus { get { return -5; } }
|
|
// public int SalutiYBonus { get { return 15; } }
|
|
// public System.IO.Stream TemplateWelcomeLetter { get { return _templateWelcomeLetterStream; } }
|
|
|
|
//}
|
|
|
|
} |