using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace lib
{
    public class DbExportOutbound
    {
        static DbExportOutbound db = null;

        public SqlConnection conn { get; set; }

        public DbExportOutbound(DbConfig config)
        {
            //string connetionString = @"Data Source={0};Initial Catalog={1};User ID={2};Password={3};Encrypt=False;TrustServerCertificate=False;Connection Timeout=30;";
            string connetionString = @"Data Source={0};Initial Catalog={1};User Id={2};Password={3};TrustServerCertificate=True;Connection Timeout=30;";
            conn = new SqlConnection(String.Format(connetionString,
                config.servername, config.database, config.username, config.password));
        }

        public static DbExportOutbound getInstance()
        {
            if (db == null)
            {
                db = new DbExportOutbound(DbConfig.getInstance());
            }

            return db;
        }


    }
}
