Пример #1
0
int Schedule_UI_Delete(int id){

	int ret=0,sid;
       	char choice;
	schedule_t data;
	studio_t sdata;	
	
	if(Schedule_Srv_FetchByID(id, &data)){
		
		while(1){ 

				system("clear");
				printf("\n\n\n\t\t		=================================================================");
        			printf("\n\t\t		***************************删除演出计划****************************");
          			printf("\n\t\t		=================================================================");
       				printf("\n\t\t\t\t%-3s  %-10s %-12s %-10s %-10s %-8s", "ID", "剧目编号", "演出厅编号",
				 "上映日期","上映时间","票价");
				printf("\n\t\t		-----------------------------------------------------------------");
					printf("%-3d 『%d』『%d』", data.id, data.play_id,data.studio_id);
					printf(" %4d-%2d-%2d",data.date.year,data.date.month, data.date.day);
					printf(" %4d:%02d:00", data.time.hour, data.time.minute);
					printf(" %-4d", data.price);
                		printf("\n\t\t		=================================================================");     	
       				printf("\n\t\t		|          [D]elete              |            [R]eturn=         |");
       				printf("\n\t\t		================================================================");
       				printf("\n\t\t		Iput Your choice:");
				choice=l_getc();
				if('r'==choice || 'R'==choice) break;	
				
				if('q'==choice || 'Q'==choice){
					
					if(Schedule_Srv_DeleteByID(id)){
					
						printf("\n\t\t		--------------------------删除计划成功!----------------------------");
						printf("\n\t\t		******************************************************************");
						ret=1;
					}else{
						printf("\n\t\t		--------------------------删除计划失败!----------------------------");
						printf("\n\t\t		******************************************************************");
					}
				sleep(1);
				}
	
		}//while
	}else{
		printf("\n\t\t                      **没有演出计划!按任意键继续修改**");
		sleep(1);
        return 0;
	}
       return ret;
}
Пример #2
0
void Schedule_UI_Delete(int choice)
{
 Schedule_Srv_DeleteByID(choice);
    
}