コード例 #1
0
        public string GetTplReportDetail(string tplId, string periodId)
        {
            var token = Session["token"] == null ? "XXXXXXX" : Session["token"].ToString();
            string apiResponse = string.Empty;
            TplReportDetailResponse trdr = new TplReportDetailResponse();
            try
            {
                trdr = tplRequest.TplReportDetailObject(token, tplId, periodId);
                if (trdr.code == 0)
                {
                    trdr.data.tpl.tpl_detail.Sort((left, right) => (Convert.ToInt32(left.termid) - Convert.ToInt32(right.termid)));
                    trdr.data.tpl.tpl_detail.Sort((left, right) => (Convert.ToInt32(left.sharpid2) - Convert.ToInt32(right.sharpid2)));
                    trdr.data.tpl.tpl_detail.Sort((left, right) => (Convert.ToInt32(left.sharpid) - Convert.ToInt32(right.sharpid)));
                    apiResponse = JsonHelper.SerializeObject(trdr);
                }
                else
                {
                    APIResponseBase ar = new APIResponseBase { code = 404, message = "报告不存在" };
                    apiResponse = JsonHelper.SerializeObject(ar);
                }


            }
            catch (Exception ex)
            {
                AppLog.Instance.Write("GetTplReportDetail", AppLog.LogMessageType.Error, ex);
            }
            return apiResponse;
        }
コード例 #2
0
        public string GetTplReportDetailById(string id)
        {
            var token = Session["token"] == null ? "XXXXXXX" : Session["token"].ToString();
            string apiResponse = string.Empty;
            TplReportDetailResponse trdr = new TplReportDetailResponse();
            try
            {
                trdr = tplRequest.TplReportDetailByIdObject(token, id);
                trdr.data.tpl.tpl_detail.Sort((left, right) => (Convert.ToInt32(left.termid) - Convert.ToInt32(right.termid)));
                trdr.data.tpl.tpl_detail.Sort((left, right) => (Convert.ToInt32(left.sharpid2) - Convert.ToInt32(right.sharpid2)));
                trdr.data.tpl.tpl_detail.Sort((left, right) => (Convert.ToInt32(left.sharpid) - Convert.ToInt32(right.sharpid)));

                apiResponse = JsonHelper.SerializeObject(trdr);
            }
            catch (Exception ex)
            {
                AppLog.Instance.Write("GetTplReportDetailById", AppLog.LogMessageType.Error, ex);
            }
            return apiResponse;
        }
コード例 #3
0
        public TplReportDetailResponse TplReportDetailByIdObject(string token, string id)
        {

            try
            {
                string ApiResponse = string.Empty;
                TplReportDetailResponse response = new TplReportDetailResponse();

                Dictionary<string, string> sPara = new Dictionary<string, string>();

                sPara.Add("id", id);

                ApiResponse = F8YLSubmit.BuildGetRequest(sPara, "tpl/report/detail?token=" + token);
                response = JsonHelper.DeserializeJsonToObject<TplReportDetailResponse>(ApiResponse);

                return response;
            }
            catch
            {
                throw;
            }
        }