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);
                }
            }
        }
Пример #2
0
        // GET: RoomSet
        public ActionResult Index()
        {
            var hotelId = UserContext.CurrentUser.HotelId;
            var model   = RoomSetBll.GetBy(hotelId);

            if (model == null)
            {
                model = new RoomSet()
                {
                    HotelId = hotelId
                }
            }
            ;

            return(View(model));
        }
        public JsonResult GetRoomList(long buildId = 0, long floorId = 0, long roomTypeId = 0, int roomState = 0)
        {
            var hotelId = UserContext.CurrentUser.HotelId;

            var roomSet = RoomSetBll.GetBy(hotelId);

            if (roomSet == null)
            {
                roomSet = RoomSetBll.GetBy(0);
            }



            var roomTypeList = RoomTypeBll.GetList(hotelId);

            if (roomTypeList == null)
            {
                roomTypeList = new List <Model.RoomType>();
            }


            var models = RoomPatternBll.GetList(hotelId, buildId, floorId, roomTypeId, (FjStateEnum)roomState);

            StringBuilder content = new StringBuilder();

            if (models != null && models.Count > 0)
            {
                foreach (var item in models)
                {
                    string background_color = "goldenrod";
                    content.Append($@"

                                <div data_id='{item.Id}' class='room' style='width:{roomSet.RoomWidth}px;height:{roomSet.RoomHeight}px;margin:{roomSet.IconMargin}px;background-color:{background_color}'>
                                <div style='color:{roomSet.RoomNoColor};font-size:{roomSet.RoomNoFontSize}px;'>{item.RoomNO}</div>
                                <div style='margin-top:10px;
									color:{roomSet.RoomTypeColor};font-size:{roomSet.RoomTypeFontSize}px;'>{item.RoomTypeName}</div>
                                    <div style='float: right;position: absolute;bottom: 10px;right:10px;
									color:{roomSet.RoomPriceColor};font-size:{roomSet.RoomPriceFontSize}px;'>{item.Price}</div>
                                </div>");
                }
            }

            return(Json(new { content = content.ToString() }, JsonRequestBehavior.AllowGet));
        }
Пример #4
0
        public JsonResult Edit(RoomSet model)
        {
            var apiResult = new APIResult();

            try
            {
                RoomSetBll.AddOrUpdate(model, UserContext.CurrentUser.HotelId);
            }
            catch (Exception ex)
            {
                apiResult.Ret = -1;
                apiResult.Msg = ex.Message;
                if (!(ex is OperationExceptionFacade))
                {
                    LogFactory.GetLogger().Log(LogLevel.Error, ex);
                }
            }

            return(Json(apiResult));
        }
        // GET: RoomPattern
        public ActionResult Index_old(long buildId = 0, long floorId = 0, long roomTypeId = 0, int roomState = 0)
        {
            var hotelId = UserContext.CurrentUser.HotelId;

            var roomSet = RoomSetBll.GetBy(hotelId);

            if (roomSet == null)
            {
                roomSet = RoomSetBll.GetBy(0);
            }

            var roomTypeList = RoomTypeBll.GetList(hotelId);

            if (roomTypeList == null)
            {
                roomTypeList = new List <Model.RoomType>();
            }

            var models = RoomPatternBll.GetList(hotelId, buildId, floorId, roomTypeId, (FjStateEnum)roomState);

            ViewBag.HotelId      = hotelId;
            ViewBag.RoomSet      = roomSet;
            ViewBag.RoomTypeList = roomTypeList;

            //   StringBuilder content = new StringBuilder();
            //   if (models != null && models.Count > 0)
            //   {
            //       foreach (var item in models)
            //       {
            //           content.Append($@"<div data_id='{item.Id}' class='room' style='width:{roomSet.RoomWidth};height:{roomSet.RoomHeight};margin:{roomSet.IconMargin};'>
            //                       <div style='color:{roomSet.RoomNoColor};font-size:{roomSet.RoomNoFontSize};'>{item.RoomNO}</div>
            //                       <div style='margin-top:10px;
            //color:{roomSet.RoomTypeColor};font-size:{roomSet.RoomTypeFontSize};'>{item.RoomTypeName}</div>
            //                           <div style='float: right;position: absolute;bottom: 10px;right:10px;
            //color:{roomSet.RoomPriceColor};font-size:{roomSet.RoomPriceFontSize};'>{item.Price}</div>
            //                       </div>");
            //       }
            //   }

            return(View(models));
        }
        /// <summary>
        /// 房态里面单个房间的HTML部分
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult _Room(long id)
        {
            var hotelId = UserContext.CurrentUser.HotelId;
            var roomSet = RoomSetBll.GetBy(hotelId);

            if (roomSet == null)
            {
                roomSet = RoomSetBll.GetBy(0);
            }


            var today = Convert.ToDateTime(DateTime.Now.ToShortDateString());

            var item = RoomBll.GetById(id);

            if (item.RoomRegId != 0)
            {
                item.RoomReg = roomRegs.Where(a => a.Id == item.RoomRegId).FirstOrDefault();
            }
            LoadRoomInfo(item);
            return(View(item));
        }