Ejemplo n.º 1
0
        public async Task <object> GetExchange(int userId, int pageIndex, int pageSize)
        {
            MessageBase2 result = new MessageBase2();

            var v = await _exchangeService.FindListAsync(pageIndex, pageSize, "", 0, 0, userId);

            var page   = ConvertHelper.ChangeType <MessagePageBase2>(v.pageDto);
            var erList = new List <ExchangeResultModel>();

            v.dto.ForEach(p =>
            {
                erList.Add(new ExchangeResultModel()
                {
                    Id           = p.Id,
                    Title        = p.Title,
                    AddTime      = p.AddTime.ToString("yyyy-MM-dd HH:mm:ss"),
                    Nickname     = p.Nickname,
                    Cover        = p.Cover,
                    Examine      = p.ExamineName + (p.ExamineName == "审核完成" ? ":" + p.Official : ""),
                    LogisticCode = p.LogisticCode,
                    Portrait     = p.Portrait
                });
            });
            page.Data = erList;

            result.Data = page;
            return(result);
        }
Ejemplo n.º 2
0
        public async Task <ActionResult> ExchangeDataJson(int page, int limit)
        {
            var v = await _exchangeService.FindListAsync(page, limit);

            var r = new
            {
                Code  = 0,
                Msg   = "",
                Count = v.pageDto.TotalRecord,
                Data  = v.dto
            };

            return(new JsonResult(r));
        }
Ejemplo n.º 3
0
        public async Task <object> Get(int pageIndex, int pageSize, string sea, int cid, int eid, bool rec)
        {
            MessageBase2 result = new MessageBase2();

            var v = await _exchangeService.FindListAsync(pageIndex, pageSize, sea, cid, eid, 0, rec);

            var page   = ConvertHelper.ChangeType <MessagePageBase2>(v.pageDto);
            var erList = new List <ExchangeResultModel>();

            v.dto.ForEach(p => { erList.Add(ConvertHelper.ChangeType <ExchangeResultModel>(p)); });
            page.Data = erList;

            result.Data = page;
            return(result);
        }