/// <summary>
 /// 查找匹配的用户
 /// </summary>
 /// <param name="p"></param>
 /// <returns></returns>
 public Passenger FindMatch(PassengerInTicket p)
 {
     return(FindMatch(p.Name, p.IdType, p.IdNo));
 }
        void AddPassengerToList(PassengerInTicket p)
        {
            //查找联系人
            var row = dgvPassenger.Rows.Cast <DataGridViewRow>().FirstOrDefault(x => x.Tag == p);

            if (row != null)
            {
                return;
            }
            if (dgvPassenger.Rows.Cast <DataGridViewRow>().Count(s => !s.IsNewRow) >= 5)
            {
                this.ShowToast("每个订单中联系人不得超过五位 o(>_<)o ~~", Properties.Resources.warning_16, Color.DarkRed, glowColor: eToastGlowColor.Red);
                return;
            }

            ps.AvailableFilter.Add(p);

            //添加新的
            row                = dgvPassenger.Rows[dgvPassenger.Rows.Add()];
            row.Tag            = p;
            row.Cells[0].Value = p.Name;
            //row.Cells[1].ReadOnly = true;

            //1.车票类型
            var ticketCell = row.Cells[1] as DataGridViewComboBoxCell;

            //ticketCell.Items.Clear();
            //ticketCell.Items.Add(new Entity.TicketType(p.Type));
            if (p.TicketType == 3 && Query.QueryStudentTicket)
            {
                var type = new Entity.TicketType(p.TicketType);
                ticketCell.Items.Clear();
                ticketCell.Items.Add(type);
                ticketCell.Value = 3;
            }
            else
            {
                if (_validTicketTypes != null)
                {
                    ticketCell.Value = p.TicketType;
                }
            }

            //2.席别
            RebindSeatType(row);

            //3.上下铺
            //ReBindSeatSubType(row);

            //4.身份证类型
            row.Cells[4].Value    = p.IdType;
            row.Cells[4].ReadOnly = true;

            row.Cells[5].Value    = p.IdNo;
            row.Cells[5].ReadOnly = true;

            row.Cells[6].Value    = p.Mobile;
            row.Cells[7].ReadOnly = true;

            row.Cells[7].Value    = true;
            row.Cells[7].ReadOnly = true;

            EnsureDgvControlsAvailable();
            CheckOrder();
        }