学生信息管理系统之增(二):添加班级信息流程

第一步:信息加载组合框内添加信息(AddItem属性)Private Sub Form_Load() comboGrade.AddItem "初中一年级" comboGrade.AddItem "初中二年级" comboGrade.AddItem "初中三年级"
摘要由CSDN通过智能技术生成

这里写图片描述

第一步:信息加载

组合框内添加信息(AddItem属性)

Private Sub Form_Load()
    comboGrade.AddItem "初中一年级"
    comboGrade.AddItem "初中二年级"
    comboGrade.AddItem "初中三年级"
    comboGrade.AddItem "高中一年级"
    comboGrade.AddItem "高中二年级"
    comboGrade.AddItem "高中三年级"

End Sub

第二步:文本框判断

2.1 判断各个文本框有无文本(无文本弹出提示,有文本进入第三步)

If Not Testtxt(txtClassno.Text) Then
        MsgBox "请输入班号!", vbOKOnly + vbExclamation, "警告"
        txtClassno.SetFocus
        Exit Sub
    End If

    If Not Testtxt(comboGrade.Text) Then
        MsgBox 
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 7
    评论
资源非常丰富,包含了学生信息管理系统需求分析文档,软件详细设计文档,安装部署手册及源程序。开发工具:软件架构:web应用程序,采用struts2加hibernate加spring框架。开发平台:J2EE 功能实现: 前台主页描述:顶部和底部均为各版块的公共部分,提供了一些导航链接,很方便用户操作。 左侧栏为用户信息及其班级信息展板,左侧底部展板用户显示一些班级公告信息, 右侧包括班级相册,可以自动播放,也可手动播放,还有一些班级的最新留言。 主页面只显示了最新的三条,用户可以通过头部导航条中的留言或“查看更多”导航 进入全部留言区,这里将为用户按时间先后顺序陈列出了所有的班级留言。您也可以 点击主页留言处的“我要留言”而进行留言。 班级模块描述:通过班级,用户可以查询本班的其他同学的信息,并且可以对信息的显示顺序进行排序, 排序可以按学号,姓名,年龄条件,再选择排序方式,点击查询即可。 留言模块描述:留言主要是方便大家讨论用的,用户可以发表留言信息,但如果内容不文明不科学,管理员可以删除。 这里也需说明一下,这里的留言没有设置留言评论的,感觉对于班级信息系统来说,也没这个必要,用户 有什么话要说,尽管留言即可,不过如果硬要针对某个人进行留言的话,用户也可以在留言中说明一下 即行,也没什么不方便的。 公告模块描述:特别说明一下,原本想将公告和活动分开处理的,但目前由于时间问题,暂且放在一起了,也就是 公告与活动是同一内容,然而这样做感觉也还可以,说得过去,这里的公告是一些班级的公告信息, 主要是由后台管理员(可以说是班长或班主任等)来发布的,只有管理员才能够直接操作公告信息, 前台用户这里只能够查看,其实这样没什么不妥,反而便于管理,也更符合常情。 其他模块描述:收藏和注销只是两个小功能,收藏是为了方便用户将本网页保存起来,这样以后就不必输入网址了。 而注销是必不可少的,用户登录后,当想退出时,就可以安全注销了,如果你现在还不想退出的话, 就别点击它哦,否而得重新登录的喔,仅作提示。 后台主页包括顶部公共模块,底部公告模块,左侧导航栏,中间显示区。其中顶部公共模块中的“主菜单”能够便捷的打开左侧的导航栏,“前台主页”是后台管理员查看前台主页信息,“后台主页”打开后台相关介绍信息的页面(登录成功后的主页面),“发布公告”方便管理员打开班级公告页面,便于发布新的公告,“数据维护”包括数据库备份与恢复,“系统设置”主要涉及到一些本系统的设置信息,由于时间及精力有限,这两块先预留着,以后再好好完善扩展。那个蓝色小按钮是控制中间页面是否隐藏左侧导航栏用的,而那两个黑色小按钮用于移动显示框的。 左侧导航栏主要包括了管理员信息的增删改查,学生信息的增删改查,班级公告信息的增删改查,班级留言信息的查询与删除。管理员单击各导航链接进入到相应页面,进行操作即可。 前后台页面美观,操作方便,尤其配有平台搭建介绍文档,很容易搭建系统平台。
#include <stdio.h> #include "string.h" int N,i; FILE *fp; struct student {char num[10]; char name[8]; char sex[5]; int age; char addr[15]; int score; }stu[100]; void input() /*输入学生数据的资料*/ {printf("Input the student data %d:\n",i+1); /*输入一个学生的数据*/ printf("NO.:"); scanf("%s",stu[i].num); /*输入号数*/ printf("name:"); scanf("%s",stu[i].name); /*姓名*/ printf("sex:"); scanf("%s",stu[i].sex); /*性别*/ printf("age:"); scanf("%d",&stu[i].age); /*年龄*/ printf("address:"); scanf("%s",stu[i].addr); /*家庭地址*/ printf("score:"); scanf("%d",&stu[i].score); /*分数*/ printf("\n"); } void add() /*在ouru的文件后添加学生数据*/ { if((fp=fopen("ouru","ab"))==NULL) /*以读写的进制形式打开ouru文件*/ {printf("Cann't open the file\n"); return;} printf("How many data do you want:"); /*输入需要添加几个学生的数据和具体的资料*/ scanf("%d",&N); for(i=0;i<N;i++) /*向ouru文件中加入添加学生的数据的个数*/ input(); for(i=0;i<N;i++) if(fwrite(&stu[i],sizeof(struct student),1,fp)!=1) printf("File error\n"); fclose(fp); } void save() /*保存学生的数据到ouru文件中*/ { int i; if((fp=fopen("ouru","wb"))==NULL) /*打开ouru文件*/ {printf("Cann't open the file\n"); return;} for(i=0;i<N;i++) /*把学生的数据写入到ouru 文件中*/ if(fwrite(&stu[i],sizeof(struct student),1,fp)!=1) printf("File write error\n"); fclose(fp); } void insert() /*在ouru文件中插入学生的数据*/ {char positions[10]; int a,b; if((fp=fopen("ouru","r+"))==NULL) /*以读写打开ouru文件*/ {printf("Can not open file!"); return;} for(i=0;(fread(&stu[i],sizeof(struct student),1,fp))!=0;i++); /*读取文件并计算文件中有多少个学生的数据*/ printf("Which position do you want to insert:"); scanf("%s",positions); for(a=0;a<i;a++) /*确定插入的位置*/ if(strcmp(positions,stu[a].num)==0)break; a=a+1; fseek(fp,sizeof(struct student)*(a+1),0); /*将指针指向要插入位置的后一位*/ for(b=a;b<i;b++) fwrite(&stu[b],sizeof(struct student),1,fp); /*将插入后的学生数据向后移动一位*/ i=a; input(); fseek(fp,sizeof(struct student)*a,0); /*将指针指向要插入的位置*/ fwrite(&stu[a],sizeof(struct student),1,fp); /*将插入的数据保存到ouru文件里*/ fclose(fp);} void change() /*修改ouru文件中的某个学生的数据*/ { char positions[10]; if((fp=fopen("ouru","rb+"))==NULL) /*以读写打开进制ouru文件*/ {printf("Can not open the file\n"); return;} printf("What data do you want to modify:"); /*输入要修改学生的号码*/ scanf("%s",positions); for(i=0;(fread(&stu[i],sizeof(struct student),1,fp))!=0;i++) /*找出要修改的数据*/ if(strcmp(stu[i].num,positions)==0) {fseek(fp,sizeof(struct student)*i,0); /*将指针指向要修改的资料*/ input(); fwrite(&stu[i],sizeof(struct student),1,fp); /*将修改的数据保存*/ break;} fclose(fp); } void del() /*删除ouru中的某个学生的数据*/ {int a,b,f; char positions[10]; if((fp=fopen("ouru","rb+"))==NULL) /*以读写打开ouru文件*/ {printf("Can not open file!"); return;} printf("Input the deleted number:"); /*输入要删除的学生号码*/ scanf("%s",positions); for(i=0;fread(&stu[i],sizeof(struct student),1,fp)!=0;i++); /*查找文件中有多少个学生的数据*/ f=i; for(a=0;a<i;a++) /*找出要删除的学生的数据并把后面的数据全都向前移一位*/ {if(strcmp(positions,stu[a].num)==0) { for(b=a;b<i;b++) {strcpy(stu[b].num,stu[b+1].num); strcpy(stu[b].name,stu[b+1].name); strcpy(stu[b].sex,stu[b+1].sex); stu[b].age=stu[b+1].age; strcpy(stu[b].addr,stu[b+1].addr); stu[b].score=stu[b+1].score;} f=f-1; break;} } fclose(fp); fopen("ouru","w"); /*将删除后的结果保存到ouru文件里*/ for(a=0;a<f;a++) fwrite(&stu[a],sizeof(struct student),1,fp); fclose(fp);} void examine() /*查看ouru文件中的资料*/ {int i; if((fp=fopen("ouru","r"))==NULL) /*以只读的方式打开ouru文件*/ {printf("Cannot open the file\n"); return;} printf("\n"); printf("num name sex age addr score\n"); /*读取各个学生数据的同时把它们显示出来*/ for(i=0;(fread(&stu[i],sizeof(struct student),1,fp))!=0;i++) {printf("%-10s%-10s%-8s%-9d%-17s%d\n",stu[i].num,stu[i].name,stu[i].sex,stu[i].age,stu[i].addr,stu[i].score);} printf("\n"); fclose(fp); } main() {int choose; /*显示主界面*/ printf("********************************************************************************\n"); printf("--------------------------------------------------------------------------------\n\n"); printf(" Welcome to the student system\n"); printf(" Producer:ouru\tRegistration number:03011123\n"); printf("\n\n--------------------------------------------------------------------------------\n"); printf("********************************************************************************\n"); printf("Please the choice:\n"); printf("\t\t\t1. Input the student data\n"); printf("\t\t\t2. Add the new studetn data\n"); printf("\t\t\t3. Change a data\n"); printf("\t\t\t4. Insert a new data\n"); printf("\t\t\t5. Delete the student data\n"); printf("\t\t\t6. Manifestation student data\n"); printf("\t\t\t7. Main menu\n"); printf("\t\t\t8. exit\n\n\n"); scanf("%d",&choose); /*选择想要操作的选项*/ while(choose!=8) /*当选择8的时候不再循环并退出*/ { switch(choose) {case 1:printf("Please input the student total:"); /*当choose为下面的数时执行相应的功能*/ scanf("%d",&N); for(i=0;i<N;i++) input(); save();break; case 2:add();break; case 3:change();break; case 4:insert();break; case 5:del();break; case 6:examine();break; case 7:printf("\n\n\nPlease the choice:\n"); printf("\t\t\t1. Input the student data\n"); printf("\t\t\t2. Add the new studetn data\n"); printf("\t\t\t3. Change a data\n"); printf("\t\t\t4. Insert a new data\n"); printf("\t\t\t5. Delete the student data\n"); printf("\t\t\t6. Manifestation student data\n"); printf("\t\t\t7. Main menu\n"); printf("\t\t\t8. exit\n\n\n");break; default :printf("error\n");} scanf("%d",&choose); } }

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Elsa~

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值