// Decompiled with JetBrains decompiler
// Type: SE0085.dBc.dBConnect
// Assembly: SE0085dBc, Version=1.0.0.1, Culture=neutral, PublicKeyToken=null
// MVID: 1D280293-B91C-46EA-A3BF-F18C4E33A97F
// Assembly location: C:\Users\Abishek\Downloads\SchneiderCode_Breaker_09292016\Breaker Schedule-20160930T014118Z\Breaker Schedule\Solution for gathering Breaker Data\DMS\bin\Debug\SE0085dBc.dll

using Microsoft.VisualBasic.CompilerServices;
using System.Data.EntityClient;

namespace SE0085.dBc
{
  public class dBConnect
  {
    private emDataEntity _dbDataEntity;
    private emDataSource _dbDataSource;
    private emInitCatalog _dbInitCatalog;
    private EntityConnection _dBconnection;
    private string lmUserAccess;

    public EntityConnection Connection
    {
      get
      {
        return this._dBconnection;
      }
    }

    public dBConnect(emDataEntity DataEntity, emDataSource DataSource, emInitCatalog InitCatalog, string Password)
    {
      this._dBconnection = new EntityConnection();
      this.lmUserAccess = "NewCastle";
      if (Operators.CompareString(Password, this.lmUserAccess, false) != 0)
        return;
      this._dbDataEntity = DataEntity;
      this._dbDataSource = DataSource;
      this._dbInitCatalog = InitCatalog;
      this.BuildConnection();
    }

    ~dBConnect()
    {
      this._dBconnection.Close();
      // ISSUE: explicit finalizer call
      base.Finalize();
    }

    private void BuildConnection()
    {
      this._dBconnection = new icDataConnection(this._dbDataEntity, this._dbDataSource, this._dbInitCatalog, "NewCastle").Connection;
    }
  }
}
