Esempio n. 1
0
        public IActionResult UpdateRoom(int roomId, int roomtypeId)
        {
            var room = RoomsDAO.UpdateRoom(new Room()
            {
                RoomID     = roomId,
                Status     = RoomsDAO.GetRoom(roomId).Status,
                RoomTypeID = RoomTypeDAO.GetRoomType(roomtypeId).RoomTypeID
            });

            return(Json(roomId));
        }
Esempio n. 2
0
 public IActionResult CreateRoom(int roomId, int roomtypeId)
 {
     if (!RoomsDAO.CheckIsExistRoomById(roomId))
     {
         var room = RoomsDAO.InsertRoom(new Room()
         {
             RoomID     = roomId,
             Status     = RoomStatuses.Empty,
             RoomTypeID = RoomTypeDAO.GetRoomType(roomtypeId).RoomTypeID
         });
         return(Json(roomId));
     }
     else
     {
         return(Json(null));
     }
 }
Esempio n. 3
0
        /// <summary>
        /// 查询所有未被使用的房间类型(删除用到)
        /// </summary>
        /// <returns></returns>
        public string GetRoomType()
        {
            JSONHelper jsonHelp = new JSONHelper();

            jsonHelp.success = true;
            DataSet ds = rtd.GetRoomType();

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                jsonHelp.AddItem("TypeId", dr["TypeId"].ToString());
                jsonHelp.AddItem("TypeName", dr["TypeName"].ToString());
                jsonHelp.ItemOk();
            }
            string str = jsonHelp.ToString();

            return(str);
        }