FactoryRegionController.cs 932 B

12345678910111213141516171819202122232425262728293031323334
  1. using Cksoft.Data;
  2. using Cksoft.Data.Repository;
  3. using Cksoft.Unity;
  4. using Cksoft.Unity.Log4NetConfig;
  5. using DllEapDal;
  6. using DllEapEntity;
  7. using DllEapEntity.Dtos;
  8. using Microsoft.AspNetCore.Authorization;
  9. using Microsoft.AspNetCore.Mvc;
  10. using System;
  11. using System.Collections.Generic;
  12. using System.Linq;
  13. using System.Text;
  14. namespace WebApplet.Controllers
  15. {
  16. [Route("eap/api/[controller]/[action]")]
  17. //[Authorize]
  18. public class FactoryRegionController : ControllerBase
  19. {
  20. [HttpGet]
  21. public IEnumerable<TreeSelectDto> GetRegionTreeSelect(int id)
  22. {
  23. using (IDatabase db = DbFactory.Base("eapslave"))
  24. {
  25. db.BeginTrans();
  26. var dal = new FactoryRegionDal(db);
  27. string errorinfo = string.Empty;
  28. var roles = dal.GetRegionTreeSelect(id, ref errorinfo);
  29. return roles;
  30. }
  31. }
  32. }
  33. }