




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、C语言课程设计实验报告第84页 共84页C语言课程设计实验报告目的(本次课程设计所涉及并要求掌握的知识点。)用户与商品信息要采用文件存储,因而要提供文件的输入输出操作;实现用户的添加、修改、删除;商品信息的添加、修改、删除、查找等功能;实现商品浏览功能的实现,需要实现显示操作;另外还要提供键盘式选择菜单以实现功能选择。二、使用环境 (本次上机实践所使用的平台和相关软件。 )Microsoft Visual C+三、内容与设计思想 (1 设计思路 2 主要数据结构 3 主要代码结构 4 主要代码段分析 。 )1、设计思路服装销售系统服装销售系统管理员模块店长模块销售员模块商品模块用户添加用户删除
2、用户修改商品添加商品删除商品修改商品查找商品浏览商品出售2、主要数据结构/* 系统用户结构 */typedef struct SystemUser char userName20; /用户名,主键 char password20; /用户密码 int userType; /用户类型(1:管理员;2:店长;3:销售员) struct SystemUser *next; /指向下一个用户的指针 SystemUser;/* 服装商品信息 */typedef struct Products int productId; /商品编号,主键 char productName20; /商品名称 char p
3、roductType20; /商品型号 char productCompany20; /商品厂家 float productPrice; /商品价格 int productCount; /商品数量 char memo50; /商品附加信息 struct Products *next; /指向下一个商品的指针 Products;/* 销售记录信息结构 */typedef struct SellInfoRecord int saleId; /销售编号,主键 char userName20; /销售商品的用户名 int productId; /销售的商品编号 int sellCount; /销售数量
4、 int year; /销售商品年份 int month; /销售商品月份 int day; /销售商品日期 char memo50; /销售的附加信息 struct SellInfoRecord *next; /下一条销售记录 SellInfoRecord;3、主要代码结构(一)添加打开文件,从键盘输入要添加的信息,若添加的信息与文件里的信息重复,则调用系统暂停函数,返回界面;若添加的信息在文件里没有找到,则将添加的信息输入到文件,调用系统暂停函数,返回界面。查询打开文件,从键盘输入要查询的信息,若在文件里找到要查询的信息,则在界面输入信息,并调用系统暂停函数,返回界面;若没有找到查询的信息
5、,调用系统暂停函数,返回界面。删除打开文件,从键盘输入要删除的信息,若在文件里找到要删除的信息存在,则把文件里要删除的那条信息删除掉,并调用系统暂停函数,返回界面;若没有找到删除的信息,调用系统暂停函数,返回界面。修改打开文件,从键盘输入要修改的信息,若在文件里找到要修改的信息存在,则按照提示信息依次输入要修改的信息,写入文件,并调用系统暂停函数,返回界面;若没有找到修改的信息,调用系统暂停函数,返回界面。主要代码段分析/* 对系统进行初始化,建立用户记录和商品记录 */void InitSystem() FILE *fp; SystemUser adminUser,bossUser,sell
6、User; /管理员,店长,销售员三个角色信息 Products products2; /初始化两件服装商品信息 SellInfoRecord sellInfo2; /初始化两条销售记录/初始化管理员用户名、密码与类型 strcpy(adminUser.userName,admin); strcpy(adminUser.password,admin); adminUser.userType = ADMIN_USER_TYPE; adminUser.next = NULL;/打开管理员用户信息文件Admin.txt,写入信息,并关闭文件fp = fopen(Admin.txt, w);fprin
7、tf(fp, %st%s, adminUser.userName, adminUser.password);fclose(fp);AddUser(&adminUser); AddUser(&bossUser); AddUser(&sellUser); /添加第一条商品信息 strcpy(ductName,精品男装); strcpy(ductType,m001); strcpy(ductCompany,精品服装制造厂); ductPrice = 23.5; ductC
8、ount = 100; strcpy(products0.memo,精品男装,您的第一选择);products0.next = NULL;/添加第二条商品信息 strcpy(ductName,时尚女装); strcpy(ductType,w002); strcpy(ductCompany,时尚服装制造厂); ductPrice = 25.5; ductCount = 150; strcpy(products1.memo,时尚女装,您的第一选择); products1
9、.next = NULL; AddProduct(&products0); AddProduct(&products1);/添加第一条销售报表记录 sellInfo0.day = 16; strcpy(sellInfo0.memo,测试数据1); sellInfo0.month = 7; sellInfo0.next = NULL; sellIductId = 1; sellInfo0.sellCount = 8; strcpy(sellInfo0.userName,sell);sellInfo0.year = 2008;/添加第二条销售报表记录 sellInfo1.day =
10、 17; strcpy(sellInfo1.memo,测试数据2); sellInfo1.month = 7; sellInfo1.next = NULL; sellIductId = 2; sellInfo1.sellCount = 5; strcpy(sellInfo1.userName,sell); sellInfo1.year = 2008; AddSellInfo(&sellInfo0); AddSellInfo(&sellInfo1);/添加商品信息void InputAndAddProduct() Products product;printf(亲爱的%s朋友,你
11、好,请依次输入新商品的信息:n,currentUser);/输入商品名称、型号、制作商、价格、数量、附加信息,并把从键盘输入的值赋值给结构体变量的商品名称型号、制作商、价格、数量、附加信息 printf(商品名称:);scanf(%s,ductName);printf(商品型号:); scanf(%s,ductType); printf(商品制造商:); scanf(%s,ductCompany); printf(商品价格:); scanf(%f,&ductPrice); printf(商品数量:); scanf(%d,&ductCount); printf(商品附加信息:); scanf(%
12、s,product.memo);product.next = NULL;/若成功信息添加到结构体变量product里则提示添加成功if(FUNCTION_SUCCESS = AddProduct(&product) printf(商品信息添加成功!n);system(pause);/修改商品信息void ModifyProduct() int productId; /待修改的商品编号 Products *tmpProduct; printf(亲爱的%s朋友,你好,你现在进入的商品信息修改功能:n,currentUser); printf(请输入要修改的商品编号:); scanf(%d,&pro
13、ductId); /将从键盘接收到的商品编号赋值给变量productId tmpProduct = pProductHead; if(NULL = tmpProduct) return ; while(NULL != tmpProduct) if(productId = tmpProduct-productId) /若从键盘输入的商品编号与文件中的一致,则修改商品信息 printf(商品编号%d的商品信息如下:n,productId); printf( 商品名称: %sn,tmpProduct-productName); printf( 商品型号: %sn,tmpProduct-product
14、Type); printf( 商品厂家: %sn,tmpProduct-productCompany); printf( 商品价格: %fn,tmpProduct-productPrice); printf( 商品数量: %dn,tmpProduct-productCount); printf( 商品附加信息: %sn,tmpProduct-memo); printf(下面请对照修改该商品的相应信息:n); printf(新的商品名称: ); scanf(%s,tmpProduct-productName); printf(新的商品型号: ); scanf(%s,tmpProduct-prod
15、uctType); printf(新的商品厂家: ); scanf(%s,tmpProduct-productCompany); printf(新的商品价格: ); scanf(%f,&tmpProduct-productPrice); printf(新的商品数量: ); scanf(%d,&tmpProduct-productCount); printf(新的商品附加信息: ); scanf(%s,tmpProduct-memo); printf(商品信息修改成功!n); system(pause); break; tmpProduct = tmpProduct-next; ;/商品删除vo
16、id DeleteProduct() int productId = 0; Products *tmpProductA,*tmpProductB;printf(亲爱的%s朋友,你好,你现在进入的商品删除功能:n,currentUser); printf(请输入你要删除的商品编号:); scanf(%d,&productId); tmpProductA = tmpProductB = pProductHead; /tmpProductB指向要删除的记录,tmpProductA指向前一条记录 if(NULL = tmpProductB) return ; while(NULL != tmpProd
17、uctB) if(tmpProductB-productId = productId) if(tmpProductB = pProductHead & tmpProductB-next = NULL) /如果系统只有一条商品信息 free(pProductHead); pProductHead = NULL; printf(商品信息删除成功!n);system(pause); return ; tmpProductA-next = tmpProductB-next; if(pProductHead = tmpProductB) pProductHead = tmpProductB-next;
18、free(tmpProductB); printf(商品信息删除成功!n);system(pause); return ; else tmpProductA = tmpProductB; tmpProductB = tmpProductB-next; printf(对不起,不存在该商品编号的信息!);/商品查询void ProductFind() Products *tmpProduct; int findWay,productId; char productName20;printf(亲爱的%s朋友,你好,你现在进入的商品查询功能:n,currentUser); printf(请选择查询方式
19、: 1-按商品编号查询 2-按商品名称查询:); scanf(%d,&findWay); tmpProduct = pProductHead; switch(findWay) case 1: printf(请输入查询的商品编号:); scanf(%d,&productId); /输入要查询的商品编号 while(NULL != tmpProduct) if(productId = tmpProduct-productId) /若输入查询的商品编号与文件中的一致,则输出商品信息printf(你查询的商品编号为%d的商品信息如下:n,productId);printf( 商品名称: %sn,tmp
20、Product-productName);printf( 商品型号: %sn,tmpProduct-productType);printf( 商品厂家: %sn,tmpProduct-productCompany);printf( 商品价格: %fn,tmpProduct-productPrice);printf( 商品数量: %dn,tmpProduct-productCount);printf( 商品附加信息: %sn,tmpProduct-memo);system(pause); return ; tmpProduct = tmpProduct-next; printf(对不起,不存在该
21、商品编号的商品!n);system(pause); case 2: printf(请输入查询的商品名称:); scanf(%s,productName); /输入要查询的商品名称 while(NULL != tmpProduct) if(0 = strcmp(tmpProduct-productName,productName) /若输入查询的商品名称与文件中的一致,则输出商品信息 printf(你要查询的商品名称为%s的商品信息如下:n,productName); printf( 商品名称: %sn,tmpProduct-productName); printf( 商品型号: %sn,tmp
22、Product-productType); printf( 商品厂家: %sn,tmpProduct-productCompany); printf( 商品价格: %fn,tmpProduct-productPrice); printf( 商品数量: %dn,tmpProduct-productCount); printf( 商品附加信息: %sn,tmpProduct-memo);system(pause); return ; tmpProduct = tmpProduct-next; printf(对不起,不存在该商品编号的商品!n);system(pause); default: bre
23、ak; 四、调试过程 (1 测试数据设计 2 测试结果分析 )初始化用户名与密码管理员:admin admin店 长:boss boss销售员:sell sell(一)主界面(二)以管理员方式登陆系统,输入正确的用户账号admin和密码admin若登陆名或密码错误,则提示用户不存在登陆成功,进入管理员界面选择“(1)自身密码修改”,修改管理员密码选择“(2)用户信息管理”,进行用户的增、删、改、查功能选择“用户信息查看”,查看当前用户信息选择“用户信息添加”,添加用户信息选择“用户信息删除”,删除用户返回管理员界面,选择“(3)商品信息管理”,进行商品的增、删、改、查功能。选择“用户信息查看”
24、,查看当前商品信息。选择“商品信息查找”,根据商品编号及商品名称进行查找。首先,选择“按商品编号查询”,若查询的编号存在,则显示查询的信息若查询的商品编号不存在,则提示信息“对不起,不存在该商品编号的商品”选择“按商品名称查询”,输入正确的商品名称,显示查询信息若查询的商品名称不存在,则提示信息“对不起,不存在该商品编号的商品”选择“商品信息添加”,添加商品信息选择“商品信息修改”,修改商品信息选择“商品信息删除”,删除商品返回管理员界面,选择“商品报表显示”,进行销售报表功能选择“所有商品销售情况”,显示商品信息选择“商品日销售报表”,查看符合条件的销售商品若查询的信息不符合条件,则显示没有
25、符合条件的记录选择“商品月销售报表”,查看符合条件的销售商品选择“销售员销售报表”,查看符合条件的销售商品(三)以店长方式登录系统选择“自身密码修改”,修改店长密码店长其他功能(商品信息管理,销售报表显示)与管理员类似。(四)以销售员登陆系统选择“商品销售”功能,进行产品销售若销售产品大于库存,则提示销售失败。销售员商品浏览、查询、及报表查看功能与管理员功能类似五、总结 1 设计中遇到的问题及解决过程 2 设计中产生的错误及原因分析 3 设计体会和收获。六、附录 1、原代码 #include /标准输入输出函数#include /Windows头文件#include /日期和时间头文件#def
26、ine ADMIN_USER_TYPE 1#define BOSS_USER_TYPE 2#define SELL_USER_TYPE 3#define FUNCTION_FAILED -1#define FUNCTION_SUCCESS 0 /如果函数成功执行,将返回0/* 系统用户结构 */typedef struct SystemUser char userName20; /用户名,主键 char password20; /用户密码 int userType; /用户类型(1:管理员;2:店长;3:销售员) struct SystemUser *next; /指向下一个用户的指针 Sys
27、temUser;/* 服装商品信息 */typedef struct Products int productId; /商品编号,主键 char productName20; /商品名称 char productType20; /商品型号 char productCompany20; /商品厂家 float productPrice; /商品价格 int productCount; /商品数量 char memo50; /商品附加信息 struct Products *next; /指向下一个商品的指针 Products;/* 销售记录信息结构 */typedef struct SellInf
28、oRecord int saleId; /销售编号,主键 char userName20; /销售商品的用户名 int productId; /销售的商品编号 int sellCount; /销售数量 int year; /销售商品年份 int month; /销售商品月份 int day; /销售商品日期 char memo50; /销售的附加信息 struct SellInfoRecord *next; /下一条销售记录 SellInfoRecord;static char currentUser20; /系统全局变量,保存当前登陆用户名;static int currentUserTyp
29、e; /系统全局变量,保存当前登陆用户的用户类型static SystemUser *pSystemUserHead = NULL; /保存系统用户信息记录的头指针static Products *pProductHead = NULL; /保存系统商品信息记录的头指针static SellInfoRecord *pSellInfoHead = NULL;/保存系统销售记录的头指针void InitSystem(); /对系统用户信息和商品信息进行初始化int AddUser(SystemUser *); /向用户信息链表中加入用户信息int AddProduct(Products *pPro
30、); /向商品信息链表中加入商品信息int AddSellInfo(SellInfoRecord *);void UserExit();void WelcomeMenu(); /系统欢迎菜单void SystemLogin(); /系统登陆void AdminOperationMenu(); /系统管理员操作菜单void BossOperationMenu(); /店长操作菜单void SellOperationMenu(); /销售员操作菜单void ChangePassword(); /修改密码void UserManage(); /用户信息管理 void UserInfoView();
31、/用户信息查看 void UserInfoAdd(); /用户信息添加 void UserInfoModify(); /用户信息修改 void UserInfoDelete(); /用户信息删除void ProductsManage(); /产品信息管理 void ProductsView(); /商品查看 void ProductFind(); void InputAndAddProduct(); /输入商品信息并添加 void ModifyProduct(); /修改商品信息 void DeleteProduct(); /删除商品信息 void ProductsSell(); /商品销售v
32、oid ReportPrint(); /报表显示 void ShowAllSellReport(); /显示所有商品销售情况 void ShowDaySellReport(); /显示某日的销售情况 void ShowMonthSellReport(); /显示某月的销售情况 void ShowEmployeeSellReport(); /显示某个销售员的销售情况void ExitSystem(); / 退出登陆系统float getPriceById(int ); /通过商品编号查询商品价格int getProductNameById(int,char *); /通过商品编号查询商品名称in
33、t getCountById(int); /通过商品编号查询商品库存数量void ReduceProductCount(int,int); /通过商品编号减少商品数量/* 对系统进行初始化,建立用户记录和商品记录 */void InitSystem() FILE *fp;SystemUser adminUser,bossUser,sellUser; /管理员,店长,销售员三个角色信息 Products products2; /初始化两件服装商品信息 SellInfoRecord sellInfo2; /初始化两条销售记录/管理员 strcpy(adminUser.userName,admin)
34、; strcpy(adminUser.password,admin); adminUser.userType = ADMIN_USER_TYPE; adminUser.next = NULL;fp = fopen(Admin.txt, w);fprintf(fp, %st%s, adminUser.userName, adminUser.password);fclose(fp);/店长 strcpy(bossUser.userName,boss); strcpy(bossUser.password,boss); bossUser.userType = BOSS_USER_TYPE; bossU
35、ser.next = NULL;fp = fopen(Shopkeeper.txt, w);fprintf(fp, %st%s, bossUser.userName, bossUser.password);fclose(fp);/销售员 strcpy(sellUser.userName,sell); strcpy(sellUser.password,sell); sellUser.userType = SELL_USER_TYPE; sellUser.next = NULL;fp = fopen(Seller.txt, w);fprintf(fp, %st%s, sellUser.userNa
36、me, sellUser.password);fclose(fp); AddUser(&adminUser); AddUser(&bossUser); AddUser(&sellUser); /ductId = 1; strcpy(ductName,精品男装); strcpy(ductType,m001); strcpy(ductCompany,精品服装制造厂); ductPrice = 23.5; ductCount = 100; str
37、cpy(products0.memo,精品男装,您的第一选择); products0.next = NULL; /ductId = 2; strcpy(ductName,时尚女装); strcpy(ductType,w002); strcpy(ductCompany,时尚服装制造厂); ductPrice = 25.5; ductCount = 150; strcpy(products1.memo,时尚女装,您的第一选择); product
38、s1.next = NULL; AddProduct(&products0); AddProduct(&products1); sellInfo0.day = 16; strcpy(sellInfo0.memo,测试数据1); sellInfo0.month = 7; sellInfo0.next = NULL; sellIductId = 1; sellInfo0.sellCount = 8; strcpy(sellInfo0.userName,sell); sellInfo0.year = 2008; sellInfo1.day = 17; strcpy(sellInfo1
39、.memo,测试数据2); sellInfo1.month = 7; sellInfo1.next = NULL; sellIductId = 2; sellInfo1.sellCount = 5; strcpy(sellInfo1.userName,sell); sellInfo1.year = 2008; AddSellInfo(&sellInfo0); AddSellInfo(&sellInfo1);/*函数功能: 向系统用户信息链表中加入用户信息*/int AddUser(SystemUser *pUser) SystemUser *pSystemUser,*tempS
40、ystemUser; tempSystemUser = pSystemUserHead; while(NULL != tempSystemUser) if(0 =strcmp(tempSystemUser-userName,pUser-userName) printf(对不起,你要添加的用户已经存在); return FUNCTION_FAILED; tempSystemUser = tempSystemUser-next; pSystemUser = (SystemUser *) malloc(sizeof(SystemUser); /在堆空间中分配用户信息的内存 if(NULL = pSy
41、stemUser) printf(分配用户信息内存时发生错误); return FUNCTION_FAILED; strcpy(pSystemUser-userName,pUser-userName); /拷贝用户信息到堆空间中 strcpy(pSystemUser-password,pUser-password); pSystemUser-userType = pUser-userType; pSystemUser-next = pUser-next; tempSystemUser = pSystemUserHead; if(NULL = tempSystemUser) pSystemUse
42、rHead = pSystemUser; else while(NULL != tempSystemUser-next) /遍历到用户信息的最后一条记录 tempSystemUser = tempSystemUser-next;tempSystemUser-next = pSystemUser;/将用户信息加入到链表的最后 return FUNCTION_SUCCESS;/*函数功能: 向商品信息链表中加入商品信息*/int AddProduct(Products *pPro) int newProductId = 1; /新加入商品的商品编号从1开始 Products *tempProduc
43、t,*pProduct; tempProduct = pProductHead; /生成编号,最后一件商品编号+1 while(NULL != tempProduct) newProductId = tempProduct-productId + 1; tempProduct = tempProduct-next; pProduct = (Products *)malloc(sizeof(Products); if(NULL = pProduct) printf(对不器,添加商品信息时,堆内存分配失败!); return FUNCTION_FAILED; pProduct-productId
44、= newProductId; /拷贝商品信息 strcpy(pProduct-productName,pPro-productName); strcpy(pProduct-productType,pPro-productType); strcpy(pProduct-productCompany,pPro-productCompany); pProduct-productPrice = pPro-productPrice; pProduct-productCount = pPro-productCount; strcpy(pProduct-memo,pPro-memo); pProduct-n
45、ext = pPro-next; tempProduct = pProductHead; /将商品信息加入到商品信息链表最后 if(NULL = tempProduct) pProductHead = pProduct; else while(NULL != tempProduct-next) tempProduct = tempProduct-next; tempProduct-next = pProduct; return FUNCTION_SUCCESS;/*函数功能: 向系统销售信息链表中加入销售信息*/int AddSellInfo(SellInfoRecord *pSellInfo
46、) int newSellInfoId = 1; /新加入销售记录的编号从1开始 SellInfoRecord *tmpSellInfo,*pSellInfoRecord; tmpSellInfo = pSellInfoHead; /生成编号,最后一个销售编号+1 while(NULL != tmpSellInfo) newSellInfoId = tmpSellInfo-saleId + 1; tmpSellInfo = tmpSellInfo-next; pSellInfoRecord= (SellInfoRecord *)malloc(sizeof(SellInfoRecord); if
47、(NULL = pSellInfoRecord) printf(对不起,添加销售记录信息时,堆内存分配失败!); return FUNCTION_FAILED; pSellInfoRecord-saleId = newSellInfoId; pSellInfoRecord-day = pSellInfo-day; strcpy(pSellInfoRecord-memo,pSellInfo-memo); pSellInfoRecord-month = pSellInfo-month; pSellInfoRecord-next = pSellInfo-next; pSellInfoRecord-p
48、roductId = pSellInfo-productId; pSellInfoRecord-sellCount = pSellInfo-sellCount; strcpy(pSellInfoRecord-userName,pSellInfo-userName); pSellInfoRecord-year = pSellInfo-year;tmpSellInfo=pSellInfoHead; /将销售信息加入到销售记录信息链表最后 if(NULL = tmpSellInfo) pSellInfoHead = pSellInfoRecord; else while(NULL != tmpSel
49、lInfo-next) tmpSellInfo = tmpSellInfo-next; tmpSellInfo-next = pSellInfoRecord; return FUNCTION_SUCCESS;/*系统登陆函数*/void SystemLogin() char userName20,password20; int isLogin = 0; SystemUser *tmpUser; printf(请输入你的系统用户帐号:); scanf(%s,userName); printf(请输入你的系统用户密码:); scanf(%s,password); tmpUser = pSystem
50、UserHead; 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) case ADMIN_USER_TYPE: AdminOperationMenu(); break; case BOSS_USER_TYPE: Bo
51、ssOperationMenu(); break; case SELL_USER_TYPE: SellOperationMenu(); break; default: break; else printf(对不起,你输入的密码错误!n); SystemLogin(); /用户名正确,密码错误 tmpUser = tmpUser-next; if(isLogin != 1) printf(对不起,该用户不存在n); /遍历了所有用户都没有找到用户 SystemLogin(); /欢迎界面void WelcomeMenu() printf(*欢迎光临服装销售管理系统*n); printf(系统功能
52、说明:n); printf( 管理员功能:n); printf( (1)自身密码修改n); printf( (2)用户信息管理:添加,修改,删除,查询n);printf( (3)商品信息管理:添加,修改,查询,删除n);printf( (4)销售报表显示:日销售报表,月销售报表,销售员销售报表n); printf( (5)返回主界面n);printf( (6)退出系统n); printf( 店长功能:n); printf( (1)自身密码修改n); printf( (2)商品信息管理:添加,修改,查询,删除n);printf( (3)销售报表显示:日销售报表,月销售报表,销售员销售报n); p
53、rintf( (4)返回主界面n);printf( (5)退出系统n); printf( 销售员功能:n); printf( (1)商品浏览,查询,商品销售n); printf( (2)自己商品销售报表显示:日销售报表,月销售报表n); printf( (3)返回主界面n);printf( (4)退出系统n); printf(*欢迎使用本系统*n);/管理员界面void AdminOperationMenu() int select; while(1) system(cls); printf(亲爱的管理员%s同志,欢迎使用本系统,你拥有下面所有功能:n,currentUser); printf
54、( (1)自身密码修改n); printf( (2)用户信息管理:添加,修改,查询,删除n); printf( (3)商品信息管理:添加,修改,查询,删除n); printf( (4)销售报表显示:日报表,月报表,商品销售量报表,销售员业绩报表n);printf( (5)返回主界面n); printf( (6)退出系统n); printf(请输入上面功能对应的序号进行功能选择:); scanf(%d,&select); switch(select) case 1: ChangePassword(); continue; case 2: UserManage(); continue; case
55、3: ProductsManage(); continue; case 4: ReportPrint(); continue;case 5: UserExit(); break;case 6: ExitSystem(); break; default: break; if(select=5)break; ;/店长界面void BossOperationMenu() int select; while(1) system(cls); printf(亲爱的店长%s同志,欢迎使用本系统,你拥有下面所有功能:n,currentUser); printf( (1)自身密码修改n); printf( (2
56、)商品信息管理:添加,修改,查询,删除n); printf( (3)销售报表显示:日报表,月报表,商品销售量报表,销售员业绩报表n); printf( (4)返回主界面n);printf( (5)退出系统n); printf(请输入上面功能对应的序号进行功能选择:); scanf(%d,&select); switch(select) case 1: ChangePassword(); continue; case 2: ProductsManage(); continue; case 3: ReportPrint(); continue; case 4: UserExit(); break;
57、case 5: ExitSystem(); break; default: break; if(select=4)break; ;/销售员界面void SellOperationMenu() int select; while(1) system(cls); printf(亲爱的销售员%s同志,欢迎使用本系统,你拥有下面所有功能:n,currentUser); printf( (1)商品浏览n); printf( (2)商品查询n); printf( (3)商品销售n); printf( (4)报表查看n); printf( (5)返回主界面n);printf( (6)退出系统n); prin
58、tf(请输入上面功能对应的序号进行功能选择:); scanf(%d,&select); switch(select) case 1: ProductsView(); continue; case 2: ProductFind(); continue; case 3: ProductsSell(); continue; case 4: ReportPrint(); continue; case 5: UserExit(); break;case 6: ExitSystem(); break; default: break; if(select=5)break; ;/更改密码void Change
59、Password() char newPassword120,newPassword220; SystemUser *tmpUser;printf(*n); printf(请输入你的新密码:); scanf(%s,newPassword1); printf(请再次输入你的新密码:); scanf(%s,newPassword2); if(0 != strcmp(newPassword1,newPassword2) printf(对不起,你两次输入的密码不一致,修改失败!n); return ; tmpUser = pSystemUserHead; while(NULL != tmpUser)
60、if(0 = strcmp(tmpUser-userName,currentUser) strcpy(tmpUser-password,newPassword1); printf(密码修改成功!n);system(pause); break; tmpUser = tmpUser-next; ;/用户信息管理功能void UserManage() int select; while(1) system(cls); printf(亲爱的管理员%s同志,你目前进入的是用户信息管理功能:n,currentUser); printf( (1)用户信息查看n); printf( (2)用户信息添加n);
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年重大事项请示报告制度实施细则
- 污染水源协议书
- 洋葱赔偿协议书
- 工厂工人离职协议书
- 种苗供应协议书
- 家庭暴力婚姻协议书
- 小型动物领养协议书
- 工程损坏赔偿协议书
- 2025-2030中国水上乐园设备行业市场现状供需分析及投资评估规划分析研究报告
- 2025-2030中国农贸市场行业市场现状供需分析及投资评估规划分析研究报告
- 2025年航天知识竞赛题库及答案
- 2025年人教版小学小升初科学模拟试卷(含答案解析)
- 中国肿瘤营养治疗指南
- 初中英语牛津译林版8B unit7 international charities Task Charity work部优课件
- 华北电力大学ppt模板
- 旅游资源分类调查评价表 2017版
- 《我的梦-中国梦》主题班会课件
- 超声波加工以及机床设计机械设计论文
- 义齿加工成本
- 综合教学楼建筑结构设计
- 苏教版三年级下册科学实验题
评论
0/150
提交评论