using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace LYFZ.Web.WeiXinAPP.Satisfaction { public partial class SatisfactionOrderView : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { string StrClientView = ""; if (!IsPostBack) { string StrClientNumber = ""; string cusid = Request.QueryString["cusid"]; string appid = Request.QueryString["appid"]; string openid = Request.QueryString["openid"]; if (!string.IsNullOrEmpty(Request.QueryString["cusid"]) && !string.IsNullOrEmpty(Request.QueryString["openid"]) && !string.IsNullOrEmpty(Request.QueryString["appid"])) { LYFZ.WeixinServiceDate.Model.Model_CustomerInterfaces cusModel = LYFZ.WeixinServers.Global.GetCustomerModelById(cusid); //cusModel.GetRequestUrl() string getCheckText = LYFZ.WinAPI.HttpClientHelper.GetResponse(cusModel.GetRequestUrl() + "/Api/WXApi.ashx/GetWXCustomerHaveOrder?openid=" + openid + "&appid=" + appid); dynamic dyObject = Newtonsoft.Json.JsonConvert.DeserializeObject(getCheckText); Newtonsoft.Json.Linq.JArray arrayList = (Newtonsoft.Json.Linq.JArray)dyObject.data; if (arrayList.Count>0) { if (arrayList.Count > 1) { StrClientView = Funt_GetOrderMianPanel(arrayList, StrTitleText: "我的订单", StrNotShowText: "Ord_Number,Ordv_ViceNumber", LinkAddressName: "SatisfactionOrderDetail.aspx", openid: openid, cusid: cusid, appid: appid); } else { Response.Redirect("SatisfactionOrderDetail.aspx?cusid=" + cusid + "&openId=" + openid + "&appid=" + appid + "&OrdNumber=" + arrayList[0]["Ord_Number"] + "&ViceOrdNumber=" + arrayList[0]["Ordv_ViceNumber"]); } } else { StrClientView = "
"; } } ViewState["ClientView"] = StrClientView; } } string Funt_GetOrderMianPanel(Newtonsoft.Json.Linq.JArray dt, string StrTitleText, string StrNotShowText = "", string LinkAddressName = "",string openid="",string cusid="",string appid="") { string StrDataList = ""; List NotShowTextlist = StrNotShowText.Split(',').ToList(); if (dt != null && dt.Count > 0) { for (int i = 0; i < dt.Count; i++) { Newtonsoft.Json.Linq.JObject jobject = (Newtonsoft.Json.Linq.JObject)dt[i]; IDictionary keys = new Dictionary(); foreach (var item in jobject) { keys.Add(item.Key, item.Value); } string StrOnClick = ""; if (!string.IsNullOrEmpty(LinkAddressName)) { string strLinkName = ""; for (int k = 0; k < NotShowTextlist.Count; k++) { if (k == 0) { if (LinkAddressName.Trim().IndexOf('?') == -1) { strLinkName += "?" + NotShowTextlist[k].Trim() + "=" + keys[NotShowTextlist[k].Trim()].ToString(); } else { strLinkName += "&" + NotShowTextlist[k].Trim() + "=" + keys[NotShowTextlist[k].Trim()].ToString(); } } else { strLinkName += "&" + NotShowTextlist[k].Trim() + "=" + jobject[NotShowTextlist[k].Trim()].ToString(); } } StrOnClick = "onclick=\"window.location.href = '" + LinkAddressName + strLinkName + "&cusid=" + cusid + "&openId=" + openid + "&appid=" + appid + "'\""; StrOnClick = StrOnClick.Replace("Ord_Number", "OrdNumber").Replace("Ordv_ViceNumber", "ViceOrdNumber"); } StrDataList += "
" + "

" + StrTitleText + "-" + (i + 1) + "

" + "
" + "
" + "
" + " "; foreach (string key in keys.Keys) { bool IsFind = false; for (int k = 0; k < NotShowTextlist.Count; k++) { if (key.Equals(NotShowTextlist[k])) { IsFind = true; break; } } if (IsFind) { continue; } StrDataList += "
" + key + ":" + keys[key] + "
"; } StrDataList += "
" + "
" + "
" + "
" + "
"; } } else { StrDataList += "
" + //"

" + StrTitleText + "

" + "
" + "
" + "
" + " " + "
未查找到任何相关数据。
" + "
" + "
" + "
" + "
" + "
"; } return StrDataList; } } }