コード例 #1
0
        public ActionResult GetFormJson(string keyValue)
        {
            SplitPage         splitPage = new LeaRun.Util.WebControl.SplitPage();
            List <Conditions> lisWhere  = new List <Conditions>();

            if (splitPage.Conditions == null)
            {
                lisWhere = new List <Conditions>();
            }
            else
            {
                lisWhere = splitPage.Conditions.ToList <Conditions>();
            }

            lisWhere.Add(new Conditions()
            {
                Key = "receiver", Value = OperatorProvider.Provider.Current().UserId
            });
            lisWhere.Add(new Conditions()
            {
                Key = "isDelete", Value = "0"
            });
            lisWhere.Add(new Conditions()
            {
                Key = "id", Value = keyValue
            });

            splitPage.Conditions = lisWhere.ToArray();
            var data = messagebll.GetMyList(splitPage).FirstOrDefault();

            return(Content(data.ToJson()));
        }
コード例 #2
0
        /// <summary>
        /// 获取列表
        /// </summary>
        /// <param name="pagination">分页参数</param>
        /// <param name="queryJson">查询参数</param>
        /// <param name="itemId">分类ID</param>
        /// <returns>返回分页列表Json</returns>
        public ActionResult GetDataGridJsonV1(Pagination pagination, string queryJson, string itemId)
        {
            pagination.sidx = pagination.sort;
            pagination.sord = pagination.order;
            pagination.page = (pagination.page <= 0? 1:pagination.page);
            pagination.rows = (pagination.rows <= 0? 0:pagination.rows);

            var               queryParam = queryJson.ToJObject();
            SplitPage         splitPage  = new LeaRun.Util.WebControl.SplitPage();
            List <Conditions> lisWhere   = new List <Conditions>();

            //查询条件
            if (!queryParam["condition"].IsEmpty() && !queryParam["keyword"].IsEmpty())
            {
                string condition = queryParam["condition"].ToString();
                string keyword   = queryParam["keyword"].ToString();
                lisWhere.Add(new LeaRun.Util.WebControl.Conditions()
                {
                    Key = condition, Value = keyword, IsLike = true
                });
            }
            if (!string.IsNullOrEmpty(itemId))
            {
                lisWhere.Add(new LeaRun.Util.WebControl.Conditions()
                {
                    Key = "cinvClassCode", Value = itemId, IsLike = true
                });
            }
            splitPage.Conditions = lisWhere.ToArray();
            var data     = missionreceiveinfobll.GetPageList(pagination, splitPage);
            var jsonData = new
            {
                rows  = data,
                total = pagination.records,
            };

            return(ToJsonResult(jsonData));
        }