Files
bnhtrade/src/bnhtrade.Core/Model/Credentials/bnhtradeDB.cs
T
Bobbie Hodgetts ea0a52b2a0 feature exchange rate update automation
Automated downloading exchange rates from HMRC and updating the database. Added function call to the console and form applications.

Also added a form to show the console output in form application.
2025-06-09 20:56:26 +01:00

44 lines
1.4 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace bnhtrade.Core.Model.Credentials
{
public class bnhtradeDB
{
public string DataSource { get; private set; }
public string UserId { get; private set; }
public string UserPassword { get; private set; }
public string InitialCatalog { get; private set; } = "e2A";
public bool PersistSecurityInfo { get; private set; } = true;
public bool MultipleActiveResultSets { get; private set; } = true;
public uint ConnectionTimeout { get; private set; }
public string ConnectionString
{
get
{
return "Data Source=" + DataSource + ";Initial Catalog=" + InitialCatalog + ";Persist Security Info=" + PersistSecurityInfo.ToString()
+ ";User ID=" + UserId + ";Password=" + UserPassword + ";MultipleActiveResultSets=" + MultipleActiveResultSets.ToString()
+ ";Connect Timeout=" + ConnectionTimeout + ";Encrypt=True;TrustServerCertificate=True";
}
}
public bnhtradeDB (string source, string userId, string userPassword, uint connectionTimeout = 30)
{
this.DataSource = source;
this.UserId = userId;
this.UserPassword = userPassword;
this.ConnectionTimeout = connectionTimeout;
}
}
}