Exemple #1
0
        public static GDTXGuiZhouUserYSBQC GetYSBQCByBDDM(string BDDM)
        {
            GTXResult resultq = GTXMethod.GetGuiZhouYSBQC();

            if (resultq.IsSuccess)
            {
                List <GDTXGuiZhouUserYSBQC> ysbqclist = JsonConvert.DeserializeObject <List <GDTXGuiZhouUserYSBQC> >(resultq.Data.ToString());

                ysbqclist = ysbqclist.Where(a => a.BDDM.ToUpper() == BDDM.ToUpper()).ToList();
                return(ysbqclist[0]);
            }
            else
            {
                return(new GDTXGuiZhouUserYSBQC());
            }
        }
Exemple #2
0
        public static JArray getDataPublicForQYSDSYJD(string BDDM, string BBID)
        {
            string    bbData        = "";
            JArray    ja_bbDataList = new JArray();
            string    userYsbqcId   = "";
            GTXResult result        = GTXMethod.GetGuiZhouYSBQC();

            if (result.IsSuccess)
            {
                List <GDTXGuiZhouUserYSBQC> ysbqclist = JsonConvert.DeserializeObject <List <GDTXGuiZhouUserYSBQC> >(result.Data.ToString());
                if (ysbqclist.Count > 0)
                {
                    foreach (GDTXGuiZhouUserYSBQC item in ysbqclist)
                    {
                        if (item.BDDM == BDDM)
                        {
                            userYsbqcId = item.Id.ToString();
                        }
                    }
                }
            }

            GTXResult ass = GTXMethod.GetUserReportData(userYsbqcId, BBID);

            if (ass.IsSuccess)
            {
                List <GDTXGuiZhouUserYSBQCReportData> dataList = JsonConvert.DeserializeObject <List <GDTXGuiZhouUserYSBQCReportData> >(ass.Data.ToString());
                foreach (GDTXGuiZhouUserYSBQCReportData item in dataList)
                {
                    byte[]        outputb        = Convert.FromBase64String(item.DataValue);
                    string        str_bbDataList = Encoding.Default.GetString(outputb);
                    List <string> bbDataList     = str_bbDataList.Split('&').ToList();
                    foreach (string s in bbDataList)
                    {
                        JObject  jo = new JObject();
                        string[] ss = s.Split('=');
                        jo["name"]  = ss[0];
                        jo["value"] = ss[1];
                        ja_bbDataList.Add(jo);
                    }
                    bbData = JsonConvert.SerializeObject(ja_bbDataList, Newtonsoft.Json.Formatting.None);
                }
            }
            return(ja_bbDataList);
        }