DeviceController.cs 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. using LeaRun.Util.WebControl;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Web;
  6. using System.Web.Mvc;
  7. using LeaRun.Application.Service.WaterWellManage;
  8. using LeaRun.Application.Entity.WaterWellManage;
  9. using LeaRun.Application.Busines.WaterWell;
  10. namespace LeaRun.Application.Web.Areas.WaterWellManage.Controllers
  11. {
  12. public class DeviceController : Controller
  13. {
  14. private DeviceBLL deviceBll = new DeviceBLL();
  15. public ActionResult Index()
  16. {
  17. return View();
  18. }
  19. #region 获取可扩展列表
  20. /// <summary>
  21. /// 获取可扩展列表
  22. /// </summary>
  23. /// <param name="showcheck"></param>
  24. /// <returns></returns>
  25. [HttpGet]
  26. public ActionResult GetTreeJson(bool showcheck = true)
  27. {
  28. return Content(deviceBll.GetTreeEntity("0", showcheck).ToList().TreeToJson("sys0"));
  29. }
  30. #endregion
  31. #region 获取无父级别列表
  32. /// <summary>
  33. /// 获取无父级别列表
  34. /// </summary>
  35. /// <param name="showcheck"></param>
  36. /// <returns></returns>
  37. [HttpGet]
  38. public ActionResult GetNoParentJson(bool showcheck = true)
  39. {
  40. string lsit = deviceBll.GetTreeList(showcheck);
  41. return Content(lsit);
  42. }
  43. #endregion
  44. #region 查询测点(模糊查询)
  45. /// <summary>
  46. /// 查询测点(模糊查询)
  47. /// </summary>
  48. /// <param name="name"></param>
  49. /// <returns></returns>
  50. [HttpGet]
  51. public ActionResult SearchWaterWellLikeName(string name)
  52. {
  53. string data = deviceBll.SearchWaterWellLikeName(name);
  54. return Content(data);
  55. }
  56. #endregion
  57. #region 查询名称
  58. /// <summary>
  59. /// 查询名称
  60. /// </summary>
  61. /// <param name="name"></param>
  62. /// <returns></returns>
  63. [HttpGet]
  64. public ActionResult SearchWaterWellName()
  65. {
  66. string data = deviceBll.SearchWaterWellName();
  67. return Content(data);
  68. }
  69. #endregion
  70. #region 获取所有设备列表
  71. /// <summary>
  72. /// 获取所有设备列表
  73. /// </summary>
  74. /// <returns></returns>
  75. [HttpGet]
  76. public ActionResult GetAllDevice()
  77. {
  78. return Content(deviceBll.GetAllDevice());
  79. }
  80. #endregion
  81. }
  82. }