public HttpResponseMessage GetSbTree(string callback) { string return_str = ""; JObject re_json = new JObject(); string str = System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("GetSbTree.json")); re_json = JsonConvert.DeserializeObject <JObject>(str); JObject in_jo = (JObject)re_json["userdata"]; 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; in_jo["NSRMC"] = data_jo["NSRMC"]; in_jo["NSRSBH"] = data_jo["NSRSBH"]; in_jo["DJZCLXMC"] = data_jo["DJZCLX"]; in_jo["ZCDZ"] = data_jo["ZCDZ"]; in_jo["SCJYDZ"] = data_jo["SCJYDZ"]; in_jo["DHHM"] = data_jo["LXDH"]; in_jo["HYMC"] = data_jo["GBHY"]; in_jo["ZGSWJG_MC"] = data_jo["ZGDSSWJFJMC"]; } } 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]; in_jo["FDDBR"] = data_jo["Name"]; } } return_str = callback + "(" + JsonConvert.SerializeObject(re_json) + ")"; return(new HttpResponseMessage() { Content = new StringContent(return_str, System.Text.Encoding.UTF8, "application/json") }); }
public void ProcessRequest(HttpContext context) { String json = File.ReadAllText(context.Server.MapPath("compareGdsNsrxx.json")); GTXResult resultCompany = GTXMethod.GetCompany(); if (resultCompany.IsSuccess) { JObject company = (JObject)JsonConvert.DeserializeObject(resultCompany.Data.ToString()); if (company.HasValues) { json = json.Replace("@@NSRSBH", (company["NSRSBH"] == null ? "" : company["NSRSBH"].ToString())) .Replace("@@NSRMC", (company["NSRMC"] == null ? "" : company["NSRMC"].ToString())) .Replace("@@ZGGSSWJMC", (company["ZGGSSWJMC"] == null ? "" : company["ZGGSSWJMC"].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") { json = json.Replace("@@FDDB", (joperson["Name"] == null ? "" : joperson["Name"].ToString())) .Replace("@@ID_FDDB", (joperson["IDCardNum"] == null ? "" : joperson["IDCardNum"].ToString())) .Replace("@@MB_FDDB", (joperson["MobilePhone"] == null ? "" : joperson["MobilePhone"].ToString())); } } } } context.Response.ContentType = "text/plain"; context.Response.Write(json); }
public JObject queryNsrxxByNsrsbh() { JObject re_json = new JObject(); string str = System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("ajax.sword.GY002CommonCtrl_queryNsrxxByNsrsbh.json")); re_json = JsonConvert.DeserializeObject <JObject>(str); JObject in_jo = (JObject)re_json["data"][1]["trs"][0]["tds"]; 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; in_jo["nsrmc"]["value"] = data_jo["NSRMC"]; } } 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]; in_jo["fddbrsfzjhm"]["value"] = data_jo["IDCardNum"]; } } return(re_json); }