Exemple #1
0
 public static void Setup(int testItems)
 {
     SetTestRepo();
     for (int i = 0; i < testItems; i++)
     {
         SHOP_PRICE_AREA item = new SHOP_PRICE_AREA();
         _testRepo._items.Add(item);
     }
 }
Exemple #2
0
 public override bool Equals(object obj)
 {
     if (obj.GetType() == typeof(SHOP_PRICE_AREA))
     {
         SHOP_PRICE_AREA compare = (SHOP_PRICE_AREA)obj;
         return(compare.KeyValue() == this.KeyValue());
     }
     else
     {
         return(base.Equals(obj));
     }
 }
Exemple #3
0
        public static SHOP_PRICE_AREA SingleOrDefault(Expression <Func <SHOP_PRICE_AREA, bool> > expression, string connectionString, string providerName)
        {
            var             repo    = GetRepo(connectionString, providerName);
            var             results = repo.Find(expression);
            SHOP_PRICE_AREA single  = null;

            if (results.Count() > 0)
            {
                single = results.ToList()[0];
            }

            return(single);
        }
Exemple #4
0
        public static SHOP_PRICE_AREA SingleOrDefault(Expression <Func <SHOP_PRICE_AREA, bool> > expression)
        {
            var             repo    = GetRepo();
            var             results = repo.Find(expression);
            SHOP_PRICE_AREA single  = null;

            if (results.Count() > 0)
            {
                single = results.ToList()[0];
                single.OnLoaded();
                single.SetIsLoaded(true);
                single.SetIsNew(false);
            }

            return(single);
        }
Exemple #5
0
 void Init()
 {
     TestMode      = this._db.DataProvider.ConnectionString.Equals("test", StringComparison.InvariantCultureIgnoreCase);
     _dirtyColumns = new List <IColumn>();
     if (TestMode)
     {
         SHOP_PRICE_AREA.SetTestRepo();
         _repo = _testRepo;
     }
     else
     {
         _repo = new SubSonicRepository <SHOP_PRICE_AREA>(_db);
     }
     tbl = _repo.GetTable();
     SetIsNew(true);
     OnCreated();
 }
Exemple #6
0
        internal static IRepository <SHOP_PRICE_AREA> 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 <SHOP_PRICE_AREA> _repo;

            if (db.TestMode)
            {
                SHOP_PRICE_AREA.SetTestRepo();
                _repo = _testRepo;
            }
            else
            {
                _repo = new SubSonicRepository <SHOP_PRICE_AREA>(db);
            }
            return(_repo);
        }
Exemple #7
0
 public static void Setup(SHOP_PRICE_AREA item)
 {
     SetTestRepo();
     _testRepo._items.Add(item);
 }