{
cout<<"为"<<p->next->name<<"办理订票手续"<<endl;
Al_Custom *pnew=new Al_Custom;
pnew->count=p->next->count;
flight[index].rest-=p->next->count;
strcpy(pnew->name,p->next->name);
do{
cout<<"请"<<p->next->name<<"输入所需要的舱位等级(1-3):";
cin>>pnew->level;
}while(pnew->level<1 || pnew->level>3);
pnew->next=flight[index].Al_link->next;
flight[index].Al_link->next=pnew;
Wait_Custom *q=p->next;
p->next=q->next;
if(flight[index].wait_queue.rear==q)
flight[index].wait_queue.rear=p;
delete q;
}
}
}
void dingpiao()//承办订票业务子模块
{
char no[10];//航班号
int count;//订票量
cout<<"请输入航班号和订票数额:";
cin>>no>>count;
int index=findbyno(no);
if(index==-1)
{
cout<<"该航线不存在"<<endl;
return ;
}
if(flight[index].rest>=count)//尚有余票
{
Al_Custom *pnew=new Al_Custom;
cout<<"请输入您的姓名:";
cin>>pnew->name;
cout<<"请输入您要订的舱位等级:";
cin>>pnew->level;
pnew->count=count;
pnew->next=0;
flight[index].rest-=count;
pnew->next=flight[index].Al_link->next;
flight[index].Al_link->next=pnew;
}
else//没有余票
{
cout<<"该航班的余票额不能满足您的要求,是否排队候补(y/n):";
cout.flush();
char select;
do{
select=getch();
}while(select!='y' && select!='n');
if(select=='y')//排队候补
{
Wait_Custom *pnew=new Wait_Custom;
cout<<endl;
cout<<"请输入您的姓名:";
cin>>pnew->name;
pnew->count=count;
pnew->next=0;
flight[index].wait_queue.rear->next=pnew;
flight[index].wait_queue.rear=pnew;
cout<<flight[index].wait_queue.rear->name<<endl;
}
else
{
}
}
}
void tuipiao()//承办退票业务子模块
{
cout<<"请输入您的姓名:";
char name[15];
cin>>name;
cout<<"请输入你要退票的航班号与飞行周日:";
int week;
char no[10];
cin>>no>>week;
bool isfind=false;
for(int index=0;index<flight_no;index++)
{
if(flight[index].week==week && strcmp(flight[index].flight_no,no)==0)
{
&