public ActionResult GetFullData(long[] RoomIds) { var hotelId = UserContext.CurrentUser.HotelId; if (RoomIds.Length > 0) { return(GetFullData2(RoomIds)); } var rooms = new List <object>(); foreach (var RoomId in RoomIds) { var item = RoomBll.GetById(RoomId); if (item.RoomRegId != 0) { item.RoomReg = RoomRegBll.GetById(item.RoomRegId); } LoadRoomInfo(item); // var sroom = RoomToSRoom(item); rooms.Add(RoomToSRoom(item)); } return(Content(JsonConvert.SerializeObject(new { Rooms = rooms }))); }
private void PreLoadFTData() { var hotelId = UserContext.CurrentUser.HotelId; if (!_ft_isLoaded) { _ft_isLoaded = true; _ft_rooms = RoomBll.GetListBy(hotelId); _ft_roomregs = RoomRegBll.GetListByHotelId(hotelId); _ft_members = MemberBll.GetList(hotelId); _ft_membersType = MemberTypeBll.GetList(hotelId); _ft_RoomRegGuestInfoCN = RoomRegGuestInfoCNBll.GetListByHotelId(hotelId); _ft_RoomRegGuestInfoEN = RoomRegGuestInfoENBll.GetListByHotelId(hotelId); _ft_MaterialLease = MaterialLeaseBll.GetListByHotel(hotelId); _ft_RoomType = RoomTypeBll.GetListByHotelId(hotelId); _ft_RoomYdRecord = RoomYdRecordBll.GetListByHotel(hotelId); _ft_GlobalFeeSet = GlobalFeeSetBll.GetByHotelId(hotelId); _ft_MaintainRoom = MaintainRoomBll.GetListByHotelId(hotelId); _ft_RoomSelfuse = RoomSelfBll.GetListByHotelId(hotelId); _ft_RoomYD = RoomYdBll.GetListByHotel(hotelId); _ft_RoomSet = RoomSetBll.GetBy(hotelId); if (_ft_RoomSet == null) { _ft_RoomSet = RoomSetBll.GetBy(0); } } }
/// <summary> /// 选择特邀说明 /// </summary> /// <param name="roomId"></param> /// <returns></returns> public ActionResult _SelTysm(long roomRegId) { var tysmList = new List <Tysm>(); tysmList = TysmBll.GetList(UserContext.CurrentUser.HotelId); if (tysmList == null) { tysmList = new List <Tysm>(); } if (tysmList.Count > 0) { var roomReg = RoomRegBll.GetById(roomRegId); if (roomReg != null) { string tysmids = roomReg.TysmIds; if (!string.IsNullOrWhiteSpace(tysmids)) { var tysmidArr = tysmids.Replace(',', ',').Split(','); foreach (var tysmid in tysmidArr) { tysmList.ForEach(m => { if (m.Id.ToString() == tysmid) { m.IsCheck = true; } }); } } } } return(View(tysmList)); }
/// <summary> /// 房间留言 /// </summary> /// <param name="roomId"></param> /// <returns></returns> public ActionResult _SelMessage(long roomId) { var hotelId = UserContext.CurrentUser.HotelId; ViewBag.HotelId = hotelId; ViewBag.RoomId = roomId; var room = RoomBll.GetById(roomId); if (room != null) { var msg = RoomBll.GetMessage(roomId); if (msg == null) { msg = new RoomMessage(); } ViewBag.Message = msg; ViewBag.RoomRegId = room.RoomRegId; ViewBag.Room = room; ViewBag.RoomReg = RoomRegBll.GetById(room.RoomRegId); } else { ViewBag.Message = new RoomMessage(); ViewBag.Room = new Hotel.Model.Room(); ViewBag.RoomRegId = 0; ViewBag.RoomReg = new Hotel.Model.RoomReg(); } return(View()); }
public ActionResult ChangeRoom(long roomId, long roomRegId = 0) { var hotelId = UserContext.CurrentUser.HotelId; if (roomRegId != 0) { ViewBag.RoomRegId = roomRegId; var rg = RoomRegBll.GetById(roomRegId); ViewBag.RoomId = rg.RoomId; } else { ViewBag.RoomId = roomId; var model = RoomBll.GetById(roomId); if (model == null) { model = new Room(); } ViewBag.RoomRegId = model.RoomRegId; } return(View(UserContext.CurrentUser)); }
/// <summary> /// 新增/编辑 /// </summary> /// <returns></returns> public ActionResult Edit(long id, string GuestType = nameof(GuestInfoCN)) { GuestInfoCN infoCN = null; GuestInfoEN infoEN = null; var hotelId = UserContext.CurrentUser.HotelId; if (id == 0) { return(View()); } else { switch (GuestType) { case nameof(GuestInfoCN): infoCN = GuestInfoCNBll.SingleOrDefault(id); if (infoCN != null) { List <Model.RoomReg> rrData = RoomRegBll.GetListBySql(GuestType, hotelId.ToString(), "GuestInfoId", infoCN.Id.ToString()); if (rrData != null) { infoCN.RzCount = rrData.Count; infoCN.LjRzCount = rrData.Sum(t => t.RuzhuDays); infoCN.LsXfPrice = rrData.Sum(t => t.Yszk); } else { infoCN.RzCount = 0; infoCN.LjRzCount = 0; infoCN.LsXfPrice = 0; } } break; case nameof(GuestInfoEN): infoEN = GuestInfoENBll.SingleOrDefault(id); if (infoEN != null) { List <Model.RoomReg> rrData2 = RoomRegBll.GetListBySql(GuestType, hotelId.ToString(), "GuestInfoId", infoEN.Id.ToString()); if (rrData2 != null) { infoEN.RzCount = rrData2.Count; infoEN.LjRzCount = rrData2.Sum(t => t.RuzhuDays); infoEN.LsXfPrice = rrData2.Sum(t => t.Yszk); } else { infoEN.RzCount = 0; infoEN.LjRzCount = 0; infoEN.LsXfPrice = 0; } } break; } } ViewBag.infoCN = infoCN; ViewBag.infoEN = infoEN; return(View()); }
public ActionResult GetRoomShowData(long roomId) { var apiResult = new APIResult(); var hotelId = UserContext.CurrentUser.HotelId; try { var item = RoomBll.GetById(roomId); if (item.RoomRegId != 0) { item.RoomReg = RoomRegBll.GetById(item.RoomRegId); } LoadRoomInfo(item); return(Json(RoomToSRoom(item))); } catch (Exception ex) { apiResult.Ret = -1; apiResult.Msg = ex.Message; if (!(ex is OperationExceptionFacade)) { LogFactory.GetLogger().Log(LogLevel.Error, ex); } } return(Json(apiResult)); }
/// <summary> /// 获取房单列表 /// </summary> /// <param name="roomNO">房号</param> /// <param name="name">客人姓名</param> /// <param name="customerType">客人类型</param> /// <param name="rzlx">入住类型</param> /// <param name="sddsj">开始抵店时间</param> /// <param name="eddsj">结束抵店时间</param> /// <param name="sldsj">开始离店时间</param> /// <param name="eldsj">结束离店时间</param> /// <param name="yudNum">预订号</param> /// <param name="agreeComp">协议单位</param> /// <param name="tel">手机号</param> /// <param name="cph">车牌号</param> /// <returns></returns> public string GetFdList(int page, int rows, string roomNO = "", string name = "", int customerType = 0, int rzlx = 0, string sddsj = "", string eddsj = "", string sldsj = "", string eldsj = "", string yudNum = "", string agreeComp = "", string tel = "", string cph = "") { var datas = RoomRegBll.GetFdList(page, rows, roomNO, name, customerType, rzlx, sddsj, eddsj, sldsj, eldsj, yudNum, agreeComp, tel, cph); return(JsonConvert.SerializeObject(datas)); }
public string GetJztfPager(int page, int rows, string roomNO = "", string name = "", int customerType = 0, int rzlx = 0, string sddsj = "", string eddsj = "", string sldsj = "", string eldsj = "", string yudNum = "", string agreeComp = "", string tel = "", string cph = "") { var datas = RoomRegBll.GetYlwlPager(UserContext.CurrentUser.HotelId, page, rows, roomNO, name, customerType, rzlx, sddsj, eddsj, sldsj, eldsj, yudNum, agreeComp, tel, cph); return(JsonConvert.SerializeObject(datas)); }
/// <summary> /// 历史入住搜索 /// </summary> /// <param name="page"></param> /// <param name="rows"></param> /// <param name="key"></param> /// <param name="value"></param> /// <param name="type">GuestInfoCN,GuestInfoEN</param> /// <returns></returns> public string Search(int page, int rows, string key, string value, string type) { var hotelId = UserContext.CurrentUser.HotelId; //倒推-->guest_info_cn.ID-->Room_Reg_Guest_Info_CN.GuestInfoID---->RoomReg var datas = RoomRegBll.Page(page, rows, RoomRegBll.GetCommonSql(type, hotelId.ToString(), "GuestInfoId", value)); List <Model.RoomReg> items = new List <Model.RoomReg>(); if (datas != null && datas.Items != null) { if (type == nameof(GuestInfoCN)) { GuestInfoCN info = GuestInfoCNBll.SingleOrDefault($" where Id = '{value}'"); foreach (var item in datas.Items) { item.Name = info.Name; item.Sex = info.Sex; item.CertificateTypeName = info.CertificateTypeName; item.CertificateNO = info.CertificateNO; items.Add(item); } } else { GuestInfoEN info = GuestInfoENBll.SingleOrDefault($" where Id = '{value}'"); foreach (var item in datas.Items) { item.Name = info.FirstName + ' ' + info.LastName; item.Sex = info.Sex; item.CertificateTypeName = info.CertificateTypeName; item.CertificateNO = info.CertificateNO; items.Add(item); } } } return(JsonConvert.SerializeObject(new Pager <Model.RoomReg>() { total = datas.TotalItems, rows = items })); //if (type == nameof(GuestInfoCN)) //{ // var datas = GuestInfoCNRzRecordBll.Page(page, rows, $"where LskrId = {value} "); // var pager = new Pager<Hotel.Model.GuestInfoCNRzRecord>() { total = datas.TotalItems, rows = datas.Items }; // return JsonConvert.SerializeObject(pager); //} //else //{ // var datas = GuestInfoENRzRecordBll.Page(page, rows, $"where LskrId = {value} "); // var pager = new Pager<Hotel.Model.GuestInfoENRzRecord>() { total = datas.TotalItems, rows = datas.Items }; // return JsonConvert.SerializeObject(pager); //} }
public ActionResult Input(long roomRegId) { ViewBag.HotelId = UserContext.CurrentUser.HotelId; ViewBag.RoomRegId = roomRegId; ViewBag.Room = RoomRegBll.GetById(roomRegId); return(View()); }
// GET: RoomRegJfyh public ActionResult Index(long roomRegId, long itemId = 0) { //获取前台优惠限额 var hotelId = UserContext.CurrentUser.HotelId; var roomReg = RoomRegBll.GetById(roomRegId); if (roomReg == null) { return(Content("房间登记数据不存在")); } if (roomReg.CustomerType != 3) { return(Content("登记客人非会员,不可操作")); } if (string.IsNullOrWhiteSpace(roomReg.MemCompId)) { return(Content("房间登记未选择会员")); } var member = MemberBll.GetById(long.Parse(roomReg.MemCompId)); if (member == null) { return(Content("会员不存在")); } var memType = MemberTypeBll.GetById(member.MemberTypeId); if (memType == null) { memType = new MemberType(); } ViewBag.MemberType = memType; if (itemId == 0) { //新增 return(View(new RoomRegJfyh() { HotelId = hotelId, Name = member.Name, Sex = member.Sex, Birth = member.Birth.ToString("yyyy-MM-dd"), RoomRegId = roomRegId, KyExp = (int)member.Exp })); } else { //修改 var model = RoomRegJfyhBll.GetById(itemId); if (model == null) { model = new RoomRegJfyh(); } return(View(model)); } }
public string GetWjldPager(int page, int rows, string roomNO = "", string name = "", int customerType = 0, int rzlx = 0, string sddsj = "", string eddsj = "", string sldsj = "", string eldsj = "", string yudNum = "", string agreeComp = "", string tel = "", string cph = "") { //MessageBox.Show("123"); var datas = RoomRegBll.GetWjldPager(UserContext.CurrentUser.HotelId, page, rows, roomNO, name, customerType, rzlx, sddsj, eddsj, sldsj, eldsj, yudNum, agreeComp, tel, cph); /*var datas = RoomRegBll.GetDrldPager(UserContext.CurrentUser.HotelId, page, rows, roomNO, name, customerType, * rzlx, sddsj, eddsj, sldsj, eldsj, yudNum, agreeComp, tel, cph);*/ return(JsonConvert.SerializeObject(datas)); }
public string GetYjSet(long roomRegId) { var hotelId = UserContext.CurrentUser.HotelId; var roomReg = RoomRegBll.GetById(roomRegId); if (roomReg == null) { return(JsonConvert.SerializeObject(new { code = -1, msg = "房间未登记,不可操作" })); } var model = RoomRegYjBll.GetBy(roomReg.Id); return(JsonConvert.SerializeObject(new { code = 0, data = model })); }
public RoomRegZzwHelp getthis(long roomRegId) { var lflist = new List <Model.RoomReg>(); var treeList = RoomRegBll.GetLfTree(roomRegId, UserContext.CurrentUser.HotelId, ref lflist); var roomReg = new Model.RoomReg(); decimal yszk = 0, yuszk = 0, yjs = 0, zfy = 0, zstk = 0, jy = 0, bfsk = 0; if (treeList.Count > 0) { //roomRegId = long.Parse(treeList[0].id); //获取房间的登记信息 roomReg = RoomRegBll.GetById(roomRegId); if (roomReg != null) { yszk += roomReg.Yszk; yuszk += roomReg.Yuszk; yjs += roomReg.Yjs; zfy += roomReg.Money; zstk += roomReg.Zstk; jy += roomReg.Jy; bfsk += roomReg.YeBfSkMoney + roomReg.FyeBfSkMoney; } ViewBag.RoomReg = roomReg; //获取所有联房的房间的财务汇总 for (var i = 1; i < treeList.Count; i++) { var item = RoomRegBll.GetById(long.Parse(treeList[i].id)); if (item != null) { yszk += item.Yszk; yuszk += item.Yuszk; yjs += item.Yjs; zfy += item.Money; zstk += item.Zstk; jy += item.Jy; bfsk += item.YeBfSkMoney + item.FyeBfSkMoney; } } } RoomRegZzwHelp rrom = new RoomRegZzwHelp() { yszk = yszk, yuszk = yuszk, yjs = yjs, zfy = zfy, zstk = zstk, jy = jy, bfsk = bfsk }; return(rrom); }
public ActionResult IndexYd(long roomRegId) { var roomReg = RoomRegBll.GetById(roomRegId); if (roomReg == null) { roomReg = new Model.RoomReg() { Id = roomRegId } } ; ViewBag.RoomReg = roomReg; ViewBag.HotelId = UserContext.CurrentUser.HotelId; return(View()); }
// GET: Invoice public ActionResult Index(long roomRegId) { var roomReg = RoomRegBll.GetById(roomRegId); if (roomReg == null) { roomReg = new Model.RoomReg(); } var model = new Invoice() { Id = 0, RoomRegId = roomReg.Id, DjdanNum = roomReg.DanJuNum, RoomNO = roomReg.RoomNO }; ViewBag.RoomReg = roomReg; return(View(model)); }
public JsonResult SplitSave(long[] roomRegIds) { var apiResult = new APIResult(); var user = UserContext.CurrentUser; try { RoomRegBll.LfSplit(roomRegIds); } catch (Exception ex) { apiResult.Ret = -1; apiResult.Msg = ex.Message; } return(Json(apiResult)); }
public JsonResult LfGroup(long roomRegId, long[] addRoomRegIds) { var apiResult = new APIResult(); var user = UserContext.CurrentUser; try { RoomRegBll.LfGroup(roomRegId, addRoomRegIds); } catch (Exception ex) { apiResult.Ret = -1; apiResult.Msg = ex.Message; } return(Json(apiResult)); }
// GET: XfCommission public ActionResult Index(long roomRegId) { var roomReg = RoomRegBll.GetById(roomRegId); if (roomReg == null) { roomReg = new Model.RoomReg(); } var model = new XfCommission() { Id = 0, RoomRegId = roomReg.Id, DjdanNum = roomReg.DanJuNum, RoomNO = roomReg.RoomNO }; ViewBag.RoomRegId = roomRegId; ViewBag.HotelId = UserContext.CurrentUser.HotelId;; return(View(model)); }
// GET: RoomRegGoods /// <summary> /// 商品费用只做新增 /// </summary> /// <param name="roomRegId"></param> /// <returns></returns> public ActionResult Index(long roomRegId, long itemId = 0) { if (itemId == 0) { var roomReg = RoomRegBll.GetById(roomRegId); if (roomReg == null) { roomReg = new Model.RoomReg(); } var model = new RoomRegGoods() { Id = 0, RoomRegId = roomRegId, RoomNO = roomReg.RoomNO, Name = roomReg.Name, Sex = roomReg.Sex }; ////绑定商品分类表格 var details = RoomRegGoodsDetailsBll.GetDetails(UserContext.CurrentUser.HotelId); //绑定商品列表 //再生 保命 舍生 灵敏 + 铁壁 反震 //ViewBag.Details = new List<RoomRegGoodsDetails>(); ViewBag.Details = details; return(View(model)); } else { var detail = RoomRegGoodsDetailsBll.SingleOrDefault(itemId); //获取主表数据 var model = new RoomRegGoods(); if (detail != null) { model = RoomRegGoodsBll.SingleOrDefault(detail.ZbId); } if (model == null) { model = new RoomRegGoods(); } //绑定商品分类表格 var details = RoomRegGoodsDetailsBll.GetDetails(UserContext.CurrentUser.HotelId, model.Id); ViewBag.Details = details; return(View(model)); } }
public ActionResult Index2(long roomRegId = 0) { var RoomNO = ""; if (roomRegId != 0) { var room = RoomRegBll.GetById(roomRegId); RoomNO = room.RoomNO; } var model = new RoomRegQtfy() { RoomRegId = roomRegId, RoomNO = RoomNO, FsTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm") }; return(View(model)); }
public string BatchRoomList(int page, int rows, long buildId, long floorId, string roomNO, string changeType) { var models = RoomBll.GetPager(page, rows, UserContext.CurrentUser.HotelId, buildId, floorId, roomNO, changeType); foreach (var item in models.rows) { if (item.RoomRegId != 0) { item.RoomReg = RoomRegBll.GetById(item.RoomRegId); } LoadRoomInfo2(item); } return(JsonConvert.SerializeObject(models)); }
public ActionResult AddLf(long roomRegId, long lfRoomId) { var apiResult = new APIResult(); try { RoomRegBll.AddLf(roomRegId, lfRoomId); } catch (Exception ex) { apiResult.Ret = -1; apiResult.Msg = ex.Message; if (!(ex is OperationExceptionFacade)) { LogFactory.GetLogger().Log(LogLevel.Error, ex); } } return(Json(apiResult)); }
/// <summary> /// 设为主房 /// </summary> /// <returns></returns> public JsonResult LfSetZf(long id) { var apiResult = new APIResult(); var user = UserContext.CurrentUser; try { RoomRegBll.LfSetZf(id); } catch (Exception ex) { apiResult.Ret = -1; apiResult.Msg = ex.Message; if (!(ex is OperationExceptionFacade)) { LogFactory.GetLogger().Log(LogLevel.Error, ex); } } return(Json(apiResult)); }
/// <summary> /// 续住的保存 /// </summary> /// <param name="roomRegId"></param> /// <param name="xzDays"></param> /// <returns></returns> public JsonResult RoomRegXzSave(long roomRegId, int xzDays, string yulitime) { var apiResult = new APIResult(); var user = UserContext.CurrentUser; try { RoomRegBll.RoomRegXzSave(roomRegId, xzDays, yulitime); } catch (Exception ex) { apiResult.Ret = -1; apiResult.Msg = ex.Message; if (!(ex is OperationExceptionFacade)) { LogFactory.GetLogger().Log(LogLevel.Error, ex); } } return(Json(apiResult)); }
/// <summary> /// 续住时获取预离时间 /// </summary> /// <returns></returns> public string GetYlTimeForXz(long roomRegId, int xzDays) { var roomReg = RoomRegBll.GetById(roomRegId); if (roomReg == null) { return(JsonConvert.SerializeObject(new { Ret = -1, Msg = "房间登记数据不存在" })); } if (roomReg.KaiFangFangShi != (int)KaifangFangshiEnum.全天房 && roomReg.KaiFangFangShi != (int)KaifangFangshiEnum.长包房 && roomReg.KaiFangFangShi != (int)KaifangFangshiEnum.免费房) { return(JsonConvert.SerializeObject(new { Ret = -1, Msg = "只有【全天房、长包房、免费房】才可续住" })); } var globalFeeSet = GlobalFeeSetBll.GetByHotelId(UserContext.CurrentUser.HotelId); var now = TypeConvert.IntToDateTime(roomReg.RegTime); if (globalFeeSet == null) { return(JsonConvert.SerializeObject(new { Ret = 0, YlTime = "" })); } var yltime = now; //如果是6点,那么当天6点之后开的房间就是第二天中午退房,0点到6点开房就是当天中午退房 if (now.Hour >= 0 && now.Hour <= globalFeeSet.QTAfterPointToNextDay) { //当天中午退房 yltime = now.Date.AddDays(xzDays - 1).AddHours(globalFeeSet.QTExitPoint); } else { //第二天中午退房 yltime = now.Date.AddDays(1 + (xzDays - 1)).AddHours(globalFeeSet.QTExitPoint); } var yulidate = TypeConvert.IntToDateTime(roomReg.LeaveTime); yltime = yulidate.Date.AddDays(xzDays).AddHours(globalFeeSet.QTExitPoint); return(JsonConvert.SerializeObject(new { Ret = 0, YlTime = yltime.ToString("yyyy-MM-dd HH:mm:ss") })); }
public ActionResult InputBody(long posId, long roomRegId) { ViewBag.HotelId = UserContext.CurrentUser.HotelId; ViewBag.RoomRegId = roomRegId; ViewBag.PosId = posId; ViewBag.HotelId = UserContext.CurrentUser.HotelId; var types = PosCatBll.GetListByPos(posId); ViewBag.Types = types; ViewBag.Room = RoomRegBll.GetById(roomRegId); ViewBag.CurrentOrderNo = PosConsumeBll.GetNewOrderNo(posId); var o = PosConsumeBll.GetById(posId); return(View(new PosConsume() { OrderNo = PosConsumeBll.GetNewOrderNo(posId), OpUserName = UserContext.CurrentUser.UserName, RoomRegId = roomRegId, PosId = posId })); }
public JsonResult RoomRegSave(Model.RoomReg model) { var apiResult = new APIResult(); var user = UserContext.CurrentUser; long backId = 0; try { RoomRegBll.AddOrUpdate(model, user.HotelId, user.Id, user.Name, ref backId); } catch (Exception ex) { apiResult.Ret = -1; apiResult.Msg = ex.Message; if (!(ex is OperationExceptionFacade)) { LogFactory.GetLogger().Log(LogLevel.Error, ex); } } apiResult.ExtData = backId.ToString(); return(Json(apiResult)); }
public string GetRuzhuDaysForXz(long roomRegId, string leaveTime) { var roomReg = RoomRegBll.GetById(roomRegId); if (roomReg == null) { return(JsonConvert.SerializeObject(new { Ret = -1, Msg = "房间登记数据不存在" })); } if (roomReg.KaiFangFangShi != (int)KaifangFangshiEnum.全天房 && roomReg.KaiFangFangShi != (int)KaifangFangshiEnum.长包房 && roomReg.KaiFangFangShi != (int)KaifangFangshiEnum.免费房) { return(JsonConvert.SerializeObject(new { Ret = -1, Msg = "只有【全天房、长包房、免费房】才可续住" })); } var globalFeeSet = GlobalFeeSetBll.GetByHotelId(UserContext.CurrentUser.HotelId); if (globalFeeSet == null) { return(JsonConvert.SerializeObject(new { Ret = 0, YlTime = "" })); } var days = (DateTime.Parse(leaveTime).Date - TypeConvert.IntToDateTime(roomReg.LeaveTime).Date).TotalDays; return(JsonConvert.SerializeObject(new { Ret = 0, RuzhuDays = Convert.ToInt32(days) })); }