SatisfactionOrderView.aspx.cs 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data;
  4. using System.Linq;
  5. using System.Web;
  6. using System.Web.UI;
  7. using System.Web.UI.WebControls;
  8. namespace LYFZ.Web.WeiXinAPP.Satisfaction
  9. {
  10. public partial class SatisfactionOrderView : System.Web.UI.Page
  11. {
  12. protected void Page_Load(object sender, EventArgs e)
  13. {
  14. string StrClientView = "";
  15. if (!IsPostBack)
  16. {
  17. string StrClientNumber = "";
  18. string cusid = Request.QueryString["cusid"];
  19. string appid = Request.QueryString["appid"];
  20. string openid = Request.QueryString["openid"];
  21. if (!string.IsNullOrEmpty(Request.QueryString["cusid"]) && !string.IsNullOrEmpty(Request.QueryString["openid"]) && !string.IsNullOrEmpty(Request.QueryString["appid"]))
  22. {
  23. LYFZ.WeixinServiceDate.Model.Model_CustomerInterfaces cusModel = LYFZ.WeixinServers.Global.GetCustomerModelById(cusid);
  24. //cusModel.GetRequestUrl()
  25. string getCheckText = LYFZ.WinAPI.HttpClientHelper.GetResponse(cusModel.GetRequestUrl()
  26. + "/Api/WXApi.ashx/GetWXCustomerHaveOrder?openid=" + openid + "&appid=" + appid);
  27. dynamic dyObject = Newtonsoft.Json.JsonConvert.DeserializeObject(getCheckText);
  28. Newtonsoft.Json.Linq.JArray arrayList = (Newtonsoft.Json.Linq.JArray)dyObject.data;
  29. if (arrayList.Count>0)
  30. {
  31. if (arrayList.Count > 1)
  32. {
  33. StrClientView = Funt_GetOrderMianPanel(arrayList, StrTitleText: "我的订单", StrNotShowText: "Ord_Number,Ordv_ViceNumber", LinkAddressName: "SatisfactionOrderDetail.aspx", openid: openid, cusid: cusid, appid: appid);
  34. }
  35. else
  36. {
  37. Response.Redirect("SatisfactionOrderDetail.aspx?cusid=" + cusid + "&openId=" + openid + "&appid=" + appid + "&OrdNumber=" + arrayList[0]["Ord_Number"] + "&ViceOrdNumber=" + arrayList[0]["Ordv_ViceNumber"]);
  38. }
  39. }
  40. else
  41. { StrClientView = " <div style='text-align: center'><label class='weui_cell weui_check_label' style='text-align: center'>您未订单,暂无订单评价!</label></div>"; }
  42. }
  43. ViewState["ClientView"] = StrClientView;
  44. }
  45. }
  46. string Funt_GetOrderMianPanel(Newtonsoft.Json.Linq.JArray dt, string StrTitleText, string StrNotShowText = "", string LinkAddressName = "",string openid="",string cusid="",string appid="")
  47. {
  48. string StrDataList = "";
  49. List<string> NotShowTextlist = StrNotShowText.Split(',').ToList();
  50. if (dt != null && dt.Count > 0)
  51. {
  52. for (int i = 0; i < dt.Count; i++)
  53. {
  54. Newtonsoft.Json.Linq.JObject jobject = (Newtonsoft.Json.Linq.JObject)dt[i];
  55. IDictionary<string, object> keys = new Dictionary<string, object>();
  56. foreach (var item in jobject)
  57. {
  58. keys.Add(item.Key, item.Value);
  59. }
  60. string StrOnClick = "";
  61. if (!string.IsNullOrEmpty(LinkAddressName))
  62. {
  63. string strLinkName = "";
  64. for (int k = 0; k < NotShowTextlist.Count; k++)
  65. {
  66. if (k == 0)
  67. {
  68. if (LinkAddressName.Trim().IndexOf('?') == -1)
  69. { strLinkName += "?" + NotShowTextlist[k].Trim() + "=" + keys[NotShowTextlist[k].Trim()].ToString(); }
  70. else
  71. { strLinkName += "&" + NotShowTextlist[k].Trim() + "=" + keys[NotShowTextlist[k].Trim()].ToString(); }
  72. }
  73. else
  74. { strLinkName += "&" + NotShowTextlist[k].Trim() + "=" + jobject[NotShowTextlist[k].Trim()].ToString(); }
  75. }
  76. StrOnClick = "onclick=\"window.location.href = '" + LinkAddressName + strLinkName + "&cusid=" + cusid + "&openId=" + openid + "&appid=" + appid + "'\"";
  77. StrOnClick = StrOnClick.Replace("Ord_Number", "OrdNumber").Replace("Ordv_ViceNumber", "ViceOrdNumber");
  78. }
  79. StrDataList += "<div class='figure'>" +
  80. " <h3 class='figure-caption'>" + StrTitleText + "-" + (i + 1) + "</h3>" +
  81. " <div class='figure-content'>" +
  82. " <div class='grid'>" +
  83. " <div class='col-12'>" +
  84. " <span " + StrOnClick + ">";
  85. foreach (string key in keys.Keys)
  86. {
  87. bool IsFind = false;
  88. for (int k = 0; k < NotShowTextlist.Count; k++)
  89. {
  90. if (key.Equals(NotShowTextlist[k]))
  91. { IsFind = true; break; }
  92. }
  93. if (IsFind)
  94. { continue; }
  95. StrDataList += " <div class='grid-item'><span class='grid-item-title'>" + key + ":</span><span>" + keys[key] + "</span></div>";
  96. }
  97. StrDataList += " </span>" +
  98. " </div>" +
  99. " </div>" +
  100. " </div>" +
  101. "</div>";
  102. }
  103. }
  104. else
  105. {
  106. StrDataList += "<div class='figure'>" +
  107. //" <h3 class='figure-caption'>" + StrTitleText + "</h3>" +
  108. " <div class='figure-content'>" +
  109. " <div class='grid'>" +
  110. " <div class='col-12'>" +
  111. " <span>" +
  112. " <div class='grid-item'><span> 未查找到任何相关数据。</span></div>" +
  113. " </span>" +
  114. " </div>" +
  115. " </div>" +
  116. " </div>" +
  117. "</div>";
  118. }
  119. return StrDataList;
  120. }
  121. }
  122. }