Exemple #1
0
        public static void MigrateByDate <T>(DateTime st_, DateTime fn_) where T : class, IEntity, IDate
        {
            try
            {
                DWH_entities dwh = new DWH_entities();
                SQL_entity   sql = new SQL_entity();

                sql.Database.Initialize(true);

                Repository <T> acq_rep_dwh = new Repository <T>(dwh);
                Repository <T> acq_rep_sql = new Repository <T>(sql);

                IQueryable <T> a = acq_rep_dwh.DWHGetByDate(st_, fn_);

                int cnt = a.Count();

                foreach (var t in a)
                {
                    acq_rep_sql.Add(t);
                    acq_rep_sql.Save();
                }
            }
            catch (Exception e)
            {
            }
        }
Exemple #2
0
        public void DWH_check()
        {
            using (DWH_entities ds = new DWH_entities())
            {
                ds.Database.Initialize(true);
                ds.Database.Log = LogWrite;

                var a_ = from s in ds.TEMP_ACQ_D
                         where s.DATE.Value >= st && s.DATE.Value <= fn
                         select s;

                int b_ = a_.Count();

                foreach (var c_ in a_)
                {
                }

                //Repository<T_ACQ_D> rp2 = new Repository<T_ACQ_D>(ds);
                //IQueryable<T_ACQ_D> q2 = rp2.DWHGetDateMerchant(st, fn, "9290570092");
                //int c2 = q2.Count();

                Repository <T_ECOMM_D> rp = new Repository <T_ECOMM_D>(ds);
                IQueryable <T_ECOMM_D> q  = rp.DWHGetByDate(st, fn);
                int c = q.Count();
            }

            //9290570092
        }
Exemple #3
0
        public void DatesCheck()
        {
            DWH_entities            ds = new DWH_entities();
            Repository <TEMP_ACQ_D> rp = new Repository <TEMP_ACQ_D>(ds);

            int stY = st.Year;
            int stm = st.Month;

            int fnY = fn.Year;
            int fnm = fn.Month;

            //test select from temp_acq by days
            var a = from s in ds.TEMP_ACQ_D
                    where
                    s.DATE >= st
                    &&
                    s.DATE <= fn
                    select s;

            int cnt = a.Count();

            var a2 = from s in ds.TEMP_ACQ_M
                     where
                     s.DATE >= st
                     &&
                     s.DATE <= fn
                     select s;

            int cnt2 = a2.Count();

            foreach (var b in a)
            {
                var c = b;
            }
        }
Exemple #4
0
        public void ReadRepoTest()
        {
            DWH_entities            ent = new DWH_entities();
            var                     a   = ent.Database.Connection;
            var                     b   = a.State;
            ReadRepo <REFMERCHANTS> rr  = new ReadRepo <REFMERCHANTS>(ent);

            Assert.Fail();
        }