县级监管平台

AreaController.cs 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using CallCenterApi.Common;
  2. using CallCenterApi.Interface.Controllers.Base;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Web;
  7. using System.Web.Mvc;
  8. namespace CallCenterApi.Interface.Controllers
  9. {
  10. public class AreaController : BaseController
  11. {
  12. /// <summary>
  13. /// 获取区域列表
  14. /// </summary>
  15. /// <returns></returns>
  16. public ActionResult GetAreaListById(string branchcode, int id = 0)
  17. {
  18. string sqlwhere = " F_IsDelete=0 ";
  19. if (!string.IsNullOrEmpty(branchcode))
  20. {
  21. sqlwhere += " and F_Code='" + branchcode + "'";
  22. }
  23. else
  24. {
  25. return Error("请选择区县");
  26. }
  27. var list = new BLL.T_Branch_List().GetModelList(sqlwhere);
  28. if (list.Count == 0)
  29. {
  30. return Error("查询失败");
  31. }
  32. if (id <= 0)
  33. {
  34. return Error("查询失败");
  35. }
  36. string controllername = RouteData.Values["controller"].ToString();
  37. string actionname = RouteData.Values["action"].ToString();
  38. if (!string.IsNullOrEmpty(list[0].F_Url))
  39. {
  40. string signcode = CommonHelper.getsigncode(controllername, actionname, list[0].F_Sign);
  41. string strparams = "?id=" + id + "&signcode=" + signcode;
  42. string result = HttpMethods.HttpGet(list[0].F_Url + "/" + controllername + "/" + actionname + strparams);
  43. return Content(result);
  44. }
  45. else
  46. {
  47. return Error("查询失败");
  48. }
  49. }
  50. }
  51. }