//取token数据
        private void getTokenData(string tokenTemplateId, string pageSize, string pageNo)
        {
            //取token
            String     viewDtostrToken = RestCall.httpGetMethod("http://192.168.1.7:5090/bill/generalView?tokenTemplateId=" + tokenTemplateId + "&pageSize=" + pageSize + "&pageNo=" + pageNo);
            Result     previewResult   = Newtonsoft.Json.JsonConvert.DeserializeObject <Result>(viewDtostrToken);
            PreviewDTO previewDTO      = Newtonsoft.Json.JsonConvert.DeserializeObject <PreviewDTO>(previewResult.data.ToString());

            //遍历token,给列赋值
            foreach (ReducedTokenDataDto tokenDataDto in previewDTO.datas.tokenDataDtoList)
            {
                DataRow dr = Dt.NewRow();
                dr["ID"] = tokenDataDto.tokenId;
                foreach (ReducedFkeyField fkeyField in tokenDataDto.fields)
                {
                    String caption = null;
                    RelationCaptionAndKey.TryGetValue(fkeyField.key, out caption);
                    string jsonData = fkeyField.jsonData;
                    switch (jsonData)
                    {
                    case "true":
                        jsonData = "男"; dr[caption] = jsonData; break;

                    case "false":
                        jsonData = "女"; dr[caption] = jsonData; break;

                    default:
                        dr[caption] = fkeyField.jsonData; break;
                    }
                    //dr[caption] = fkeyField.jsonData;
                }
                Dt.Rows.Add(dr);
            }
        }
Beispiel #2
0
        public List <ReducedTokenDataDto> getReducedTokenDataDtos(string ttid)
        {
            String     viewDtostrToken = RestCall.httpGetMethod("http://192.168.1.7:5090/bill/generalView?tokenTemplateId=" + ttid + "&pageSize=" + "500" + "&pageNo=" + "1");
            Result     previewResult   = Newtonsoft.Json.JsonConvert.DeserializeObject <Result>(viewDtostrToken);
            PreviewDTO previewDTO      = Newtonsoft.Json.JsonConvert.DeserializeObject <PreviewDTO>(previewResult.data.ToString());

            return(previewDTO.datas.tokenDataDtoList);
        }