163 lines
5.9 KiB
C#
163 lines
5.9 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Configuration;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace GestoreTrimestrale.Test
|
|
{
|
|
public class configModel
|
|
{
|
|
private int _zipInterval;
|
|
private int _maxGestoreThreads;
|
|
private int _numeroCfPerZip;
|
|
private string _fTPServer;
|
|
private string _fTPLogin;
|
|
private string _fTPPassword;
|
|
private string _queryContratti;
|
|
private int _savePDFtoDISK;
|
|
private string _pDFProcessFolder;
|
|
private string _pDFOutputFolder;
|
|
private string _zipFolder;
|
|
private string _zipBackupFolder;
|
|
private string _workFolder;
|
|
private string _connectionString;
|
|
private List<ConnectionStringSettings> _connectionStrings;
|
|
|
|
public configModel()
|
|
{
|
|
_connectionStrings = new List<ConnectionStringSettings>();
|
|
|
|
PDFProcessFolder = @"C:\ReportisticaTrimestrale\PDF";
|
|
PDFOutputFolder = @"C:\ReportisticaTrimestrale\PDFtoDB";
|
|
ZipFolder = @"C:\ReportisticaTrimestrale\SELECTA\";
|
|
ZipBackupFolder = @"C:\ReportisticaTrimestrale\SEND\";
|
|
WorkFolder = ZipFolder + @"temp\";
|
|
|
|
zipInterval = 5;
|
|
maxGestoreThreads = Int32.Parse(ConfigurationManager.AppSettings["maxGestoreThreads"]);
|
|
numeroCfPerZip = Int32.Parse(ConfigurationManager.AppSettings["numeroCfPerZip"]);
|
|
|
|
QueryContratti = ConfigurationManager.AppSettings["QueryContratti"];
|
|
SavePDFtoDISK = Int32.Parse(ConfigurationManager.AppSettings["SavePDFtoDISK"]);
|
|
|
|
FTPServer = ConfigurationManager.AppSettings["FTPServerHost"];
|
|
FTPLogin = ConfigurationManager.AppSettings["FTPUserHost"];
|
|
FTPPassword = ConfigurationManager.AppSettings["FTPPasswordHost"];
|
|
|
|
_connectionString = ConfigurationManager.ConnectionStrings["SqlServerStampeC6Connection"].ConnectionString;
|
|
|
|
foreach (ConnectionStringSettings v in ConfigurationManager.ConnectionStrings)
|
|
{
|
|
if (v.Name.Contains("SqlServerStampeC6Connection"))
|
|
{
|
|
_connectionStrings.Add(v);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|
|
List<ConnectionStringSettings> ConnectionStrings
|
|
{
|
|
get { return _connectionStrings; }
|
|
set { _connectionStrings = value; }
|
|
|
|
}
|
|
|
|
int zipInterval {
|
|
get { return _zipInterval; }
|
|
set { _zipInterval = value; }
|
|
}
|
|
int maxGestoreThreads {
|
|
get { return _maxGestoreThreads; }
|
|
set {
|
|
_maxGestoreThreads = value;
|
|
ConfigurationManager.AppSettings.Remove("maxGestoreThreads");
|
|
ConfigurationManager.AppSettings.Add("maxGestoreThreads", value.ToString()); }
|
|
}
|
|
int numeroCfPerZip {
|
|
get { return _numeroCfPerZip; }
|
|
set {
|
|
_numeroCfPerZip = value;
|
|
ConfigurationManager.AppSettings.Remove("numeroCfPerZip");
|
|
ConfigurationManager.AppSettings.Add("numeroCfPerZip", value.ToString());
|
|
} }
|
|
string FTPServer {
|
|
get { return _fTPServer; }
|
|
set {
|
|
_fTPServer = value;
|
|
ConfigurationManager.AppSettings.Remove("FTPServer");
|
|
ConfigurationManager.AppSettings.Add("FTPServer", value.ToString());
|
|
} }
|
|
string FTPLogin {
|
|
get { return _fTPLogin; }
|
|
set {
|
|
_fTPLogin = value;
|
|
ConfigurationManager.AppSettings.Remove("FTPUser");
|
|
ConfigurationManager.AppSettings.Add("FTPUser", value.ToString());
|
|
} }
|
|
string FTPPassword {
|
|
get { return _fTPPassword; }
|
|
set {
|
|
_fTPPassword = value;
|
|
ConfigurationManager.AppSettings.Remove("FTPPassword");
|
|
ConfigurationManager.AppSettings.Add("FTPPassword", value.ToString());
|
|
} }
|
|
string QueryContratti
|
|
{
|
|
get { return _queryContratti; }
|
|
set {
|
|
_queryContratti = value;
|
|
ConfigurationManager.AppSettings.Remove("QueryContratti");
|
|
ConfigurationManager.AppSettings.Add("QueryContratti", value.ToString());
|
|
} }
|
|
int SavePDFtoDISK {
|
|
get { return _savePDFtoDISK; }
|
|
set {
|
|
_savePDFtoDISK = value;
|
|
ConfigurationManager.AppSettings.Remove("SavePDFtoDISK");
|
|
ConfigurationManager.AppSettings.Add("SavePDFtoDISK", value.ToString());
|
|
} }
|
|
private string PDFProcessFolder {
|
|
get { return _pDFProcessFolder; }
|
|
set {
|
|
_pDFProcessFolder = value;
|
|
|
|
} }
|
|
private string PDFOutputFolder {
|
|
get { return _pDFOutputFolder; }
|
|
set {
|
|
_pDFOutputFolder = value;
|
|
|
|
} }
|
|
private string ZipFolder {
|
|
get { return _zipFolder; }
|
|
set {
|
|
_zipFolder = value;
|
|
|
|
} }
|
|
private string ZipBackupFolder {
|
|
get { return _zipBackupFolder; }
|
|
set {
|
|
_zipBackupFolder = value;
|
|
|
|
} }
|
|
private string WorkFolder {
|
|
get { return _workFolder; }
|
|
set {
|
|
_workFolder = value;
|
|
|
|
} }
|
|
string ConnectionString {
|
|
get { return _connectionString; }
|
|
set {
|
|
_connectionString = value;
|
|
ConfigurationManager.ConnectionStrings.Remove("SqlServerStampeC6Connection");
|
|
ConfigurationManager.ConnectionStrings.Add(new ConnectionStringSettings("SqlServerStampeC6Connection", value.ToString()));
|
|
}
|
|
}
|
|
}
|
|
}
|