You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

117 lines
3.3 KiB

  1. using EasyBL.WebApi.Filters;
  2. using EasyBL.WebApi.Message;
  3. using EasyBL.WEBAPP.SYS;
  4. using Entity.ShowEasyDtos;
  5. using Entity.Sugar;
  6. using Newtonsoft.Json;
  7. using System;
  8. using System.Collections.Generic;
  9. using System.Linq;
  10. using System.Net;
  11. using System.Net.Http;
  12. using System.Web.Http;
  13. namespace WebApp.Controllers
  14. {
  15. public class ExhibitionController : ApiController
  16. {
  17. [HttpGet]
  18. public HttpResponseMessage Statuses(string Lang)
  19. {
  20. return new ExhibitionService().GetStatusList(Lang);
  21. }
  22. [HttpGet]
  23. public HttpResponseMessage Exhibitions(
  24. string Lang,
  25. string RegionIDs,
  26. string CountryIDs,
  27. string CityIDs,
  28. string MainCategoryIDs,
  29. string SubCategoryIDs,
  30. string Status,
  31. string Date )
  32. {
  33. List<string> rsRegionIDs = new List<string>();
  34. List<string> rsCountryIDs = new List<string>();
  35. List<string> rsCityIDs = new List<string>();
  36. List<string> rsMainCategoryIDs = new List<string>();
  37. List<string> rsSubCategoryIDs = new List<string>();
  38. List<string> rsStatus = new List<string>();
  39. if (!string.IsNullOrEmpty(RegionIDs)) {
  40. rsRegionIDs = JsonConvert.DeserializeObject<List<string>>(RegionIDs);
  41. }
  42. if (!string.IsNullOrEmpty(CountryIDs))
  43. {
  44. rsCountryIDs = JsonConvert.DeserializeObject<List<string>>(CountryIDs);
  45. }
  46. if (!string.IsNullOrEmpty(CityIDs))
  47. {
  48. rsCityIDs = JsonConvert.DeserializeObject<List<string>>(CityIDs);
  49. }
  50. if (!string.IsNullOrEmpty(MainCategoryIDs))
  51. {
  52. rsMainCategoryIDs = JsonConvert.DeserializeObject<List<string>>(MainCategoryIDs);
  53. }
  54. if (!string.IsNullOrEmpty(SubCategoryIDs))
  55. {
  56. rsSubCategoryIDs = JsonConvert.DeserializeObject<List<string>>(SubCategoryIDs);
  57. }
  58. if (!string.IsNullOrEmpty(Status))
  59. {
  60. rsStatus = JsonConvert.DeserializeObject<List<string>>(Status);
  61. }
  62. return new ExhibitionService().GetExhibitionList(Lang, rsRegionIDs, rsCountryIDs, rsCityIDs, rsMainCategoryIDs, rsSubCategoryIDs, rsStatus, Date);
  63. }
  64. [HttpGet]
  65. public HttpResponseMessage Exhibition(string Lang, string ExhibitionID)
  66. {
  67. return new ExhibitionService().GetOneExhibition(Lang, ExhibitionID);
  68. }
  69. [HttpGet]
  70. public HttpResponseMessage Info(string Lang, string ExhibitionID, string Year)
  71. {
  72. return new ExhibInfoService().GetOneExhibInfo(Lang, ExhibitionID, Year);
  73. }
  74. [HttpGet]
  75. public HttpResponseMessage Statistics(string Lang, string ExhibitionID)
  76. {
  77. return new ExhibStatService().GetExhibStatisticsList(Lang, ExhibitionID);
  78. }
  79. [HttpGet]
  80. public HttpResponseMessage Media(string Lang, string ExhibitionID, string Type)
  81. {
  82. return new ExhibMediaService().GetMediaList(Lang, ExhibitionID, Type);
  83. }
  84. [HttpGet]
  85. public HttpResponseMessage Files(string ExhibitionID)
  86. {
  87. return new ExhibMediaService().GetMediaFileList(ExhibitionID);
  88. }
  89. }
  90. }