static void loadCDR(IEnumerable <CDRRow> pCDRRows, DateTime pCurrent, DateTime pPrevious) { using (var _dbCurrent = new Cdr_Db(pCurrent)) { using (var _dbPrevious = new Cdr_Db(pPrevious)) { _dbCurrent.BeginTransaction(); _dbPrevious.BeginTransaction(); foreach (var _cdrRow in pCDRRows) { if (_cdrRow.Start.Month == pCurrent.Month) { insert(_dbCurrent, _cdrRow); } else if (_cdrRow.Start.Month == pPrevious.Month) { insert(_dbPrevious, _cdrRow); } else { throw new Exception("How can a CDR NOT belong to current or previous Month?"); } } _dbCurrent.CommitTransaction(); _dbPrevious.CommitTransaction(); } } }
static void loadCDR(IEnumerable <CDRRow> pCDRRows, DateTime pCurrent) { using (var _dbCurrent = new Cdr_Db(pCurrent)) { _dbCurrent.BeginTransaction(); foreach (var _cdrRow in pCDRRows) { insert(_dbCurrent, _cdrRow); } _dbCurrent.CommitTransaction(); } }