private ConnectionBuilder GetDefaultConnection(ProjectName projectName, bool getAlternate = false)
        {
            var defaultServerName = "ZM-VLUS56";
            var defaultSqlExpress = string.Empty;

            if (getAlternate)
            {
                defaultServerName = "D-5932S32";
                defaultSqlExpress = "SQL2014";
            }

            ConnectionBuilder connBuilder = null;

            switch (projectName)
            {
            case ProjectName.DOD:
            {
                connBuilder = new ConnectionBuilder()
                {
                    DatabaseName = "JhpiegoDb_DOD", InstanceName = defaultSqlExpress, ServerName = defaultServerName
                };
                break;
            }

            case ProjectName.IHP_VMMC:
            {
                connBuilder = new ConnectionBuilder()
                {
                    DatabaseName = "JhpiegoDb_IhpVmmc", InstanceName = defaultSqlExpress, ServerName = defaultServerName
                };
                break;
            }

            case ProjectName.IHP_Capacity_Building_and_Training:
            {
                connBuilder = new ConnectionBuilder()
                {
                    DatabaseName = "JhpiegoDb_IhpTraining", InstanceName = defaultSqlExpress, ServerName = defaultServerName
                };
                break;
            }
            }
            return(connBuilder);
        }
 internal ConnectionBuilder SetProjectDatabase(ProjectName selectedProject)
 {
     _currentProjectName = selectedProject;
     return(ConnBuilder = GetDefaultConnection(_currentProjectName));
 }
 internal ConnectionBuilder GetAlternateConnection(ConnectionBuilder connBuilder)
 {
     return(GetDefaultConnection(_currentProjectName, true));
 }
 internal void OverwriteDefaultConnection(ConnectionBuilder connBuilder)
 {
     ConnBuilder = connBuilder;
 }
 public DbHelper(ConnectionBuilder builder)
 {
     _connBuilder = builder;
     _connString  = _connBuilder.GetConnectionString();
 }