private string getUserRefundState(HttpContext context) { userState jsonResult = new userState(); string openid = context.Request["openid"]; DataTable dt = ms.getUserRefundState(openid); if (dt != null && dt.Rows.Count > 0) { jsonResult.Success = true; //jsonResult.backBiaoNum = dt.Rows[0]["backBiaoNum"].ToString(); //jsonResult.flag = dt.Rows[0]["flag"].ToString() == "2" ? "已结束" : "未结束"; //jsonResult.payState = dt.Rows[0]["payState"].ToString() == "0" ? "已支付" : "未支付"; //jsonResult.refundState = dt.Rows[0]["refundState"].ToString() == "0" ? "已退" : "未退"; //jsonResult.biaoState = dt.Rows[0]["biaoState"].ToString() == "0" ? "未还" : "已还"; jsonResult.flag = dt.Rows[0]["flag"].ToString(); jsonResult.payState = dt.Rows[0]["payState"].ToString(); jsonResult.refundState = dt.Rows[0]["refundState"].ToString(); jsonResult.biaoState = dt.Rows[0]["biaoState"].ToString(); } else { jsonResult.Success = true; jsonResult.flag = "2"; jsonResult.payState = "0"; jsonResult.refundState = "0"; jsonResult.biaoState = "1"; } string strJson = JsonConvert.SerializeObject(jsonResult); return(strJson); }