Beispiel #1
0
        /// <summary>
        /// 获取股权账户分页列表
        /// </summary>
        /// <param name="request">查询参数</param>
        /// <returns>股权账户分页列表</returns>
        public PagedList <StockAccountExt> GetPagerList(StockAccountRequest request)
        {
            const string fromStr = "Agent_FnStockAccount a INNER JOIN Agent_CustomerExt c ON a.CustomerSysNo=c.CustomerSysNo";

            var dataCount = DBContext.Select <int>("count(0)").From(fromStr);
            var dataList  = DBContext.Select <StockAccountExt>("a.*,c.RealName as CustomerName,c.SerialNumber").From(fromStr);

            Action <string, string, object> setWhere = (@where, name, value) =>
            {
                dataCount.AndWhere(where).Parameter(name, value);
                dataList.AndWhere(where).Parameter(name, value);
            };

            if (!string.IsNullOrWhiteSpace(request.CustomerName))
            {
                setWhere("c.RealName LIKE CONCAT('%',@CustomerName,'%')", "CustomerName", request.CustomerName);
            }
            if (!string.IsNullOrWhiteSpace(request.SerialNumber))
            {
                setWhere("c.SerialNumber LIKE CONCAT('%',@SerialNumber,'%')", "SerialNumber", request.SerialNumber);
            }

            return(new PagedList <StockAccountExt>
            {
                TData = dataList.Paging(request.CurrentPageIndex.GetHashCode(), request.PageSize.GetHashCode()).OrderBy("a.SysNo desc").QueryMany(),
                CurrentPageIndex = request.CurrentPageIndex.GetHashCode(),
                TotalCount = dataCount.QuerySingle()
            });
        }
Beispiel #2
0
        /// <summary>
        /// 获取股权账户列表
        /// </summary>
        /// <param name="request">查询参数</param>
        /// <returns>股权账户列表</returns>
        public IList <FnStockAccount> GetList(StockAccountRequest request)
        {
            var dataList = DBContext.Select <FnStockAccount>("*").From(StrTableName);

            Action <string, string, object> setWhere = (@where, name, value) => dataList.AndWhere(@where).Parameter(name, value);

            return(dataList.QueryMany());
        }
 /// <summary>
 /// 获取股权账户分页列表
 /// </summary>
 /// <param name="request">查询参数</param>
 /// <returns>股权账户分页列表</returns>
 public PagedList <StockAccountExt> GetPagerList(StockAccountRequest request)
 {
     return(Using <IFnStockAccount>().GetPagerList(request));
 }
        /// <summary>
        /// 获取股权账户列表
        /// </summary>
        /// <param name="request">查询参数</param>
        /// <returns>股权账户列表</returns>
        public List <FnStockAccount> GetList(StockAccountRequest request)
        {
            var list = Using <IFnStockAccount>().GetList(request);

            return(list.ToList());
        }