求学生宿舍管理信息系统开发,开发的系统包括:可运行的C#程序,分离的数据库?
系统均要求有登录界面,通过用户名和密码才能进入系统进行操作
要求能根据宿舍的实际情况,记录每栋宿舍的层数,房间数,可住人数,能根据以上情况对已有的学生自动进行分配宿舍,查询学生的宿舍号和床号
数据库要求
必须建立三个以上的表,设置约束。若表之间有关系,还须有关系图 展开
以下是我花费了40分钟做出来的成果,不是c#而是用java语言写的,其实内容是想通的,希望可以帮到你。
运行效果图:
以下是java代码 如若看懂 那么C#你自己也就可以做出来的
/*********************************
* 宿舍
* author zhang
*2013-12-16
********************************/
public class LivingRoom {
public LivingRoom(){
super();
}
public LivingRoom(int lrid, String lrname, Floor floor, int status,
int stucount, int totalcount, int bedid) {
super();
this.lrid = lrid;
this.lrname = lrname;
this.floor = floor;
this.status = status;
this.stucount = stucount;
this.totalcount = totalcount;
this.bedid = bedid;
}
//宿舍
private int lrid;//房间号
private String lrname;//宿舍别名
private Floor floor;//所属楼层
private int status;//1:空(无人住)/2:非空 已满/3:非空未满
private int stucount;//现住人数
private int totalcount;//总共可住人数
private int bedid;//床号
/**
* 测试
* @param args
*/
public static void main(String[] args) {
ClassRoom classRoom = new ClassRoom(1,1,"高三一班",70);
Floor floor = new Floor(1,1,"鑫德楼",2);
LivingRoom livingRoom = new LivingRoom(1,"德1寝室",floor,2,6,8,3);
Student student = new Student(1,1,"洪新雅",classRoom,livingRoom);
//以上信息描述的是 :高三一班1号 洪新雅 同学住在鑫德楼1层 的 德1寝室 一个寝室可住8人 现该寝室 已经住了6人
System.out.println("查询信息如下:"+classRoom.getClassname()+" 的 "+student.getStuname()
+" 同学 住在 "+floor.getFloorname()+" 第"+floor.getFno()+"层" +" 的 "
+livingRoom.getLrname()+" 床号是: "+livingRoom.getBedid());
}
public int getLrid() {
return lrid;
}
public void setLrid(int lrid) {
this.lrid = lrid;
}
public String getLrname() {
return lrname;
}
public void setLrname(String lrname) {
this.lrname = lrname;
}
public Floor getFloor() {
return floor;
}
public void setFloor(Floor floor) {
this.floor = floor;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public int getStucount() {
return stucount;
}
public void setStucount(int stucount) {
this.stucount = stucount;
}
public int getTotalcount() {
return totalcount;
}
public void setTotalcount(int totalcount) {
this.totalcount = totalcount;
}
public int getBedid() {
return bedid;
}
public void setBedid(int bedid) {
this.bedid = bedid;
}
}
/**
* 楼层
* @author Zhang
*
* 2013-12-16
*/
class Floor{
//构造函数
public Floor(){
super();
}
public Floor(int fid, int fno, String floorname, int floorsex) {
super();
this.fid = fid;
this.fno = fno;
this.floorname = floorname;
this.floorsex = floorsex;
}
//楼层
private int fid;//楼层id
private int fno;//楼层
private String floorname;//楼层别名
private int floorsex;//1:男生/2:女生宿舍楼
public int getFid() {
return fid;
}
public void setFid(int fid) {
this.fid = fid;
}
public int getFno() {
return fno;
}
public void setFno(int fno) {
this.fno = fno;
}
public String getFloorname() {
return floorname;
}
public void setFloorname(String floorname) {
this.floorname = floorname;
}
public int getFloorsex() {
return floorsex;
}
public void setFloorsex(int floorsex) {
this.floorsex = floorsex;
}
}
/**
* 学生
* @author Zhang
*
* 2013-12-16
*/
class Student{
//构造
public Student(){
super();
}
public Student(int sid, int sno,String stuname,ClassRoom classRoom, LivingRoom livingRoom) {
super();
this.sid = sid;
this.sno = sno;
this.stuname = stuname;
this.classRoom = classRoom;
this.livingRoom = livingRoom;
}
private int sid;//学生id
private int sno;//学生号
private String stuname;//学生名称
private ClassRoom classRoom;//所在班级
private LivingRoom livingRoom;//所住宿舍
public int getSid() {
return sid;
}
public void setSid(int sid) {
this.sid = sid;
}
public int getSno() {
return sno;
}
public void setSno(int sno) {
this.sno = sno;
}
public String getStuname() {
return stuname;
}
public void setStuname(String stuname) {
this.stuname = stuname;
}
public ClassRoom getClassRoom() {
return classRoom;
}
public void setClassRoom(ClassRoom classRoom) {
this.classRoom = classRoom;
}
public LivingRoom getLivingRoom() {
return livingRoom;
}
public void setLivingRoom(LivingRoom livingRoom) {
this.livingRoom = livingRoom;
}
}
/**
* 班级
* @author Zhang
*
* 2013-12-16
*/
class ClassRoom{
//构造
public ClassRoom(){
super();
}
public ClassRoom(int crid, int crno, String classname, int stuCount) {
super();
this.crid = crid;
this.crno = crno;
this.classname = classname;
this.stuCount = stuCount;
}
private int crid;//班级id
private int crno;//班级号
private String classname;//班级名称
private int stuCount;//学生个数
public int getCrid() {
return crid;
}
public void setCrid(int crid) {
this.crid = crid;
}
public int getCrno() {
return crno;
}
public void setCrno(int crno) {
this.crno = crno;
}
public String getClassname() {
return classname;
}
public void setClassname(String classname) {
this.classname = classname;
}
public int getStuCount() {
return stuCount;
}
public void setStuCount(int stuCount) {
this.stuCount = stuCount;
}
}
虽然有源代码 但是要做出来还是满难的 我们还没学登陆界面的制作老师就叫我们做了。。苦逼 要做出个应用程序。。。
呵呵 那个界面是很简单的 ,你自己看看书或者查查资料肯定可以自己完成的 我没有完成C#的环境。而且我搞java C#好久没玩了。有时候需要自己提前做的 并不是所有的知识都要等到老师讲的时候再去了解和做的,自学也是一种自我提高,相信你 加油!!!