当前位置:网站首页>大一学生课设c——服装管理系统
大一学生课设c——服装管理系统
2022-06-23 03:48:00 【InfoQ】
前言
服装管理系统

#include <stdio.h>
#include <malloc.h>
#include <string.h>
#include <stdlib.h>
#include <conio.h>
//说明:这个程序中的管理员,店长,销售员密码都是6位的。
// 管理员默认用户名是admin,密码是123456。
typedef struct admin //定义管理员结构体
{
char name[20];
char pass[20];
}ADMIN;
typedef struct // 定义商品结构体
{
char name[30];
int now;
int total;
int flag;
}DRESS;
typedef struct //定义用户结构体
{
int flag;
int type;
char username[20];
char pass[20];
DRESS mdb[100];
}USER;
USER usertemp;
int usernum=0; //记录销售员的数量
int adddress(DRESS *dress)
{
char name[20];
int total;
int i;
system("cls");
printf(" /======================服装销售系统系统商品添加=======================/\n");
printf(" 请输入商品的名称:");
scanf("%s",&name);
printf("\n 请输入入库的商品的数量:") ;
scanf("%d",&total);
printf("\n\n\n 商品信息输入完毕!\n\n\n");
for(i=0;i<500;i++)
{
if(dress[i].flag==0)
{
strcpy(dress[i].name,name);
dress[i].total=total;
dress[i].now=total;
dress[i].flag=1;
system("pause");
return 1;
}
}
return 0;
}
int deldress(DRESS *dress)//删除
{
}
int finddress(DRESS *dress)//查找
{
}
void dressall(DRESS *dress)
{
int i;
system("cls");
printf(" /======================服装销售系统系统查看商品=======================/\n");
for(i=0;i<500;i++)
{
if(dress[i].flag==1)
printf(" 商品的名称为: %s ,商品的总量为: %d ,商品的现存量 %d \n",dress[i].name,dress[i].total,dress[i].now);
}
system("pause");
}
void adminIntiate(ADMIN *adm) //管理员密码用户名初始化
{
strcpy(adm->name,"admin");
strcpy(adm->pass,"123456");
}
void userIntiate(USER *use) //销售员密码用户名初始化
{
int j;
for(j=0; j<200; j++)
{
int i;
use[j].flag=0;
use[j].type=-1;
for(i=0;i<100;i++)
{
use[j].mdb[i].flag=0;
}
}
}
void dressIntiate(DRESS *dress) //商品初始化
{
for(int i=0; i<500; i++)
{
dress[i].flag=0;
}
}
int regnew(USER *use)
{
char name[21];
char pass[7]={0};
int chose;
int i;
int type;
while(1)
{
system("cls");
printf(" /======================服装销售系统系统用户注册=======================/\n");
}
}
int deluser(USER *use)
{
int i;
char name[20];
printf(" /======================服装销售系统用户删除============================/\n");
return 0;
}
int useall(USER *use)
{
int i;
system("cls");
printf(" /======================服装销售系统用户查看=========================/\n");
return 0;
}
int adminload(ADMIN *adm)
{
char name[21];
char pass[7]={0};
int chose,chose2;
int i;
while(1)
{
system("cls");
printf(" /======================服装销售系统管理员登陆========================/\n");
printf(" 管理员账号:");
scanf("%s",&name);
printf(" 密 码:");
for(i=0;i<6;i++)
{
pass[i]=getch();
printf("*");
}
while(1)
{
printf("\n\n 用户登陆信息输入完毕,是否确认? 1,确认 0,重新输入\n");
scanf("%d",&chose);
if(chose!=1&&chose!=0)
{
printf(" 你的输入有误,请重新的输入!\n");
continue;
}
if(chose==1)
{
if(strcmp(adm->name,name)==0)
if(strcmp(adm->pass,pass)==0)
{
printf(" 登陆成功!请继续使用! \n");
strcpy(usertemp.username,name);
return 1;
}
printf(" 输入的用户名或者密码有误!1,重新登陆 2,退出登陆!\n");
scanf("%d",&chose2);
if(chose2==1)
{
system("cls");
break;
}
else
{
system("cls");
return 0;
}
}
if(chose==0) break;
}
}
}
int adminpass(ADMIN *adm)
{
int i;
char pass[20]={0};
char pass2[20]={0};
while(1)
{
system("cls");
printf(" /======================服装销售系统管理员密码修改===================/\n");
printf(" 请输入新的管理员密码:");
for(i=0;i<6;i++)
{
pass[i]=getch();
printf("*");
}
printf("\n\n\n 请再次输入新的管理员密码:");
for(i=0;i<6;i++)
{
pass2[i]=getch();
printf("*");
}
if(strcmp(pass,pass2)!=0)
{
printf("\n\n 两次输入的新的密码不一样,请重新的输入!\n\n\n");
system("pause");
}
else
{
printf("\n 密码修改成功!下一次管理员登陆请使用新的密码!\n\n\n");
strcpy(adm->pass,pass);
system("pause");
return 1;
}
}
}
int adminout()
{
int chose;
while(1)
{
system("cls");
printf(" /======================服装销售系统管理员注销=====================/\n");
printf(" 你确定要注销吗? 1,注销 0,取消\n\n");
scanf("%d",&chose);
if(chose!=0&&chose!=1)
{
printf(" 你的选项出现了错误,请重新的输入!\n\n\n");
system("pause");
continue;
}
if(chose==1)
{
printf(" 管理员账户注销完毕!! \n\n\n\n");
system("pause");
return 1;
}
else return 0;
}
}
int out()
{
int chose;
system("cls");
printf(" /==========================服装管理系统首界面======================/\n");
}
int adminmenu(ADMIN *adm,USER *use,DRESS *dress)
{
int chose1;
while(1)
{
system("cls");
printf(" /======================服装销售系统管理员菜单========================/\n");
printf("\n 在线用户: %s\n\n",usertemp.username);
printf(" //=======用户功能菜单=====//\n");
printf(" // //\n");
printf(" // 1,添加用户 //\n");
printf(" // 2,删除用户 //\n");
printf(" // 3,统计用户 //\n");
printf(" // 4,添加商品 //\n");
printf(" // 5,删除商品 //\n");
printf(" // 6,查找商品 //\n");
printf(" // 7,商品统计 //\n");
printf(" // 8,修改密码 //\n");
printf(" // 9,注销账户 //\n");
printf(" // 0,退出系统 //\n");
printf(" //=========================//\n");
printf("\n /=============================请选择服务的种类========================/\n");
scanf("%d",&chose1);
if(chose1<0||chose1>9)
{
printf(" 你的输入有误,请重新的输入!\n");
system("pause");
continue;
}
switch(chose1)
{
case 1:
{
system("cls");
regnew(use);
system("pause");
break;
}
case 2:
{
system("cls");
deluser(use);
system("pause");
break;
}
case 3:
{
system("cls");
useall(use);
system("pause");
break;
}
case 4:
{
system("cls");
adddress(dress);
system("pause");
break;
}
case 5:
{
system("cls");
deldress(dress);
break;
}
case 6:
{
system("cls");
finddress(dress);
break;
}
case 7:
{
system("cls");
dressall(dress);
system("pause");
break;
}
case 8:
{
system("cls");
if(adminpass(adm)==1) continue;
break;
}
case 9:
{
system("cls");
if(adminout()==1) return 3;
}
case 0:
{
system("cls");
if(out()==1) continue;
break;
}
default: continue;
}
} //while函数循环结束
}
int userload(USER *use)
{
printf(" /======================服装管理系统销售人员登陆=======================/\n");
}
int userout()
{
int chose;
system("cls");
printf(" /======================服装销售系统销售员注销=====================/\n");
}
int sold(USER *use,DRESS *dress)
{
char name[20];
int num;
int i;
int j;
int k;
system("cls");
printf(" /======================服装销售系统销售人员菜单======================/\n");
return 0;
}
void mounth(USER *use)
{
int i;
int j;
char name[20];
strcpy(name,usertemp.username);
system("cls");
printf(" /======================服装销售系统销售人员销售记录====================/\n");
printf("\n 在线用户: %s\n\n",usertemp.username);
for(i=0;i<100;i++)
{
if(strcmp(use[i].username,name)==0)
{
for(j=0;j<100;j++)
{
if(use[i].mdb[j].flag==1)
printf(" 商品名称: %s ,出售数量 : %d\n",use[i].mdb[j].name,use[i].mdb[j].total);
}
}
}
}
int usermenu(USER *use,DRESS *dress)
{
//int i;
int chose1;
while(1)
{
system("cls");
printf(" /======================服装销售系统销售人员菜单======================/\n");
printf("\n 在线用户: %s\n\n",usertemp.username);
printf(" //=======用户功能菜单=====//\n");
printf(" // //\n");
printf(" // 1,商品浏览 //\n");
printf(" // 2,商品查找 //\n");
printf(" // 3,出售商品 //\n");
printf(" // 4,销售记录 //\n");
printf(" // 5,用户注销 //\n");
printf(" // //\n");
printf(" // //\n");
printf(" //=========================//\n");
printf("\n /=============================请选择服务的种类========================/\n");
scanf("%d",&chose1);
if(chose1<0||chose1>9)
{
printf(" 你的输入有误,请重新的输入!\n");
system("pause");
continue;
}
switch(chose1)
{
case 1:
{
system("cls");
dressall(dress);
break;
}
case 2:
{
system("cls");
finddress(dress);
break;
}
case 3:
{
system("cls");
sold(use,dress);
system("pause");
break;
}
case 4:
{
system("cls");
mounth(use);
system("pause");
break;
}
case 5:
{
system("cls");
if(userout()==1) return 3;
break;
}
default: continue;
}
}
}
int monpass(USER *use)
{
int i;
char pass[20]={0};
char pass2[20]={0};
system("cls");
printf(" /======================服装销售系统店长密码修改====================/\n");
printf(" 请输入新的密码:");
}
void monsee(USER *use)
{
int i;
int j;
// char name[20];
system("cls");
printf(" /======================服装销售系统全体销售记录======================/\n");
}
int monload(USER *use)
{
char name[21];
char pass[7]={0};
int chose,chose2;
int i;
while(1)
{
system("cls");
printf(" /======================服装管理系统店长登陆============================/\n");
}
}
int monout()
{
int chose;
while(1)
{
system("cls");
printf(" /======================服装销售系统店长注销==========================/\n");
}
}
int fix(DRESS *dress)//修改
{
}
int monmenu(USER *use,DRESS *dress)
{
printf(" /======================服装销售系统店长菜单============================/\n");
}
int first(USER *use,ADMIN *adm,DRESS *dress)
{
int chose;
int temp,temp2;
while(1)
{
system("cls");
printf(" /==========================服装管理系统首界面======================/\n");
printf(" //=========功能菜单========//\n");
printf(" // //\n");
printf(" // //\n");
printf(" // 1,销售员登陆 //\n");
printf(" // 2,店长登陆 //\n");
printf(" // 3,管理员登陆 //\n");
printf(" // //\n");
printf(" //=========================//\n");
printf("\n /=============================请选择服务的种类========================/\n");
scanf("%d",&chose);
if(chose<1||chose>5)
{
printf(" 你的选择出现错误!按任意键重新的进入选择菜单!\n");
system("pause");
continue;
}
switch(chose)
{
case 1:
{
system("cls");
if(userload(use)==1)
{
usermenu(use,dress);
}
system("pause");
break;
}
case 2:
{
system("cls");
if(monload(use)==1)
{
monmenu(use,dress);
}
break;
}
case 3:
{
system("cls");
temp=adminload(adm);
if(temp==1)
{
system("pause");
temp2=adminmenu(adm,use,dress);
return 3;
}
system("pause");
continue;
}
default: exit(0);
}
}//while()
}
int main()
{
USER *use;
use=(USER *)malloc(200*sizeof(USER));
userIntiate(use);
ADMIN *adm;
adm=(ADMIN *)malloc(sizeof(ADMIN));
adminIntiate(adm);
DRESS *dress;
dress=(DRESS *)malloc(500*sizeof(DRESS));
dressIntiate(dress);
while(1)
{
if(first(use,adm,dress)==3) continue;
}
return 0;
}
最后
边栏推荐
- Imitation 360 desktop suspended ball plug-in
- leetcode 91. Decode ways (medium)
- Similar to RZ / SZ, trzsz supporting TMUX has released a new version
- Bug STM32 interrupt (everyone knows)
- 在线JSON转CSharp(C#)Class工具
- Bug STM32 advanced timer (haha, to tell you the truth, the hardware timer can't reflect its strength. In fact, I want to send the kernel timer. Just think about it. Take your time)
- Common events for elements
- Pytoch --- use pytoch's pre training model to realize four weather classification problems
- [从零开始学习FPGA编程-40]:进阶篇 - 设计-竞争与风险Risk或冒险
- [ACNOI2022]不猜不行
猜你喜欢

基于FPGA的VGA协议实现

12 excellent practices of wireless network security

在word里,如何让页码从指定页开始编号

如何保证应用程序的安全性

Analysis on the current situation of the Internet of things in 2022

Review the SQL row column conversion, and the performance has been improved

A summary of PostgreSQL data types. All the people are here

AI video cloud vs narrowband HD, who is the favorite in the video Era

最新编程语言排行榜
![[deep learning] deep learning reasoning framework tensorrt MNN openvino onnxruntime](/img/a9/11bc00a91b79358f28ada2d4c99f32.png)
[deep learning] deep learning reasoning framework tensorrt MNN openvino onnxruntime
随机推荐
PTA:7-87 集合的模拟实现(类模板)
node+express如何操作cookie
AI 视频云 VS 窄带高清,谁是视频时代的宠儿
移动端城市列表排序js插件vercitylist.js
在 KubeSphere 上部署 Apache Pulsar
炫酷鼠标跟随动画js插件5种
Efficient remote office experience | community essay solicitation
How to use MySQL index well
AI video cloud: a good wife in the era of we media
Bug STM32 advanced timer (haha, to tell you the truth, the hardware timer can't reflect its strength. In fact, I want to send the kernel timer. Just think about it. Take your time)
华为联机对战服务玩家快速匹配后,不同玩家收到的同一房间内玩家列表不同
What is the APM tool skywalking
静态查找表和静态查找表
顺序表查找
Black horse PostgreSQL, why is it black in the end
PTA:6-73 函数调用
Online text filter less than specified length tool
虫子 日期类 下 太子语言
12 excellent practices of wireless network security
How e-commerce makes use of small programs