public async Task History() { var para = this.ParaForm <AssetM>(); List <AssetM> data = AssetBll.HistoryList(para); if (data.Count == 0) { await this.Json(new { errmsg = para.ErrorMsg, errcode = para.ErrorCode }); return; } // 返回字段按需设定 var redata = AllFieldList(data); // 按需字段列表 if (!string.IsNullOrWhiteSpace(para.Fields) && para.Fields.Split(',').Length > 0) { var list = SerializeHelp.ObjectsToDicts(redata, para.Fields.Split(',')); await this.Json(new { list, errcode = ErrCode.Success }); return; } // 所有字段 await this.Json(new { list = redata, errcode = ErrCode.Success }); }
public void HistoryList() { AssetM para = new AssetM(); para.Id = "5ce71c0d131f46cf9c36d1d68e48b763"; List <AssetM> data = AssetBll.HistoryList(para); foreach (var item in data) { log.WriteLine(item.Title); log.WriteLine(item.Ctime.ToString()); log.WriteLine(item.ItemCode); log.WriteLine("-------------"); } }