SatisfactionOrderDetail.aspx.cs 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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 SatisfactionOrderDetail : System.Web.UI.Page
  11. {
  12. protected void Page_Load(object sender, EventArgs e)
  13. {
  14. ViewState["StrSatisfactionID"] = "OrderPerson";
  15. string cusId = Request.QueryString["cusid"];
  16. string appId = Request.QueryString["appid"];
  17. string openId = Request.QueryString["openId"];
  18. string ordernumber = Request.QueryString["OrdNumber"];
  19. if (string.IsNullOrEmpty(cusId) || string.IsNullOrEmpty(cusId.Trim()))
  20. {
  21. Response.Write("非法访问!");
  22. Response.End();
  23. return;
  24. }
  25. else
  26. {
  27. LYFZ.WeixinServiceDate.Model.Model_CustomerInterfaces cusModel = LYFZ.WeixinServers.Global.GetCustomerModelById(cusId);
  28. string getCheckText = LYFZ.WinAPI.HttpClientHelper.GetResponse(cusModel.GetRequestUrl()
  29. + "/Api/WXApi.ashx/CheckWXCustomerHaveChangeOrder?openid=" + openId + "&appid=" + appId + "&ordernumber=" + ordernumber);
  30. dynamic dyCheckObject = Newtonsoft.Json.JsonConvert.DeserializeObject(getCheckText);
  31. if (Convert.ToBoolean(dyCheckObject.data))
  32. {
  33. if (!IsPostBack)
  34. {
  35. string Types = "";
  36. if (!string.IsNullOrEmpty(Request.QueryString["type"]))
  37. { Types = Request.QueryString["type"].ToString().Trim(); }
  38. if (Types.Trim() == "2")
  39. {
  40. string queryData = "";
  41. string postData = "";
  42. foreach (string key in Request.QueryString.AllKeys)
  43. {
  44. if (!string.IsNullOrEmpty(queryData))
  45. {
  46. queryData += "&";
  47. }
  48. queryData += key + "=" + Request.QueryString[key];
  49. }
  50. foreach (string key in Request.Form.AllKeys)
  51. {
  52. if (!string.IsNullOrEmpty(postData))
  53. {
  54. postData += "&";
  55. }
  56. postData += key + "=" + Request.Form[key];
  57. }
  58. if (!string.IsNullOrEmpty(Request.QueryString["btnType"]))
  59. {
  60. ViewState["StrSatisfactionID"] = Request.QueryString["btnType"];
  61. }
  62. string getText = LYFZ.WinAPI.HttpClientHelper.PostResponse(cusModel.GetRequestUrl()
  63. + "/Api/WXApi.ashx/SaveSatisfactionData?" + queryData, postData, "application/x-www-form-urlencoded");
  64. dynamic dyObject = Newtonsoft.Json.JsonConvert.DeserializeObject(getText);
  65. Response.Write("<script type='text/javascript'>alert('" + dyObject.data + "');</script>");
  66. // LYFZ.WeixinServiceDate.Model.Model_CustomerInterfaces cusModel = LYFZ.WeixinServers.Global.GetCustomerModelById(Request["cusid"]);
  67. }
  68. }
  69. }
  70. else
  71. {
  72. Response.Write("您无权对订单编号:" + ordernumber+"的订单进行评价!");
  73. Response.End();
  74. }
  75. }
  76. }
  77. }
  78. }