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.
 
 
 
 
 

241 lines
7.1 KiB

using EasyBL.WebApi.Filters;
using EasyBL.WebApi.Message;
using EasyBL.WEBAPP.SYS;
using Entity.ShowEasyDtos;
using Entity.Sugar;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
namespace WebApp.Controllers
{
public class ExhibitionController : ApiController
{
[HttpGet]
public HttpResponseMessage Statuses(string Lang)
{
return new ExhibitionService().GetStatusList(Lang);
}
[HttpGet]
public HttpResponseMessage Exhibitions(
string Lang,
string RegionIDs,
string CountryIDs,
string CityIDs,
string MainCategoryIDs,
string SubCategoryIDs,
string Status,
string Date )
{
List<string> rsRegionIDs = new List<string>();
List<string> rsCountryIDs = new List<string>();
List<string> rsCityIDs = new List<string>();
List<string> rsMainCategoryIDs = new List<string>();
List<string> rsSubCategoryIDs = new List<string>();
List<string> rsStatus = new List<string>();
if (!string.IsNullOrEmpty(RegionIDs)) {
rsRegionIDs = JsonConvert.DeserializeObject<List<string>>(RegionIDs);
}
if (!string.IsNullOrEmpty(CountryIDs))
{
rsCountryIDs = JsonConvert.DeserializeObject<List<string>>(CountryIDs);
}
if (!string.IsNullOrEmpty(CityIDs))
{
rsCityIDs = JsonConvert.DeserializeObject<List<string>>(CityIDs);
}
if (!string.IsNullOrEmpty(MainCategoryIDs))
{
rsMainCategoryIDs = JsonConvert.DeserializeObject<List<string>>(MainCategoryIDs);
}
if (!string.IsNullOrEmpty(SubCategoryIDs))
{
rsSubCategoryIDs = JsonConvert.DeserializeObject<List<string>>(SubCategoryIDs);
}
if (!string.IsNullOrEmpty(Status))
{
rsStatus = JsonConvert.DeserializeObject<List<string>>(Status);
}
return new ExhibitionService().GetAllExhibitionList(Lang);
}
[HttpGet]
public HttpResponseMessage Exhibition(string Lang, string ExhibitionID)
{
return new ExhibitionService().GetOneExhibition(Lang, ExhibitionID);
}
[HttpGet]
public HttpResponseMessage Info(string Lang, string ExhibitionID, string Year)
{
return new ExhibInfoService().GetOneExhibInfo(Lang, ExhibitionID, Year);
}
[HttpGet]
public HttpResponseMessage Statistics(string Lang, string ExhibitionID)
{
return new ExhibStatService().GetExhibStatisticsList(Lang, ExhibitionID);
}
[HttpGet]
public HttpResponseMessage Media(string Lang, string ExhibitionID, string Type)
{
return new ExhibMediaService().GetMediaList(Lang, ExhibitionID, Type);
}
[HttpGet]
public HttpResponseMessage Files(string ExhibitionID)
{
return new ExhibMediaService().GetMediaFileList(ExhibitionID);
}
[HttpGet]
public HttpResponseMessage RelatedServices(string Lang, string ExhibitionID)
{
return new ExhibitionService().GetRelatedServiceList(Lang, ExhibitionID);
}
[HttpGet]
public HttpResponseMessage Locations(string Lang)
{
return new ExhibitionService().GetLocationFilterList(Lang);
}
[HttpGet]
public HttpResponseMessage Categories(string Lang)
{
return new ExhibitionService().GetCategoryFilterList(Lang);
}
[HttpGet]
public HttpResponseMessage Cards(
string Lang,
string RegionIDs,
string CountryIDs,
string CityIDs,
string MainCategoryIDs,
string SubCategoryIDs,
string Status,
string Date,
string Sort)
{
List<string> rsRegionIDs = new List<string>();
List<string> rsCountryIDs = new List<string>();
List<string> rsCityIDs = new List<string>();
List<string> rsMainCategoryIDs = new List<string>();
List<string> rsSubCategoryIDs = new List<string>();
List<string> rsStatus = new List<string>();
List<string> rsDate = new List<string>();
if (!string.IsNullOrEmpty(RegionIDs))
{
rsRegionIDs = JsonConvert.DeserializeObject<List<string>>(RegionIDs);
}
if (!string.IsNullOrEmpty(CountryIDs))
{
rsCountryIDs = JsonConvert.DeserializeObject<List<string>>(CountryIDs);
}
if (!string.IsNullOrEmpty(CityIDs))
{
rsCityIDs = JsonConvert.DeserializeObject<List<string>>(CityIDs);
}
if (!string.IsNullOrEmpty(MainCategoryIDs))
{
rsMainCategoryIDs = JsonConvert.DeserializeObject<List<string>>(MainCategoryIDs);
}
if (!string.IsNullOrEmpty(SubCategoryIDs))
{
rsSubCategoryIDs = JsonConvert.DeserializeObject<List<string>>(SubCategoryIDs);
}
if (!string.IsNullOrEmpty(Status))
{
rsStatus = JsonConvert.DeserializeObject<List<string>>(Status);
}
if (!string.IsNullOrEmpty(Date))
{
rsDate = JsonConvert.DeserializeObject<List<string>>(Date);
}
return new ExhibitionService().GetExhibitionCard(Lang, rsRegionIDs, rsCountryIDs, rsCityIDs, rsMainCategoryIDs, rsSubCategoryIDs, rsStatus, rsDate, Sort);
}
[HttpGet]
public HttpResponseMessage Popular(string Lang, int Count)
{
return new ExhibitionService().GetPopularExhibitionList(Lang, Count);
}
[HttpGet]
public HttpResponseMessage PopularCountry(string Lang, int Count)
{
return new ExhibitionService().GetPopularCountry(Lang, Count);
}
[HttpGet]
public HttpResponseMessage PopularCategory(string Lang, int Count)
{
return new ExhibitionService().GetPopularCategory(Lang, Count);
}
[HttpGet]
public HttpResponseMessage CategoryExhibition(string Lang, string IncludeCountryIDs, string ExcludeCountryIDs)
{
List<string> rsIncludeCountryIDs = new List<string>();
List<string> rsExcludeCountryIDs = new List<string>();
if (!string.IsNullOrEmpty(IncludeCountryIDs)) {
rsIncludeCountryIDs = JsonConvert.DeserializeObject<List<string>>(IncludeCountryIDs);
}
if (!string.IsNullOrEmpty(ExcludeCountryIDs))
{
rsExcludeCountryIDs = JsonConvert.DeserializeObject<List<string>>(ExcludeCountryIDs);
}
return new ExhibitionService().GetCategoryExhibition(Lang, rsIncludeCountryIDs, rsExcludeCountryIDs);
}
}
}