初始化项目

This commit is contained in:
2025-11-20 09:50:21 +08:00
commit 94b24e1a5d
4209 changed files with 1570805 additions and 0 deletions

View File

@@ -0,0 +1,58 @@
using Services.Cache;
using Services.Manager;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Newtonsoft.Json;
using Models.ModelItems;
using Services.Extensions;
namespace UI.Controllers
{
public class HotelController : BaseController
{
public HotelController()
{
base.ViewBag.Select = 3;
}
// GET: Hotel
public ActionResult Index(int id)
{
try
{
HotelGroups hotelGroups = CacheHelp.cacheHoteldGroups.FirstOrDefault(x=>x.Id == id);
if(hotelGroups == null)
throw new CustomException("无酒店组信息!");
ViewBag.SelHoteldGroup = id;
var data = CacheHelp.cacheHoteldGroups.Where(x => x.ParentId == id).ToList();
data.Insert(0,hotelGroups);
ViewBag.DataGroups = JsonConvert.SerializeObject(data);
ViewBag.Data = JsonConvert.SerializeObject(
CacheHelp.cacheHotels.Where(x=> data.FirstOrDefault(y=>y.Id == x.GroupId)!=null ).GroupBy(x=>x.GroupId).ToList());
ViewBag.HoteldGroupName = hotelGroups.Name;
return View();
}
catch (Exception ex)
{
LogHelp.WriteExceptionLog(ex);
HttpContext.Response.StatusCode = 500;
return null;
}
}
public ActionResult Hotellist()
{
return View();
}
[HttpPost]
/// <summary>
/// 查看酒店 下方人员信息
/// </summary>
/// <returns></returns>
public ActionResult HotelInfo()
{
return Json(HotelServer.FindUserinfo());
}
}
}