예제 #1
0
        /// <summary>
        /// 获取待检查URL集合
        /// </summary>
        /// <param name="top">取多少条,默认-1 表示全部</param>
        /// <param name="isDesc">是否按link降序</param>
        /// <param name="where">查询条件</param>
        /// <returns></returns>
        public async Task <List <UrlInfo> > GetWaitCheakListSync(long top = -1, bool isDesc = true, string where = "")
        {
            var list = new List <UrlInfo>();
            await Task.Run(() =>
            {
                using (TxDataHelper helper = TxDataHelper.GetDataHelper(DatabaseType.Sql, CON_STR))
                {
                    string _sql = @" SELECT {0} id AS ID,link AS Url FROM [main_link] WHERE baidu_included = 0 {2} ORDER BY ID {1}";
                    var _dt     = helper.SqlGetDataTable(string.Format(_sql, top == -1 ? "" : "TOP " + top.ToString(), isDesc ? "DESC" : "ASC", where));
                    list.AddRange(DataEntityHelper.GetEntityList <UrlInfo>(_dt));
                }
            });

            return(list);
        }
예제 #2
0
        public static DataTable GetUserDb(int pageIndex, int pageSize, string userId)
        {
            var _hash = new Hashtable();

            _hash["@user_id"] = userId;

            int totalCount = 0;
            var _dt        = DataEntityHelper.GetTable(
                "Agent93390Test",
                " sales_user WITH(NOLOCK) ",
                _hash,
                " user_id asc",
                out totalCount,
                " and [user_id]>@user_id ",
                "*",
                pageIndex * pageSize,
                pageSize);

            return(_dt);
        }
예제 #3
0
 public ProcessorBase(T model)
 {
     Model       = model;
     _dataHelper = new DataEntityHelper <T>(model);
 }
예제 #4
0
 public ProcessorBase(Guid id)
 {
     _dataHelper = new DataEntityHelper <T>(id);
 }