mirror of
https://github.com/stokebob/bnhtrade.git
synced 2026-05-18 19:48:23 +00:00
ea0a52b2a0
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.
44 lines
1.4 KiB
C#
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;
|
|
}
|
|
}
|
|
}
|