예제 #1
0
파일: CDManager.c 프로젝트: jowishu/BLPv4
int main()
{
	MYSQL conn;
	MYSQL_RES *res_ptr;
	MYSQL_ROW sql_row;

	mysql_init(&conn);
	if(mysql_real_connect(&conn, "localhost", "jow", "ishu0302", "CDmanagement", 0, NULL, 0))
	{
		show_menu("Oops", char **menu);
		char ch;
		ch = getchar();
		while (ch != 'q')
		{
			switch(ch)
			{
				case 'a':
					add_cd(conn);
					break;
				case 'f':
					find_cd_by_title(conn);
					break;
				case 'c':
					count_cds(conn);
					break;
				default:
					printf("Select error, se;ect again\n");
					break;
			}
			ch = getchar();
			show_menu("Ops", char **menu);
		}
	}
예제 #2
0
파일: app.c 프로젝트: hemiao3000/code
int main()
{
	int choice;
	initscr();

	do {
		choice = getchoice("Options:", current_cd[0] ? extended_menu : main_menu);
		switch (choice) {
			case 'q':
				break;
			case 'a':
				add_record();
				break;
			case 'c':
				count_cds();
				break;
			case 'f':
				find_cd();
				break;
			case 'l':
				break;
			case 'u':
				break;
		}		

	} while (choice != 'q');

	endwin();
	exit(0);
}
예제 #3
0
int main()
{
	int choice;
	initscr();
	do {
		choice = getchoice("Options:",
							current_cd[0] ? extended_menu : main_menu);
		switch(choice) {
		case 'q':
			break;
		case 'a':
			add_record();
			break;
		case 'c':
			count_cds();
			break;
		case 'f':
			find_cd();
			break;
		case 'l':
			list_tracks();
			break;
		case 'r':
			remove_cd();
			break;
		case 'u':
			update_cd();
			break;
		}
	} while(choice != 'q');
	endwin();
	exit(EXIT_SUCCESS);
}
예제 #4
0
int main(int argc, const char *argv[])
{
  
  int choice;

  initscr();

  do {
    choice = getchoice("Options:", current_cd[0] ? extended_menu : main_menu);

    switch (choice) {
      case 'q':
        break;

      case 'a':
        add_record();
        break;

      case 'c':
        count_cds();
        break;

      case 'f':
        find_cd();
        break;

      case 'l':
        list_tracks();
        break;

      case 'r':
        remove_cd();
        break;

      case 'u':
        update_cd();
        break;
    }
  } while (choice != 'q');

  endwin();
  return 0;
}