コード例 #1
0
        // GET: Rooms/Create
        public ActionResult Create()
        {
            var userName = User.Identity.GetUserName();

            ViewBag.roomtypeId = new SelectList(_roomTypeService.GetRoomTypes(), "roomtypeId", "Type");
            ViewBag.BuildingId = new SelectList(_buildingService.GetBuildings().Where(x => x.OwnerEmail == userName), "BuildingId", "BuildingName");
            return(View());
        }
コード例 #2
0
        public ActionResult AddRoom()
        {
            var typeMsg     = "";
            var blockMsg    = "";
            var types       = _roomTypeService.GetRoomTypes();
            var hotelBlocks = _hotelBlockService.GetAll();

            typeMsg          = !types.Any() ? "يجب إضافة نوع غرفة" :"";
            blockMsg         = !hotelBlocks.Any() ? "يجب إضافة كتلة بنائية " : "";
            ViewBag.blockMsg = blockMsg;
            ViewBag.typeMsg  = typeMsg;
            return(View());
        }
コード例 #3
0
        public bool ChceckPoeple(int roomTypeId, int numberOfPeopl)
        {
            var recuredNumber = (from rt in _roomTypeService.GetRoomTypes()
                                 where rt.roomtypeId == roomTypeId
                                 select rt.NumOfRooms).FirstOrDefault();

            if (recuredNumber >= numberOfPeopl)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #4
0
        public List <C_RoomType> GetRoomTypes()
        {
            if (_cachedRoomTypes != null)
            {
                return(_cachedRoomTypes);
            }

            return(_cachedRoomTypes = _roomTypeService.GetRoomTypes());
        }
コード例 #5
0
        public IActionResult Index()
        {
            var roomTypes = IRoomTypeService.GetRoomTypes().ToList();

            return(View(roomTypes));
        }
コード例 #6
0
 public ActionResult getall()
 {
     return(View(_roomTypeService.GetRoomTypes()));
 }
コード例 #7
0
 // GET: RoomType
 public ActionResult Index()
 {
     return(View(_roomTypeService.GetRoomTypes()));
 }
コード例 #8
0
 public async Task <IActionResult> Get()
 {
     return(Ok(await _roomTypeService.GetRoomTypes()));
 }