コード例 #1
0
        public List <GDTXUserYSBQC> getUserYSBQC()
        {
            GTXResult resultq = GTXMethod.GetHuNanYSBQC();

            if (resultq.IsSuccess)
            {
                List <GDTXUserYSBQC> ysbqclist = JsonConvert.DeserializeObject <List <GDTXUserYSBQC> >(resultq.Data.ToString());
                return(ysbqclist);
            }
            else
            {
                return(null);
            }
        }
コード例 #2
0
        public GTXResult saveUserYSBQCReportData(string strJson, 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(strJson);
            string _result = HttpUtility.UrlEncode(Convert.ToBase64String(bytes));

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

            return(saveresult);
        }
コード例 #3
0
        public string getUserYSBQCReportData_String(int id, string reportCode, string dataKey = "data")
        {
            string    re_str = "";
            GTXResult gr     = GTXMethod.GetUserReportData(id.ToString(), reportCode);

            if (gr.IsSuccess)
            {
                List <GDTXUserYSBQCReportData> dataList = JsonConvert.DeserializeObject <List <GDTXUserYSBQCReportData> >(gr.Data.ToString());
                if (dataList.Count > 0)
                {
                    byte[] outputb   = Convert.FromBase64String(dataList[0].DataValue);
                    string dataValue = Encoding.Default.GetString(outputb);
                    re_str = dataValue;
                }
            }
            return(re_str);
        }
コード例 #4
0
        public JToken getUserYSBQCReportData(int id, string reportCode, string dataKey = "data")
        {
            GTXResult gr = GTXMethod.GetUserReportData(id.ToString(), reportCode);

            if (gr.IsSuccess)
            {
                List <GDTXUserYSBQCReportData> dataList = JsonConvert.DeserializeObject <List <GDTXUserYSBQCReportData> >(gr.Data.ToString());
                if (dataList.Count > 0)
                {
                    GDTXUserYSBQCReportData data = dataList.Where(a => a.DataKey == dataKey).FirstOrDefault();
                    byte[] outputb   = Convert.FromBase64String(data.DataValue);
                    string dataValue = Encoding.Default.GetString(outputb);
                    JToken re_json   = JsonConvert.DeserializeObject <JToken>(dataValue);
                    return(re_json);
                }
            }
            return(JToken.FromObject(new object()));
        }
コード例 #5
0
        public GDTXUserYSBQC getUserYSBQC(Type controller)
        {
            string s = controller.Name;

            s = s.Substring(0, s.IndexOf("Controller"));
            GTXResult resultq = GTXMethod.GetHuNanYSBQC();

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

                ysbqclist = ysbqclist.Where(a => a.BDDM.ToUpper() == s.ToUpper()).ToList();
                return(ysbqclist[0]);
            }
            else
            {
                //return new GDTXBeiJingUserYSBQC();
                return(null);
            }
        }
コード例 #6
0
        public Nsrxx getNsrxx()
        {
            Nsrxx     X   = new Nsrxx();
            GTXResult gr1 = GTXMethod.GetCompany();

            if (gr1.IsSuccess)
            {
                JObject jo = new JObject();
                jo = JsonConvert.DeserializeObject <JObject>(gr1.Data.ToString());
                if (jo.HasValues)
                {
                    JObject data_jo = jo;
                    X.NSRMC       = data_jo["NSRMC"].ToString();
                    X.NSRSBH      = data_jo["NSRSBH"].ToString();
                    X.DJZCLX      = data_jo["DJZCLX"].ToString();
                    X.ZCDZ        = data_jo["ZCDZ"].ToString();
                    X.SCJYDZ      = data_jo["SCJYDZ"].ToString();
                    X.LXDH        = data_jo["LXDH"].ToString();
                    X.GBHY        = data_jo["GBHY"].ToString();
                    X.ZGDSSWJFJMC = data_jo["ZGDSSWJFJMC"].ToString();
                }
            }

            GTXResult gr2 = GTXMethod.GetCompanyPerson();

            if (gr2.IsSuccess)
            {
                JArray ja = new JArray();
                ja = JsonConvert.DeserializeObject <JArray>(gr2.Data.ToString());
                if (ja.Count > 0)
                {
                    JObject data_jo = (JObject)ja[0];
                    X.Name      = data_jo["Name"].ToString();
                    X.IDCardNum = data_jo["IDCardNum"].ToString();
                }
            }
            return(X);
        }
コード例 #7
0
        public GDTXUserYSBQC getUserYSBQC(string dm)
        {
            string s = dm.ToUpper();

            switch (s)
            {
            case "YBNSRZZSXBSZ":
                s = "YBNSRZZS";
                break;
            }
            GTXResult resultq = GTXMethod.GetHuNanYSBQC();

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

                ysbqclist = ysbqclist.Where(a => a.BDDM.ToUpper() == s).ToList();
                return(ysbqclist[0]);
            }
            else
            {
                return(null);
            }
        }