




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
(服裝銷售管理)語言課程設(shè)計服裝銷售系統(tǒng)(1)系統(tǒng)包含三類用戶:管理員、店長、銷售員。(2)向管理員提供以下功能:自身密碼修改、其他用戶添加刪除、用戶信息修改、統(tǒng)計。商品信息添加、修改、刪除、查找、統(tǒng)計。(3)向店長提供以下功能:登錄、注銷、自身密碼修改、自身信息修改,商品信息修改、息。(4)向銷售員提供以下功能:商品瀏覽、查找、出售,查看自己本日報表、本月報表。2.需求分析用戶與商品信息要采用文件存儲,因而要提供文件的輸入、輸出功能,要實現(xiàn)用戶的添加、修改、刪除,商品信息的添加、修改、刪除、查找等,需要提供相應(yīng)的信息添加、刪除、修改與查找功能;要實現(xiàn)商品瀏覽功能,需要提供顯示操作;另外,還要提供鍵盤式選擇菜單以實現(xiàn)功能選擇。3.總體設(shè)計1.【整體E-R圖3-1】服裝管理管理員店長銷售員退出用戶用戶顯示所退出自身商品營業(yè)密碼商品商品出售查看本信息信息員業(yè)修改瀏覽查找月報表圖3-12.【程序中典型的流程圖】(一)添加模塊(1)分析:信息添加模塊職工的基本信息包括:用戶、商品基本信息,對它們輸入后,要存進(jìn)原文件,流程圖(圖3-2)如下。圖3-2(二)瀏覽模塊(1)分析:瀏覽功能首先需要查找信息是否存在,在查找時,因為磁盤文件無序,所以采用直接查找的辦法。在容錯上有較好的能力,輸錯時系統(tǒng)會有提示,也會作出相應(yīng)的反映。算法和以上的分程序有相同的優(yōu)點(diǎn)。流程圖如下(圖3-3打開文件否開始圖3-3(三)查詢模塊(1)分析:基本信息的查詢按查詢方式:按商品的名稱查詢,可供選擇的方式比較豐富。但本程序只使用了一種。在查詢小模塊中采用了直接查找的方法,這主要是由于磁盤文件無序的緣故。程序在選擇結(jié)構(gòu)上采用了if和else的嵌套形式,看起來有點(diǎn)繁雜(圖3-4)圖3-4(四)刪除模塊(1)分析:商品信息存放在須將該文件全部取出來,在內(nèi)存中把要刪掉的內(nèi)文件打開設(shè)置一個標(biāo)示符,對有這些標(biāo)識符的記錄在下次輸入時跳過,在新商品信息輸入時,將其覆蓋就行了。在對文件進(jìn)行刪除時,慮到很多方面,如:查詢不到時系統(tǒng)該如何處理等。人性化設(shè)計有在刪除之前詢流程圖(圖3-5)如下:查找商圖3-5五)修改模塊(1)分析:修改與刪除程序相似,管理員信息存放在磁盤中,程序須將該可以改進(jìn)(圖2-6)。是否繼續(xù)圖3-64.詳細(xì)設(shè)計是否查找到1.歡迎界面voidWeleMenu()voidWeleMenu(){printf("---------------服裝銷售系統(tǒng)-----------\n");printf("系統(tǒng)功能說明:\n");printf("管理員功能:\n");printf("(1)自身密碼修改\n");printf("(2)用戶信息管理:添加,修改,刪除,查詢\n");printf("(3)商品信息管理:添加,修改,查詢,刪除\n");printf("(4)退出登陸系統(tǒng)\n");printf("店長功能:\n");printf("(1)自身密碼修改\n");printf("(2)商品信息管理:添加,修改,查詢,刪除\n");printf("(3)銷售報表顯示:日銷售報表,月銷售報表,銷售員銷售報表\n");printf("(4)退出登陸系統(tǒng)\n");printf("銷售員功能:\n");printf("(1)商品瀏覽,查詢,商品銷售\n");printf("(2)自己商品銷售報表顯示:日銷售報表,月銷售報表\n");printf("(3)退出登陸系統(tǒng)\n");printf("--------------謝謝使用--------------------\n");printf("(注:管理員,店長,用戶登陸的賬號分別是admin,boss,sell初始密碼和賬號一致)\n");};歡迎界面運(yùn)行如下(圖4-1):圖4-12.登陸模塊voidSystemLogin()函數(shù)voidSystemLogin(){//所有用戶身份調(diào)用的登陸函數(shù)charuserName[20],password[20];intisLogin=0;SystemUser*tmpUser;printf("請輸入你的系統(tǒng)用戶帳號:");scanf("%s",userName);printf("\n請輸入你的系統(tǒng)用戶密碼:");scanf("%s",password);tmpUser=pSystemUserHead;while(NULL!=tmpUser){if(0==strcmp(tmpUser->userName,userName)){if(0==strcmp(tmpUser->password,password)){isLogin=1;strcpy(currentUser,tmpUser->userName);currentUserType=tmpUser->userType;switch(currentUserType){caseADMIN_USER_TYPE:AdminOperationMenu();break;caseBOSS_USER_TYPE:BossOperationMenu();break;caseSELL_USER_TYPE:SellOperationMenu();break;default:break;}}else{printf("對不起,你輸入的密碼錯誤!\n");SystemLogin();//用戶名正確,密碼錯誤}}tmpUser=tmpUser->next;}if(isLogin!=1){printf("對不起,該用戶不存在\n");//遍歷了所有用戶都沒有找到用戶SystemLogin();}}運(yùn)算顯示如下(圖4-2):圖4-23.管理員功能模塊(1)管理員歡迎界面voidAdminOperationMenu()函數(shù)voidAdminOperationMenu(){intselect;while(1){printf("親愛的管理員%s同志,歡迎使用本系統(tǒng),你擁有下面所有功能:\n",currentUser);printf("(1)自身密碼修改\n");printf("(2)用戶信息管理:添加,修改,查詢,刪除\n");printf("(3)商品信息管理:添加,修改,查詢,刪除\n");printf("(4)退出系統(tǒng)\n");printf("請輸入上面功能對應(yīng)的序號進(jìn)行功能選擇:");scanf("%d",&select);switch(select){case1:ChangePassword();continue;case2:UserManage();continue;case3:ProductsManage();Continue;case4:ExitSystem();break;default:break;}}};運(yùn)算顯示如下(圖4-3):圖4-3(2)自身密碼修改(調(diào)用密碼修改函數(shù)ChangePassword();)//密碼修改函數(shù)voidChangePassword(){charnewPassword1[20],newPassword2[20];SystemUser*tmpUser;printf("請輸入你的新密碼:");scanf("%s",newPassword1);printf("請再次輸入你的新密碼:");scanf("%s",newPassword2);if(0!=strcmp(newPassword1,newPassword2)){printf("對不起,你兩次輸入的密碼不一致,修改失敗!\n");return;}tmpUser=pSystemUserHead;while(NULL!=tmpUser){if(0==strcmp(tmpUser->userName,currentUser)){strcpy(tmpUser->password,newPassword1);printf("密碼修改成功!\n");break;}tmpUser=tmpUser->next;}};運(yùn)算顯示如下(圖4-4):圖4-4(2)用戶信息管理:添加,修改,刪除,查詢//用戶信息管理:添加,修改,刪除,查詢//voidUserManage(){//用戶信息函數(shù)//intselect;//管理員顯示模塊//while(1){printf("親愛的管理員%s同志,你目前進(jìn)入的是用戶信息管理功能:\n",currentUser);printf("(1)用戶信息查看\n");printf("(2)用戶信息添加\n");printf("(3)用戶信息修改\n");printf("(4)用戶信息刪除\n");printf("(5)返回上級菜單\n");printf("(6)退出登陸系統(tǒng)\n");printf("請輸入上面功能對應(yīng)的序號進(jìn)行功能選擇:");scanf("%d",&select);switch(select){case1:UserInfoView();//調(diào)用用戶信息查看的函數(shù)//continue;case2:UserInfoAdd();//調(diào)用用戶信息添加函數(shù)//continue;case3:UserInfoModify();//調(diào)用用戶信息修改函數(shù)//continue;case4:UserInfoDelete();//調(diào)用用戶信息刪除函數(shù)//continue;case5:AdminOperationMenu();//返回上級系統(tǒng)//break;case6:ExitSystem();//退出登陸//break;default:break;}}};運(yùn)算顯示如下(圖4-5):圖4-5//用戶信息查看函數(shù)//voidUserInfoView(){SystemUser*tmpUser;tmpUser=pSystemUserHead;printf("親愛的管理員%s,你好,你查看的所有用戶信息如下:\n",currentUser);printf("用戶名\t密碼\t用戶類型(1代表管理員,2代表店長,3代表銷售員)\n");while(NULL!=tmpUser){printf("%s\t%s\t%d\n",tmpUser->userName,tmpUser->password,tmpUser->userType);tmpUser=tmpUser->next;}};運(yùn)算顯示如下(圖4-6)://用戶信息添加函數(shù)//voidUserInfoAdd(){SystemUsertmpUser;printf("親愛的管理員%s,請依次輸入用戶信息:\n",currentUser);printf("用戶名:");scanf("%s",);printf("用戶密碼:");scanf("%s",);printf("用戶類型(1代表管理員,2代表店長,3代表銷售員):");scanf("%d",&);=NULL;if(FUNCTION_SUCCESS==AddUser(&tmpUser))printf("用戶信息添加成功!\n");};運(yùn)算顯示如下(圖4-7):圖4-7//用戶信息修改函數(shù)//voidUserInfoModify(){charuserName[20];SystemUser*pUser;printf("親愛的管理員%s,請輸入要修改的用戶帳號:\n",currentUser);scanf("%s",userName);pUser=pSystemUserHead;while(NULL!=pUser){if(0==strcmp(pUser->userName,userName)){printf("請輸入新的帳號:");scanf("%s",pUser->userName);printf("請輸入新的密碼:");scanf("%s",pUser->password);printf("請輸入新的用戶類型(1代表管理員,2代表店長,3代表銷售員):");scanf("%d",&pUser->userType);
printf("用戶信息修改成功\n");
return;}pUser=pUser->next;}printf("對不起,沒有你查找的用戶信息!\n");};運(yùn)算顯示如下(圖4-8):圖4-8//用戶信息刪除函數(shù)//voidUserInfoDelete(){SystemUser*pUserA,*pUserB;charuserName[20];printf("親愛的管理員%s朋友,你好,你現(xiàn)在進(jìn)入的用戶信息刪除功能:\n",currentUser);printf("請輸入你要刪除的用戶名:\n");scanf("%s",userName);pUserA=pUserB=pSystemUserHead;//pUserB指向要刪除的記錄,pUserA指向前一條記錄if(NULL==pUserB)return;while(NULL!=pUserB){if(0==strcmp(userName,pUserB->userName)){if(pUserB==pSystemUserHead&&pUserB->next==NULL){//如果系統(tǒng)只有一條商品信息free(pSystemUserHead);pSystemUserHead=NULL;printf("用戶信息刪除成功!\n");return;}pUserA->next=pUserB->next;if(pSystemUserHead==pUserB)pSystemUserHead=pUserB->next;free(pUserB);printf("用戶信息刪除成功!\n");return;}else{pUserA=pUserB;pUserB=pUserB->next;}}printf("對不起,不存在該帳號的用戶信息!");};運(yùn)算顯示如下(圖4-9):圖4-9(3)商品信息管理:添加,修改,查詢,刪除//商品管理模塊//voidProductsManage(){intselect;while(1){printf("親愛的%s朋友,你好,你現(xiàn)在進(jìn)入的是商品管理功能,你可以選擇以下功能:\n",currentUser);printf("(1)商品信息查看\n");printf("(2)商品信息查找\n");printf("(3)商品信息添加\n");printf("(4)商品信息修改\n");printf("(5)商品信息刪除\n");printf("(6)返回上一級菜單\n");printf("(7)退出登陸系統(tǒng)\n");printf("請選擇應(yīng)的操作編號:");scanf("%d",&select);switch(select){case1:ProductsView();//調(diào)用商品查看函數(shù)//continue;case2:ProductFind();//調(diào)用商品信息查找函數(shù)//continue;case3:InputAndAddProduct();//調(diào)用商品添加函數(shù)//continue;case4:ModifyProduct();//調(diào)用商品修改函數(shù)//continue;case5:DeleteProduct();//調(diào)用刪除商品信息函數(shù)//continue;case6:switch(currentUserType){//返回上一級//caseADMIN_USER_TYPE:
AdminOperationMenu();
break;caseBOSS_USER_TYPE:
BossOperationMenu();
break;caseSELL_USER_TYPE:
SellOperationMenu();
break;default:break;}break;case7:ExitSystem();break;default:break;}}};運(yùn)算顯示如下(圖4-10):圖4-10//商品的查看函數(shù)//voidProductsView(){Products*tmpProduct;inti;i=1;tmpProduct=pProductHead;if(NULL==tmpProduct)printf("對不起,目前還沒有商品信息");else{while(NULL!=tmpProduct){printf("第%d件商品信息如下:\n",i);printf("商品編號:%d\n",tmpProduct->productId);printf("商品名稱:%s\n",tmpProduct->productName);printf("商品型號:%s\n",tmpProduct->productType);printf("商品廠家:%s\n",tmpProduct->productCompany);printf("商品價格:%f\n",tmpProduct->productPrice);printf("商品數(shù)量:%d\n",tmpProduct->productCount);printf("商品附加信息:%s\n",tmpProduct->memo);tmpProduct=tmpProduct->next;i++;}}};運(yùn)算顯示如下(圖4-11):圖4-11//商品查找函數(shù)//voidProductFind(){Products*tmpProduct;intfindWay,productId;charproductName[20];printf("親愛的%s朋友,你好,你現(xiàn)在進(jìn)入的商品查詢功能:\n",currentUser);printf("請選擇查詢方式:1--按商品編號查詢2--按商品名稱查詢\n");scanf("%d",&findWay);tmpProduct=pProductHead;switch(findWay){case1:printf("請輸入查詢的商品編號:");scanf("%d",&productId);while(NULL!=tmpProduct){if(productId==tmpProduct->productId){printf("你查詢的商品編號為%d的商品信息如下:\n",productId);printf("商品名稱:%s\n",tmpProduct->productName);printf("商品型號:%s\n",tmpProduct->productType);printf("商品廠家:%s\n",tmpProduct->productCompany);printf("商品價格:%f\n",tmpProduct->productPrice);printf("商品數(shù)量:%d\n",tmpProduct->productCount);printf("商品附加信息:%s\n",tmpProduct->memo);return;}tmpProduct=tmpProduct->next;}printf("對不起,不存在該商品編號的商品!\n");break;case2:printf("請輸入查詢的商品名稱:");scanf("%s",productName);while(NULL!=tmpProduct){if(0==strcmp(tmpProduct->productName,productName)){printf("你要查詢的商品名稱為%s的商品信息如下:\n",productName);printf("商品名稱:%s\n",tmpProduct->productName);printf("商品型號:%s\n",tmpProduct->productType);printf("商品廠家:%s\n",tmpProduct->productCompany);printf("商品價格:%f\n",tmpProduct->productPrice);printf("商品數(shù)量:%d\n",tmpProduct->productCount);printf("商品附加信息:%s\n",tmpProduct->memo);return;}tmpProduct=tmpProduct->next;}printf("對不起,不存在該商品編號的商品!\n");break;default:break;}}運(yùn)算顯示如下(圖4-12):
圖4-12//商品添加函數(shù)//voidInputAndAddProduct(){Productsproduct;printf("親愛的%s朋友,你好,請依次輸入新商品的信息:\n",currentUser);printf("商品名稱:");scanf("%s",);printf("商品型號:");scanf("%s",);printf("商品制造商:");scanf("%s",);printf("商品價格:");scanf("%f",&);printf("商品數(shù)量:");scanf("%d",&);printf("商品附加信息:");scanf("%s",);=NULL;if(FUNCTION_SUCCESS==AddProduct(&product))printf("商品信息添加成功!\n");};運(yùn)算顯示如下(圖4-15):圖4-15//商品修改函數(shù)//voidModifyProduct(){intproductId;//待修改的商品編號Products*tmpProduct;printf("親愛的%s朋友,你好,你現(xiàn)在進(jìn)入的商品信息修改功能:\n",currentUser);
printf("請輸入要修改的商品編號:");scanf("%d",&productId);tmpProduct=pProductHead;if(NULL==tmpProduct)return;while(NULL!=tmpProduct){if(productId==tmpProduct->productId){printf("商品編號%d的商品信息如下:\n",productId);
printf("商品名稱:%s\n",tmpProduct->productName);
printf("商品型號:%s\n",tmpProduct->productType);
printf("商品廠家:%s\n",tmpProduct->productCompany);
printf("商品價格:%f\n",tmpProduct->productPrice);
printf("商品數(shù)量:%d\n",tmpProduct->productCount);
printf("商品附加信息:%s\n",tmpProduct->memo);
printf("下面請對照修改該商品的相應(yīng)信息:\n");
printf("新的商品名稱:");scanf("%s",tmpProduct->productName);printf("新的商品型號:");scanf("%s",tmpProduct->productType);printf("新的商品廠家:");scanf("%s",tmpProduct->productCompany);printf("新的商品價格:");scanf("%f",&tmpProduct->productPrice);printf("新的商品數(shù)量:");scanf("%d",&tmpProduct->productCount);printf("新的商品附加信息:");scanf("%s",tmpProduct->memo);printf("商品信息修改成功!\n");break;}tmpProduct=tmpProduct->next;}};//商品刪除函數(shù)//voidDeleteProduct(){intproductId=0;Products*tmpProductA,*tmpProductB;printf("親愛的%s朋友,你好,你現(xiàn)在進(jìn)入的商品刪除功能:\n",currentUser);printf("請輸入你要刪除的商品編號:\n");scanf("%d",&productId);tmpProductA=tmpProductB=pProductHead;//tmpProductB指向要刪除的記錄,tmpProductA指向前一條記錄if(NULL==tmpProductB)return;while(NULL!=tmpProductB){if(tmpProductB->productId==productId){if(tmpProductB==pProductHead&&tmpProductB->next==NULL){//如果系統(tǒng)只有一條商品信息free(pProductHead);pProductHead=NULL;printf("商品信息刪除成功!\n");return;}tmpProductA->next=tmpProductB->next;if(pProductHead==tmpProductB)pProductHead=tmpProductB->next;free(tmpProductB);printf("商品信息刪除成功!\n");return;}else{tmpProductA=tmpProductB;tmpProductB=tmpProductB->next;}}printf("對不起,不存在該商品編號的信息!");};4.店長功能模塊(圖4-16)5.6.圖4-16(1)店長歡迎界面//店長歡迎界面//voidBossOperationMenu(){intselect;while(1){printf("親愛的店長%s同志,歡迎使用本系統(tǒng),你擁有下面所有功能:\n",currentUser);printf("(1)自身密碼修改\n");printf("(2)商品信息管理:添加,修改,查詢,刪除\n");printf("(3)銷售報表顯示:日報表,月報表,商品銷售量報表,銷售員業(yè)績報表\n");printf("(4)退出系統(tǒng)\n");printf("請輸入上面功能對應(yīng)的序號進(jìn)行功能選擇:");scanf("%d",&select);switch(select){case1:ChangePassword();break;case2:ProductsManage();break;case3:ReportPrint();break;case4:ExitSystem();;break;default:break;}}};(2)密碼修改,商品信息管理功能和管理員對應(yīng)功能的函數(shù)的調(diào)用一致(即調(diào)用ChangePassword()roductsManage()函數(shù))(3)銷售報表顯示:日報表,月報表,商品銷售量報表,銷售員業(yè)績報表//銷售報表顯示//voidReportPrint(){intselect=0;if(SELL_USER_TYPE!=currentUserType){while(1){printf("親愛的朋友%s,你好,你現(xiàn)在進(jìn)入的是銷售報表功能界面:\n",currentUser);printf("(1)所有商品銷售情況\n");printf("(2)商品日銷售報表\n");printf("(3)商品月銷售報表\n");printf("(4)銷售員銷售報表\n");printf("(5)返回上級菜單\n");printf("(6)退出登陸系統(tǒng)\n");printf("請選擇對應(yīng)的功能號:");scanf("%d",&select);switch(select){case1:ShowAllSellReport();continue;case2:ShowDaySellReport();continue;case3:ShowMonthSellReport();continue;case4:ShowEmployeeSellReport();continue;case5:switch(currentUserType){caseADMIN_USER_TYPE:AdminOperationMenu();break;caseBOSS_USER_TYPE:BossOperationMenu();break;
default:
break;
}break;
case6:
ExitSystem();
break;
default:
break;
}}}else{while(1){printf("親愛的銷售員%s,你好,你現(xiàn)在進(jìn)入的是銷售報表功能界面:\n",currentUser);printf("(1)查看自己日銷售報表\n");printf("(2)查看自己月銷售報表\n");printf("(3)返回上級菜單\n");printf("(4)退出登陸系統(tǒng)");printf("請選擇相應(yīng)的功能號:");scanf("%d",&select);switch(select){case1:ShowDaySellReport();continue;case2:ShowMonthSellReport();continue;case3:SellOperationMenu();break;case4:ExitSystem();break;default:break;}}}};//日銷售函數(shù)的統(tǒng)計//voidShowDaySellReport(){intyear,month,day;intrsCount=0;floattotalPrice=0.0,onePrice;
charproductName[20];SellInfoRecord*tmpSellInfo;printf("你好%s:當(dāng)前功能將進(jìn)行日銷售報表顯示\n",currentUser);
printf("請輸入銷售時間年份:");scanf("%d",&year);printf("請輸入銷售時間月份:");scanf("%d",&month);printf("請輸入銷售時間號數(shù):");scanf("%d",&day);tmpSellInfo=pSellInfoHead;
if(NULL==tmpSellInfo)return;while(NULL!=tmpSellInfo){if(year==tmpSellInfo->year&&month==tmpSellInfo->month&&day==tmpSellInfo->day&&((SELL_USER_TYPE==currentUserType)?(0==strcmp(tmpSellInfo->userName,currentUser)):1)){rsCount++;printf("符合條件的第%d條商品銷售記錄信息如下:\n",rsCount);printf("銷售編號:%d\n",tmpSellInfo->saleId);printf("產(chǎn)品編號:%d\n",tmpSellInfo->productId);getProductNameById(tmpSellInfo->productId,productName);printf("產(chǎn)品名稱:%s\n",productName);onePrice=getPriceById(tmpSellInfo->productId);printf("商品單價:%f\n",onePrice);printf("銷售數(shù)量:%d\n",tmpSellInfo->sellCount);printf("銷售員:%s\n",tmpSellInfo->userName);printf("銷售時間:%d年%d月%d日\n",tmpSellInfo->year,tmpSellInfo->month,tmpSellInfo->day);totalPrice+=onePrice*tmpSellInfo->sellCount;}tmpSellInfo=tmpSellInfo->next;}printf("總共有%d條符合條件的記錄,銷售總價%f元\n",rsCount,totalPrice);};//月銷售量函數(shù)統(tǒng)計//voidShowMonthSellReport(){intyear,month;intrsCount=0;floattotalPrice=0.0,onePrice;charproductName[20];SellInfoRecord*tmpSellInfo;printf("你好%s:當(dāng)前功能將進(jìn)行月銷售報表顯示\n",currentUser);printf("請輸入銷售時間年份:");scanf("%d",&year);printf("請輸入銷售時間月份:");scanf("%d",&month);tmpSellInfo=pSellInfoHead;if(NULL==tmpSellInfo)return;while(NULL!=tmpSellInfo){if(year==tmpSellInfo->year&&month==tmpSellInfo->month&&((SELL_USER_TYPE==currentUserType)?(0==strcmp(tmpSellInfo->userName,currentUser)):1)){
rsCount++;printf("符合條件的第%d條商品銷售記錄信息如下:\n",rsCount);
printf("銷售編號:%d\n",tmpSellInfo->saleId);printf("產(chǎn)品編號:%d\n",tmpSellInfo->productId);getProductNameById(tmpSellInfo->productId,productName);printf("產(chǎn)品名稱:%s\n",productName);onePrice=getPriceById(tmpSellInfo->productId);printf("商品單價:%f\n",onePrice);printf("銷售數(shù)量:%d\n",tmpSellInfo->sellCount);printf("銷售員:%s\n",tmpSellInfo->userName);printf("銷售時間:%d年%d月%d日\n",tmpSellInfo->year,tmpSellInfo->month,tmpSellInfo->day);totalPrice+=onePrice*tmpSellInfo->sellCount;}tmpSellInfo=tmpSellInfo->next;}printf("總共有%d條符合條件的記錄,銷售總價%f元\n",rsCount,totalPrice);};//顯示銷售員的業(yè)績//voidShowEmployeeSellReport(){charuserName[20];intrsCount=0;floattotalPrice=0.0,onePrice;charproductName[20];SellInfoRecord*tmpSellInfo;printf("你好%s:當(dāng)前功能將進(jìn)行銷售員銷售報表顯示\n",currentUser);printf("請輸入銷售員的帳戶名:");scanf("%s",userName);tmpSellInfo=pSellInfoHead;if(NULL==tmpSellInfo)return;while(NULL!=tmpSellInfo){if(0==strcmp(userName,tmpSellInfo->userName)){rsCount++;printf("符合條件的第%d條商品銷售記錄信息如下:\n",rsCount);
printf("銷售編號:%d\n",tmpSellInfo->saleId);
printf("產(chǎn)品編號:%d\n",tmpSellInfo->productId);
getProductNameById(tmpSellInfo->productId,productName);
printf("產(chǎn)品名稱:%s\n",productName);onePrice=getPriceById(tmpSellInfo->productId);printf("商品單價:%f\n",onePrice);printf("銷售數(shù)量:%d\n",tmpSellInfo->sellCount);
printf("銷售員:%s\n",tmpSellInfo->userName);
printf("銷售時間:%d年%d月%d日\n",tmpSellInfo->year,tmpSellInfo->month,tmpSellInfo->day);
totalPrice+=onePrice*tmpSellInfo->sellCount;
}tmpSellInfo=tmpSellInfo->next;}printf("總共有%d條符合條件的記錄,銷售總價%f元\n",rsCount,totalPrice);};//顯示所有銷售員的業(yè)績//voidShowAllSellReport(){intrsCount=0;floattotalPrice=0.0,onePrice;charproductName[20];SellInfoRecord*tmpSellInfo;printf("你好%s:當(dāng)前功能將進(jìn)行所有銷售報表顯示\n",currentUser);tmpSellInfo=pSellInfoHead;if(NULL==tmpSellInfo)return;while(NULL!=tmpSellInfo){rsCount++;printf("第%d條商品銷售記錄信息如下:\n",rsCount);printf("銷售編號:%d\n",tmpSellInfo->saleId);printf("產(chǎn)品編號:%d\n",tmpSellInfo->productId);getProductNameById(tmpSellInfo->productId,productName);printf("產(chǎn)品名稱:%s\n",productName);onePrice=getPriceById(tmpSellInfo->productId);printf("商品單價:%f\n",onePrice);printf("
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 個人醫(yī)院收購合同范例
- 倆人合伙裝修合同范例
- 保底收益合同范例
- 公司收押金合同范例
- 個人勞務(wù)合同范例餐廳
- 公益勞動勞務(wù)合同范例
- 買賣車庫合同范例
- 代銷書合同范例
- 公司加工承攬合同范例
- 代理飲料咋樣寫合同范例
- 【九上RJ數(shù)學(xué)】安徽省黃山市歙縣2024-2025學(xué)年九年級上學(xué)期期末數(shù)學(xué)試題
- 不良事件分級及上報流程
- 申請做女朋友的申請書
- 弱電系統(tǒng)維保合同
- 高中家長會 共筑夢想,攜手未來課件-高二下學(xué)期期末家長會
- 家電店慶活動方案范文
- 《特種設(shè)備無損檢測機(jī)構(gòu)檢測能力確認(rèn) 工作導(dǎo)則》
- 醫(yī)療糾紛鑒定委員會工作制度及職責(zé)
- 投標(biāo)項目售后服務(wù)方案
- 國土安全課件
- 第一講-17.1一元二次方程的概念
評論
0/150
提交評論