SatisfactionHandler.ashx.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. namespace LYFZ.WeixinServers.WeiXinAPP.Api
  6. {
  7. /// <summary>
  8. /// SatisfactionHandler 的摘要说明
  9. /// </summary>
  10. public class SatisfactionHandler : IHttpHandler
  11. {
  12. public void ProcessRequest(HttpContext context)
  13. {
  14. string type = context.Request["type"];
  15. switch(type)
  16. {
  17. case "VarSatisfactionOnclick":
  18. GetWeiXinSatisfactionData(context);
  19. break;
  20. }
  21. }
  22. private void GetWeiXinSatisfactionData(HttpContext context)
  23. {
  24. string cusId = context.Request["cusid"];
  25. string strItemText = context.Request["ItemText"];
  26. string strItemValue = context.Request["ItemValue"];
  27. string strViceItemValue = context.Request["ViceItemValue"];
  28. if (string.IsNullOrEmpty(cusId) || string.IsNullOrEmpty(cusId.Trim()))
  29. {
  30. Print(context, "");
  31. return;
  32. }
  33. LYFZ.WeixinServiceDate.Model.Model_CustomerInterfaces cusModel = LYFZ.WeixinServers.Global.GetCustomerModelById(cusId);
  34. string getText = LYFZ.WinAPI.HttpClientHelper.GetResponse(cusModel.GetRequestUrl()
  35. + "/WebMobile/AjaxUpdate/AjaxUpdate.ashx?type=VarSatisfactionOnclick&strText=" + strItemText + "&strValue=" + strItemValue + "&strViceValue=" + strViceItemValue );
  36. Print(context, getText);
  37. }
  38. public void Print(HttpContext context,string msg)
  39. {
  40. context.Response.ContentType = "text/plain";
  41. context.Response.Write(msg);
  42. }
  43. public bool IsReusable
  44. {
  45. get
  46. {
  47. return false;
  48. }
  49. }
  50. }
  51. }