示例#1
0
        public bool UpdateWithWhere(object values, object where, Needletail.DataAccess.Engines.FilterType filterType)
        {
            var result1 = _MSSQLContext.UpdateWithWhere(values, where, filterType);
            var result2 = _SqlCEContext.UpdateWithWhere(values, where, filterType);

            return(result1 || result2);
        }
示例#2
0
        public IEnumerable <E> GetMany(object where, object orderBy, Needletail.DataAccess.Engines.FilterType filterType, int page, int pageSize)
        {
            var result1 = _MSSQLContext.GetMany(where, orderBy, filterType, page, pageSize);
            var result2 = _SqlCEContext.GetMany(where, orderBy, filterType, page, pageSize);

            return(result2.Union(result1));
        }
示例#3
0
        public bool Delete(object where, Needletail.DataAccess.Engines.FilterType filterType)
        {
            //delete in both context
            var result1 = _MSSQLContext.Delete(where, filterType);
            var result2 = _SqlCEContext.Delete(where, filterType);

            return(result1 || result2);
        }
示例#4
0
        public E GetSingle(object where, Needletail.DataAccess.Engines.FilterType filterType = Needletail.DataAccess.Engines.FilterType.AND)
        {
            var result1 = _SqlCEContext.GetSingle(where, filterType);

            if (result1 == null)
            {
                //search in the MSSQL
                result1 = _MSSQLContext.GetSingle(where, filterType);
                //add it to the sqlCE
                if (result1 != null)
                {
                    _SqlCEContext.Insert(result1);
                }
            }
            return(result1);
        }
示例#5
0
 public bool Delete(object where, Needletail.DataAccess.Engines.FilterType filterType)
 {
     return(this.dataSource.Delete(where : where, filterType: filterType));
 }
示例#6
0
 public bool UpdateWithWhere(object values, object where, Needletail.DataAccess.Engines.FilterType filterType)
 {
     return(this.dataSource.UpdateWithWhere(values: values, where : where, filterType: filterType));
 }
示例#7
0
 public Crmuser GetSingle(object where, Needletail.DataAccess.Engines.FilterType filterType)
 {
     return(this.dataSource.GetSingle(where : where, filterType: filterType));
 }
示例#8
0
 public IEnumerable <Crmuser> GetMany(object where, object orderBy, Needletail.DataAccess.Engines.FilterType filterType, int page, int pageSize)
 {
     return(this.dataSource.GetMany(where : where, orderBy: orderBy, filterType: filterType, page: page, pageSize: pageSize));
 }
示例#9
0
 public IEnumerable <Crmuser> GetMany(object where, Needletail.DataAccess.Engines.FilterType filterType, object orderBy, int?topN)
 {
     return(this.dataSource.GetMany(where : where, filterType: filterType, orderBy: orderBy, topN: topN));
 }
示例#10
0
        private bool MoveDataBetweenServers(DBTableDataSourceBase <E, K> source, DBTableDataSourceBase <E, K> target, object where, Needletail.DataAccess.Engines.FilterType filterType)
        {
            //get the data to move
            var toMove = source.GetMany(where, filterType, null, null);

            foreach (var e in toMove)
            {
                //insert the data
                target.Insert(e);
            }
            //delete the data
            return(source.Delete(where, filterType));
        }
示例#11
0
 public bool MoveDataFromMSSQLToSQLCE(object where, Needletail.DataAccess.Engines.FilterType filterType)
 {
     return(MoveDataBetweenServers(_MSSQLContext, _SqlCEContext, where, filterType));
 }