public List <GDTXUserYSBQC> getUserYSBQC() { GTXResult resultq = GTXMethod.GetUserYSBQC(); if (resultq.IsSuccess) { List <GDTXUserYSBQC> ysbqclist = JsonConvert.DeserializeObject <List <GDTXUserYSBQC> >(resultq.Data.ToString()); return(ysbqclist); } else { return(null); } }
public static string getCompanyinfo(string json) { StringBuilder jsonstr = new StringBuilder(json); GTXResult resultCompany = GTXMethod.GetCompany(); if (resultCompany.IsSuccess) { JObject company = (JObject)JsonConvert.DeserializeObject(resultCompany.Data.ToString()); if (company.HasValues) { jsonstr.Replace("@@ZCDZ", (company["ZCDZ"] == null ? "" : company["ZCDZ"].ToString())) .Replace("@@JYFW", (company["JYFW"] == null ? "" : company["JYFW"].ToString())) .Replace("@@GBHY", (company["GBHY"] == null ? "" : company["GBHY"].ToString())) .Replace("@@SCJYDZ", (company["SCJYDZ"] == null ? "" : company["SCJYDZ"].ToString())) .Replace("@@ZGDSSWJFJMC", (company["ZGDSSWJFJMC"] == null ? "" : company["ZGDSSWJFJMC"].ToString())) .Replace("@@DJZCLX", (company["DJZCLX"] == null ? "" : company["DJZCLX"].ToString())) .Replace("@@LXDH", (company["LXDH"] == null ? "" : company["LXDH"].ToString())) .Replace("@@NSRSBH", (company["NSRSBH"] == null ? "" : company["NSRSBH"].ToString())) .Replace("@@NSRMC", (company["NSRMC"] == null ? "" : company["NSRMC"].ToString())); } } GTXResult resultCompanyPerson = GTXMethod.GetCompanyPerson(); if (resultCompanyPerson.IsSuccess) { JArray jrperson = (JArray)JsonConvert.DeserializeObject(resultCompanyPerson.Data.ToString()); if (jrperson.Count > 0) { for (int i = 0; i < jrperson.Count; i++) { JObject joperson = JObject.Parse(jrperson[i].ToString()); if (joperson["PersonType"] != null && joperson["PersonType"].ToString() == "0") { jsonstr.Replace("@@FDDB", (joperson["Name"] == null ? "" : joperson["Name"].ToString())) .Replace("@@FDID", (joperson["IDCardNum"] == null ? "" : joperson["IDCardNum"].ToString())) .Replace("@@FDSJ", (joperson["MobilePhone"] == null ? "" : joperson["MobilePhone"].ToString())); } if (joperson["PersonType"] != null && joperson["PersonType"].ToString() == "2") { jsonstr.Replace("@@BSR", (joperson["Name"] == null ? "" : joperson["Name"].ToString())) .Replace("@@BSID", (joperson["IDCardNum"] == null ? "" : joperson["IDCardNum"].ToString())) .Replace("@@BSSJ", (joperson["MobilePhone"] == null ? "" : joperson["MobilePhone"].ToString())); } } } } return(jsonstr.ToString()); }
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); }
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); }
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())); }
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); }
public GDTXUserYSBQC getUserYSBQC(Type controller) { string s = controller.Name; s = s.Substring(0, s.IndexOf("Controller")); GTXResult resultq = GTXMethod.GetUserYSBQC(); if (resultq.IsSuccess) { List <GDTXUserYSBQC> ysbqclist = JsonConvert.DeserializeObject <List <GDTXUserYSBQC> >(resultq.Data.ToString()); ysbqclist = ysbqclist.Where(a => a.BDDM.ToUpper() == s.ToUpper()).ToList(); if (ysbqclist.Count == 0) { return(null); } return(ysbqclist[0]); } else { //return new GDTXBeiJingUserYSBQC(); return(null); } }