[WebMethod]Public voidQueryrisknotice (stringPhone) {Try{vardata = _risknoticedal.queryrisknotice (phone);varList = fromDainchData. AsEnumerable ()Select New{//Notification numberNumber = da. field<string> ("T_number"),//Note DateDate = da. field<string> ("T_date"),//Notification Master deliveryZs = da. field<string> ("T_zs"),//Notification of power outage equipment and durationTdsb_gq = da. field<string> ("T_tdsb_gq"),//Notification run risk analysisYxfxfx = da. field<string> ("T_yxfxfx"),//Notification of risk pre-control measuresFxykcs = da. field<string> ("T_FXYKCS"),//Notification order Status: 0: Unpublished 1: Published 2: Audited 3: Issued 4: confirmed 5: FiledZT = da. field<int> ("ZT"),//Notification Send dateSend_dt = da. field<DateTime?> ("T_send_dt"),//Invoice Creation dateCreatedt = da. field<DateTime?> ("T_createdt"),//Notification person namename = da. field<string> ("T_name"),//Notice person Type: 1: Approver 2: Issuer 3: Department of Transportation 4: Marketing Department 5: Quality Department 6: CustomerType = da. field<int> ("T_type"),//Notification form signature Status 0: unsigned, 1: SignedRyzt = da. field<int> ("Ryzt"),//Notification picture pathimg = da. field<string> ("T_img"),//Notification form Signature DateSignerdt = da. field<DateTime?> ("T_signerdt") }; _hashtable["Issuccess"] =true; _hashtable["MSG"] ="Get Success"; _hashtable["Data"] = list. ToList (); //Solve garbled code: Context.Response.ContentType = "Text/plain;charset=utf-8";Context.Response.Write (_JSS. Serialize (_hashtable)); }Catch(Exceptione) {Log.debug ("Method Name: Queryrisknotice, Error reason:"+ e.message); _hashtable["Issuccess"] =false; _hashtable["MSG"] ="Get Failed"; _hashtable["Data"] =NULL;varJSON = _JSS. Serialize (_hashtable); Context.Response.Write (JSON); }}
ASP. NET WebService return JSON data garbled resolution method