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.
108 lines
3.1 KiB
108 lines
3.1 KiB
using EasyBL;
|
|
using EasyBL.WebApi;
|
|
using EasyBL.WebApi.Common;
|
|
using EasyBL.WebApi.Filters;
|
|
using EasyBL.WebApi.Message;
|
|
using EasyBL.WEBAPP;
|
|
using EasyBL.WEBAPP.SYS;
|
|
using Entity.ShowEasyDtos;
|
|
using Entity.Sugar;
|
|
using Entity.ViewModels;
|
|
using Newtonsoft.Json;
|
|
using SqlSugar.Base;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Net;
|
|
using System.Net.Http;
|
|
using System.Web;
|
|
using System.Web.Http;
|
|
|
|
namespace WebApp.Controllers
|
|
{
|
|
public class BookingController : ApiController
|
|
{
|
|
|
|
/// <summary>
|
|
/// 獲取類別數據
|
|
/// </summary>
|
|
/// <param name="argumentClassID"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
public HttpResponseMessage GetArgumentClassList(string argumentClassID)
|
|
{
|
|
return new BookingService().GetArgumentClassList(argumentClassID);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 獲取類別數據
|
|
/// </summary>
|
|
/// <param name="argumentClassID"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
[SEApiSecurityFilter]
|
|
|
|
public HttpResponseMessage GetBookingCategory(string Account, string LangType)
|
|
{
|
|
|
|
var SEToken = SETokenUtil.GetToken(this.Request);
|
|
|
|
return new BookingService().GetBookingCategory(SEToken.Account, LangType);
|
|
}
|
|
|
|
[HttpGet]
|
|
[SEApiSecurityFilter]
|
|
public HttpResponseMessage BookingCardList(
|
|
string Lang,
|
|
string SubCategoryIDs,
|
|
string BookingStatuses,
|
|
string PaymentStatuses)
|
|
{
|
|
|
|
List<string> rsSubCategoryIDs = new List<string>();
|
|
List<string> rsBookingStatuses = new List<string>();
|
|
List<string> rsPaymentStatuses = new List<string>();
|
|
|
|
var SEToken = SETokenUtil.GetToken(this.Request);
|
|
|
|
if (!string.IsNullOrEmpty(SubCategoryIDs))
|
|
{
|
|
rsSubCategoryIDs = JsonConvert.DeserializeObject<List<string>>(SubCategoryIDs);
|
|
}
|
|
|
|
if (!string.IsNullOrEmpty(BookingStatuses))
|
|
{
|
|
rsBookingStatuses = JsonConvert.DeserializeObject<List<string>>(BookingStatuses);
|
|
}
|
|
|
|
if (!string.IsNullOrEmpty(PaymentStatuses))
|
|
{
|
|
rsPaymentStatuses = JsonConvert.DeserializeObject<List<string>>(PaymentStatuses);
|
|
}
|
|
|
|
return new BookingService().GetBookingCardList(SEToken.Account, Lang, rsSubCategoryIDs, rsBookingStatuses, rsPaymentStatuses);
|
|
}
|
|
|
|
[HttpGet]
|
|
[SEApiSecurityFilter]
|
|
public HttpResponseMessage Booking(string Lang, string BookingID, string BookingNo)
|
|
{
|
|
var SEToken = SETokenUtil.GetToken(this.Request);
|
|
|
|
return new BookingService().GetOneDetailBooking(Lang, SEToken.Account, BookingID, BookingNo);
|
|
}
|
|
|
|
[HttpPost]
|
|
[SEApiSecurityFilter]
|
|
public HttpResponseMessage Booking(SETB_SAL_Booking Booking)
|
|
{
|
|
|
|
var SEToken = SETokenUtil.GetToken(this.Request);
|
|
|
|
Booking.OrgID = SEToken.OrgID;
|
|
|
|
return new BookingService().SaveBooking(SEToken.Account, Booking);
|
|
}
|
|
|
|
}
|
|
}
|