示例#1
0
        public GTXResult saveUserYSBQCListReportData(JToken json, string userYsbqcId, string reportCode, string dataKey = "data")
        {
            List <GTXNameValue> nameList = new List <GTXNameValue>();
            GTXNameValue        nv       = new GTXNameValue();

            nv.key = dataKey;
            byte[] bytes   = Encoding.Default.GetBytes(JsonConvert.SerializeObject(json, Newtonsoft.Json.Formatting.None));
            string _result = HttpUtility.UrlEncode(Convert.ToBase64String(bytes));

            nv.value = _result;
            nameList.Add(nv);

            GTXResult gr = GTXMethod.GetUserReportData(userYsbqcId, reportCode);

            if (gr.IsSuccess)
            {
                List <GDTXUserYSBQCReportData> dataList = JsonConvert.DeserializeObject <List <GDTXUserYSBQCReportData> >(gr.Data.ToString());
                foreach (GDTXUserYSBQCReportData data in dataList)
                {
                    if (data.DataKey == dataKey)
                    {
                        continue;
                    }
                    GTXNameValue data_nv = new GTXNameValue();
                    data_nv.key   = data.DataKey;
                    data_nv.value = HttpUtility.UrlEncode(data.DataValue);
                    nameList.Add(data_nv);
                }
            }
            GTXResult saveresult = GTXMethod.SaveUserReportData(JsonConvert.SerializeObject(nameList), userYsbqcId, reportCode);

            return(saveresult);
        }
示例#2
0
        public GTXResult saveUserYSBQCReportData(JToken json, string userYsbqcId, string reportCode, string dataKey = "data")
        {
            List <GTXNameValue> nameList = new List <GTXNameValue>();
            GTXNameValue        nv       = new GTXNameValue();

            nv.key = dataKey;
            byte[] bytes   = Encoding.Default.GetBytes(JsonConvert.SerializeObject(json, Newtonsoft.Json.Formatting.None));
            string _result = HttpUtility.UrlEncode(Convert.ToBase64String(bytes));

            nv.value = _result;
            nameList.Add(nv);
            GTXResult saveresult = GTXMethod.SaveUserReportData(JsonConvert.SerializeObject(nameList), userYsbqcId, reportCode);

            return(saveresult);
        }