Exemple #1
0
        public async Task <List <OrderSupplierEntity> > GetList(OrderSupplierListParam param)
        {
            var expression = ListFilter(param);
            var list       = await this.BaseRepository().FindList(expression);

            return(list.ToList());
        }
Exemple #2
0
        private Expression <Func <OrderSupplierEntity, bool> > ListFilter(OrderSupplierListParam param)
        {
            var expression = LinqExtensions.True <OrderSupplierEntity>();

            if (param != null)
            {
            }
            return(expression);
        }
Exemple #3
0
        public async Task <TData <List <OrderSupplierEntity> > > GetPageList(OrderSupplierListParam param, Pagination pagination)
        {
            TData <List <OrderSupplierEntity> > obj = new TData <List <OrderSupplierEntity> >();

            obj.Data = await orderSupplierService.GetPageList(param, pagination);

            obj.Total = pagination.TotalCount;
            obj.Tag   = 1;
            return(obj);
        }
Exemple #4
0
        public async Task <List <OrderSupplierEntity> > GetPageList(OrderSupplierListParam param, Pagination pagination)
        {
            /*
             * var expression = ListFilter(param);
             * var list= await this.BaseRepository().FindList(expression, pagination);
             * return list.ToList();
             */

            StringBuilder sql  = CreateListSql(param);
            var           data = await this.BaseRepository().FindList <OrderSupplierEntity>(sql.ToString(), pagination);

            return(data.list.ToList <OrderSupplierEntity>());
        }
Exemple #5
0
        public async Task <TData <List <OrderSupplierEntity> > > GetList(OrderSupplierListParam param)
        {
            TData <List <OrderSupplierEntity> > obj  = new TData <List <OrderSupplierEntity> >();
            List <OrderSupplierEntity>          list = await orderSupplierService.GetList(param);

            obj.SetDefault();
            if (list.Count > 0)
            {
                obj.Data  = list;
                obj.Total = obj.Data.Count;
                obj.Tag   = 1;
                obj.Refresh();
            }
            return(obj);
        }
        public async Task <TData <List <OrderSupplierEntity> > > GetListJson(
            OrderSupplierListParam param)
        {
            TData <List <OrderSupplierEntity> > obj = new TData <List <OrderSupplierEntity> >();

            try
            {
                obj = await new OrderSupplierBLL().GetList(param);
            }
            catch (Exception ex)
            {
                LogHelper.Info("GetPageListJson ex:" + ex.ToString());
            }

            return(obj);
        }
Exemple #7
0
        /// <summary>
        /// 创建查询sql
        /// </summary>
        /// <param name="param">查询条件数据</param>
        /// <returns></returns>
        private StringBuilder CreateListSql(OrderSupplierListParam param)
        {
            StringBuilder sql = new StringBuilder();

            sql.AppendFormat(" SELECT * FROM (");
            sql.AppendFormat(" SELECT a.*,b.RealName AS BaseCreatorTxt ");
            sql.AppendFormat(" FROM  order_supplier a ");
            sql.AppendFormat(" JOIN sysuser b ON a.BaseCreatorId = b.Id ");
            sql.AppendFormat(" ) T WHERE 1=1 ");
            if (param != null)
            {
                if (!string.IsNullOrEmpty(param.SupplierName))
                {
                    sql.AppendFormat(" AND SupplierName LIKE '%{0}%'", param.SupplierName);
                }
            }
            return(sql);
        }
        public async Task <ActionResult> GetPageListJson(OrderSupplierListParam param, Pagination pagination)
        {
            TData <List <OrderSupplierEntity> > obj = await orderSupplierBLL.GetPageList(param, pagination);

            return(Json(obj));
        }