当前位置:首页 > 服装销售管理系统—C语言课程设计 - 图文
C语言课程设计实验报告 case 5: AdminOperationMenu(); break; case 6: ExitSystem(); break; default: break; } }}; //商品信息查看 void ProductsView() { Products *tmpProduct; int i; i = 1; tmpProduct = pProductHead; if(NULL == tmpProduct) printf(\对不起,目前还没有商品信息\ else{ while(NULL != tmpProduct) { printf(\\\n\ printf(\第%d件商品信息如下:\\n\ printf(\商品编号: %d\\n\ printf(\商品名称: %s\\n\ printf(\商品型号: %s\\n\ printf(\商品厂家: %s\\n\ printf(\商品价格: %f\\n\ printf(\商品数量: %d\\n\ printf(\商品附加信息: %s\\n\ tmpProduct = tmpProduct->next; i++; } system(\ }}; //产品销售功能 void ProductsSell() { SellInfoRecord sellInfo; printf(\\\n\ printf(\亲爱的销售员朋友%s,你好,你现在进入的是产品的销售功能:\\n\ printf(\请依次输入以下销售信息:\\n\ printf(\销售的产品编号:\ scanf(\ printf(\销售的产品数量:\ scanf(\ if(sellInfo.sellCount > getCountById(sellInfo.productId)) { printf(\对不起,你输入的销售数量大于库存,销售失败!\\n\ system(\ return ; } strcpy(sellInfo.userName,currentUser); printf(\销售商品所在年份:\第 25 页 共 37 页 C语言课程设计实验报告 scanf(\ printf(\销售商所在月份:\ scanf(\ printf(\销售商品所在号数:\ scanf(\ printf(\销售商品的附加信息:\ scanf(\ sellInfo.next = NULL; if(FUNCTION_SUCCESS == AddSellInfo(&sellInfo)) { printf(\商品销售成功!\\n\ system(\ ReduceProductCount(sellInfo.productId,sellInfo.sellCount); }; }; //商品管理功能 void ProductsManage() { int select; while(1) { system(\ printf(\亲爱的%s朋友,你好,你现在进入的是商品管理功能,你可以选择以下功能:\\n\ printf(\商品信息查看\\n\ printf(\商品信息查找\\n\ printf(\商品信息添加\\n\ printf(\商品信息修改\\n\ printf(\商品信息删除\\n\ printf(\返回上级菜单\\n\ printf(\退出登陆系统\\n\ printf(\请选择应的操作编号:\ scanf(\ switch(select) { case 1: ProductsView(); continue; case 2: ProductFind(); continue; case 3: InputAndAddProduct(); continue; case 4: ModifyProduct(); continue; case 5: DeleteProduct(); continue; case 6: switch(currentUserType) { case ADMIN_USER_TYPE: AdminOperationMenu(); break; case BOSS_USER_TYPE: BossOperationMenu(); 第 26 页 共 37 页 C语言课程设计实验报告 break; case SELL_USER_TYPE: SellOperationMenu(); break; default: break; } break; case 7: ExitSystem(); break; default: break; } }}; //添加商品信息 void InputAndAddProduct() { Products product; printf(\\\n\ printf(\亲爱的%s朋友,你好,请依次输入新商品的信息:\\n\ printf(\商品名称:\ scanf(\ printf(\商品型号:\ scanf(\ printf(\商品制造商:\ scanf(\ printf(\商品价格:\ scanf(\ printf(\商品数量:\ scanf(\ printf(\商品附加信息:\ scanf(\ product.next = NULL; if(FUNCTION_SUCCESS == AddProduct(&product)) printf(\商品信息添加成功!\\n\ system(\}; //更改商品信息 void ModifyProduct() { int productId; //待修改的商品编号 Products *tmpProduct; printf(\ printf(\亲爱的%s朋友,你好,你现在进入的商品信息修改功能:\\n\ printf(\请输入要修改的商品编号:\ scanf(\ tmpProduct = pProductHead; if(NULL == tmpProduct) return ; while(NULL != tmpProduct) { if(productId == tmpProduct->productId){ printf(\商品编号%d的商品信息如下:\\n\ printf(\商品名称: %s\\n\第 27 页 共 37 页 C语言课程设计实验报告 printf(\商品型号: %s\\n\ printf(\商品厂家: %s\\n\ printf(\商品价格: %f\\n\ printf(\商品数量: %d\\n\ printf(\商品附加信息: %s\\n\ printf(\下面请对照修改该商品的相应信息:\\n\ printf(\新的商品名称: \ scanf(\ printf(\新的商品型号: \ scanf(\ printf(\新的商品厂家: \ scanf(\ printf(\新的商品价格: \ scanf(\ printf(\新的商品数量: \ scanf(\ printf(\新的商品附加信息: \ scanf(\ printf(\商品信息修改成功!\\n\ system(\ break; } tmpProduct = tmpProduct->next; }}; //商品信息查找 void ProductFind() { Products *tmpProduct; int findWay,productId; char productName[20]; printf(\ printf(\亲爱的%s朋友,你好,你现在进入的商品查询功能:\\n\ printf(\请选择查询方式: 1--按商品编号查询 2--按商品名称查询:\ scanf(\ tmpProduct = pProductHead; switch(findWay) { case 1: printf(\请输入查询的商品编号:\ scanf(\ while(NULL != tmpProduct) { if(productId == tmpProduct->productId) { printf(\你查询的商品编号为%d的商品信息如下:\\n\ printf(\商品名称: %s\\n\ printf(\商品型号: %s\\n\ printf(\商品厂家: %s\\n\ printf(\商品价格: %f\\n\ printf(\商品数量: %d\\n\ printf(\商品附加信息: %s\\n\ system(\ return ; } tmpProduct = tmpProduct->next; } 第 28 页 共 37 页
共分享92篇相关文档