public static bool InsertRoomType(RoomTypeDTO roomType) { if (RoomTypeDAO.CheckRoomTypeID(roomType.RoomTypeID)) { return(false); } return(RoomTypeDAO.InsertRoomType(roomType)); }
public IActionResult CreateRoomType(int roomStyleId, int roomSizeId, int price, string description) { if (!RoomTypeDAO.CheckIsExistRoomTypeByStyleIdAndSizeId(roomStyleId, roomSizeId)) { RoomTypeDAO.InsertRoomType(roomStyleId, roomSizeId, price, description); return(Json(price)); } else { RoomTypeDAO.UpdateRoomType(roomStyleId, roomSizeId, price, description); return(Json(price)); } }