     func receiveLogoutMessageNotification(notification: NSNotification) {
         passengers.removeAll()
         passengerTable.reloadData()
-        hasSelectedPassengerCount = 0
     }
     
     @IBAction func checkPassenger(sender:NSButton){
-        if sender.state == NSOnState{
-            hasSelectedPassengerCount += 1
-        }
-        else{
-            hasSelectedPassengerCount -= 1
-        }
-        
-        if hasSelectedPassengerCount > maxSelectedPassengerCount {
-            hasSelectedPassengerCount -= 1
+        if isMaxPassengerNumber(exclude:sender.title) {
             sender.state = NSOffState
             
             for passenger in passengers{

                    break
                }
            }
            //todo 提示乘客超过5个
            return
        }
        
        let notificationCenter = NSNotificationCenter.defaultCenter()
        notificationCenter.postNotificationName(DidSendCheckPassengerMessageNotification, object: sender.title)
    }
    
    func tableView(tableView: NSTableView, rowViewForRow row: Int) -> NSTableRowView? {

    @IBOutlet weak var passengerTable: NSTableView!
    var passengers = [PassengerDTO]()
    let maxSelectedPassengerCount = 5
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        let notificationCenter = NSNotificationCenter.defaultCenter()
        notificationCenter.addObserver(self, selector: #selector(PassengerSelectViewController.receiveLogoutMessageNotification(_:)), name: DidSendLogoutMessageNotification, object: nil)
