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

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

            return(single);
        }
Ejemplo n.º 4
0
        public static ORDER_DEP00 SingleOrDefault(Expression <Func <ORDER_DEP00, bool> > expression)
        {
            var         repo    = GetRepo();
            var         results = repo.Find(expression);
            ORDER_DEP00 single  = null;

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

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

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