Пример #1
0
 void Init()
 {
     TestMode      = this._db.DataProvider.ConnectionString.Equals("test", StringComparison.InvariantCultureIgnoreCase);
     _dirtyColumns = new List <IColumn>();
     if (TestMode)
     {
         PROD_DEP.SetTestRepo();
         _repo = _testRepo;
     }
     else
     {
         _repo = new SubSonicRepository <PROD_DEP>(_db);
     }
     tbl = _repo.GetTable();
     SetIsNew(true);
     OnCreated();
 }
Пример #2
0
        internal static IRepository <PROD_DEP> GetRepo(string connectionString, string providerName)
        {
            Solution.DataAccess.DataModel.SolutionDataBase_standardDB db;
            if (String.IsNullOrEmpty(connectionString))
            {
                db = new Solution.DataAccess.DataModel.SolutionDataBase_standardDB();
            }
            else
            {
                db = new Solution.DataAccess.DataModel.SolutionDataBase_standardDB(connectionString, providerName);
            }
            IRepository <PROD_DEP> _repo;

            if (db.TestMode)
            {
                PROD_DEP.SetTestRepo();
                _repo = _testRepo;
            }
            else
            {
                _repo = new SubSonicRepository <PROD_DEP>(db);
            }
            return(_repo);
        }