【正文】
是珠寶首飾銷售管理系統(tǒng)的功能之一主要包括進(jìn)貨登記、進(jìn)貨查詢等基本操作。 管理自己的用戶信息 錯誤 !未找到引用源。 printf(\n Notice:Name of file can39。 /*如顧客沒有輸入,則循環(huán)提示顧客輸入 */ while(*DataFile == (39。t exceed 8 characters,suffix can39。/*a+:當(dāng)文件存在時,追加,當(dāng)文件不存在時,創(chuàng)建 */ /*如果當(dāng)前文件不存在,提示打開文件失敗 */ if (fp == NULL) { printf(\n Open file %s fail!End with any key.\n,DataFile)。 } /*如果成功打開或創(chuàng)建文件,則提示輸入商品序號、名稱、價格要素等相關(guān)信息 */ printf(input number,name and is 0 means input is end.\n)。 means end input.\n)。 if ( == 0 ) break。 華科學(xué)院數(shù)據(jù)庫課程設(shè)計 19 scanf(%f,amp。)。TmpS,sizeof(product),1,fp)!=1) { printf(\nwrite file %s fail!End with any key\n,DataFile)。 } count++。*/ printf(The data you input is store successful %s in file.\n,DataFile)。 perror(Open file fail)。 while(fread(amp。 user Show。 /*計算可輸入數(shù)據(jù)的最大范圍 */ fp = fopen(DataFile,ab+)。 exit(1)。number =039。)。 printf(ps=)。)。 perror(Write file fail )。 } /*如果輸入的數(shù)據(jù)量超過最大允許的范圍,則提示數(shù)據(jù)不能錄入 */ if (countSIZE) printf(\nsorry,number of data can not exceed%d\n,SIZE)。 fp=fopen(DataFile,rb)。 exit(1)。 } fclose(fp)。 printf(| Wele to Product Management System |\n)。 printf(| 2. AddProduct() |\n)。 printf(| 6. ModifyByProductNumber() |\n)。 printf(| () |\n)。 printf(| () |\n)。 printf( Please Input Your Choose \n)。 printf(\n)。 /*根據(jù)客戶選項(xiàng)調(diào)用相應(yīng)函數(shù) */ switch(choice) { case 1: CreatFile()。 case 3: DelRecord()。 case 5: QueryBySeatNum()。 case 7: SortByMemberPrice()。 case 12: AddUser()。 case 14: ModifyByUserNumber()。 case 0: exit(0)。 /*定義進(jìn)行操作時存放結(jié)構(gòu)體變量的 */ char DataFile[40] = 。t exceed 8 can39。\039。t exceed 3 of exceed will be discarded.\n)。 perror(Open file fail)。 printf(Number is not exceed 9 figures,Name is not exceed 20 characters,range of grade:~\n)。 printf(number=)。 /*提示輸入商品名稱 */ printf(name=)。)。 /*用公式自動計算會員價 */ =*。 perror(Write file fail )。 } /*如果輸入的數(shù)據(jù)量超過最大允許的范圍,則提示數(shù)據(jù)不能錄入 */ if (countSIZE) printf(\nsorry,number of data can not exceed%d\n,SIZE)。 printf(Content as follow:\n)。 getch()。TmpS,sizeof(product),1,fp) != (int)NULL) { 、 printf(\n%ld\t%s\t%\t%\t\t%\n,Tmp)。 user TmpS。 /*如果當(dāng)前文件不存在,提示打開文件失敗 */ if (fp == NULL) { printf(\n Open file %s fail!End with any key.\n,DataFile)。 } /*如果成功打開文件, 則提示輸入序號、用戶名、密碼、權(quán)限等相關(guān)信息 */ printf(input number,name and is 0 means input is end.\n)。 means end input.\n)。 if ( == 0 ) break。 scanf(%s,)。 printf(\n)。 getch()。 fclose(fp)。 if (fp == NULL) { printf(\nOpen file%sfail!End with any key \n,DataFile)。 } printf(\nNumber\tName\tps\tpower\n)。 } /* :刪除商品信息記錄 */ include void DelRecord() { int i,j,k。/*SIZE,在 頭文件中定義的常量,值為 100 */ int recNumber。 gets(DataFile)。 gets(DataFile)。 getch()。 scanf(%ld,amp。 while((fread(amp。 s[recNumber].discount = 。 /*====將刪除后的剩余結(jié)構(gòu)體記錄寫入文件 ====*/ fp=fopen(DataFile,wb+)。 exit(1)。s[i],sizeof(product),1,fp)!=1) { printf(\nWrite file %s fail!end with anykey.\n,DataFile)。 } } fclose(fp)。 getch()。 while(fread(amp。 next=getche()。 if ( next ==39。) goto begin。 user s[SIZE]。/*====fp 指針指向存儲數(shù)據(jù)的文件名 ====*/ begin: fp=fopen(DataFile,rb)。 exit(1)。delnum)。TmpS,sizeof(user),1,fp)) != (int)NULL) { if(!=delnum) { s[recNumber].Number = 。 recNumber++。 if (fp == NULL) { printf(\nSet up file %sfail !end with anykey.\n,DataFile)。 } 華科學(xué)院數(shù)據(jù)庫課程設(shè)計 31 for(i