1 绪 论
1.1 开发背景
1.2 目的和意义
2 需求分析
2.1 系统需求简介
2.1.1 系统目标
2.1.2 功能需求分析
2.1.3 性能需求分析
3 概念模型设计
3.1 设计概述
3.2 系统总体结构
经过对系统的需求分析,学生公寓管理系统主要划分为五部分:学生信息管理,宿舍水电费管理,宿舍居住情况信
3.3 系统数据库概念结构设计
3.3.1 系统E-R图
3.3.2各实体所对应的表
4 物理设计
4.1物理设计阶段的目的与任务
5 详细设计
5.1 系统总体结构及功能模块划分
5.2 系统程序流程图
5.3 具体的系统实现
图5.7 住宿情况登记
源程序:
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form7 : Form
{
SqlConnection conn;
SqlDataAdapter sda;
DataSet da;
public Form7()
{
InitializeComponent();
}
private void Form7_Load(object sender, Eve
{
string constr = @"Data Source=(local);
conn = new SqlConnection(constr);
}
private void button3_Click(object sender,
{
sda = new SqlDataAdapter("select * fro
da = new DataSet();
sda.Fill(da, "partment");
dataGridView1.DataSource = da.Tables["
}
private void button2_Click(object sender,
{
conn.Open();
int suid = int.Parse(textBox3.Text);
int xuzhu = int.Parse(textBox5.Text);
int shizhu = int.Parse(textBox6.Text);
SqlCommand cmd3 = new SqlCommand();
cmd3.Connection = conn;
string scmd = string.Format("update [p
cmd3.CommandText = scmd;
sda = new SqlDataAdapter(cmd3);
cmd3.ExecuteNonQuery();
if (cmd3.ExecuteNonQuery() == 1)
MessageBox.Show("修改成功");
conn.Close();
}
private void button1_Click(object sender,
{
conn.Open();
if (textBox1.Text == "")
{
MessageBox.Show("请输入宿舍号!");
}
else
{
int sid = int.Parse(textBox1.Text)
SqlCommand cmd1 = new SqlCommand()
cmd1.Connection = conn;
cmd1.CommandText = "select * from
SqlDataReader reader = cmd1.Execut
while (reader.Read())
{
textBox3.Text = reader["suid"]
textBox5.Text = reader["xunum"
textBox6.Text = reader["shinum
}
}
conn.Close();
}
}
}
水电费缴费情况
图5.8 水电费缴费情况
源程序:
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form8 : Form
{
SqlConnection conn;
SqlDataAdapter sda;
DataSet da;
public Form8()
{
InitializeComponent();
}
private void button1_Click(object sender,
{
sda = new SqlDataAdapter("select * fro
da = new DataSet();
sda.Fill(da, "submoney");
dataGridView1.DataSource = da.Tables["
}
private void Form8_Load(object sender, Eve
{
string constr = @"Data Source=(local);
conn = new SqlConnection(constr);
}
}
}
学生登陆界面
图5.9 学生登陆界面
源代码:
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form3 : Form
{
public Form3()
{
InitializeComponent();
}
private void button1_Click(object sender,
{
Form9 student_mess = new Form9();
student_mess.Show();
}
private void button2_Click(object sender,
{
Form10 submoney_mess = new Form10();
submoney_mess.Show();
}
private void button3_Click(object sender,
{
Form11 health_mess = new Form11();
health_mess.Show();
}
}
}
个人信息查看
图5.10 个人基本信息
源程序:
源程序:
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form10 : Form
{
SqlConnection conn;
SqlDataAdapter sda;
DataSet da;
public Form10()
{
InitializeComponent();
}
private void Form10_Load(object sender, Ev
{
string constr = @"Data Source=(local);
conn = new SqlConnection(constr);
}
private void button1_Click(object sender,
{
string suid = textBox1.Text;
sda = new SqlDataAdapter();
sda.SelectCommand = new SqlCommand();
sda.SelectCommand.Connection = conn;
sda.SelectCommand.CommandText = "submo
sda.SelectCommand.CommandType = Comman
SqlParameter param = new SqlParameter(
param.Direction = ParameterDirection.I
param.Value = suid;
sda.SelectCommand.Parameters.Add(param
da = new DataSet();
sda.Fill(da, "student");
dataGridView1.DataSource = da.Tables["
}
}
}
卫生评比状况界面
图5.12 卫生评比结果查看
源代码:
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form11 : Form
{
SqlConnection conn;
SqlDataAdapter sda;
DataSet da;
public Form11()
{
InitializeComponent();
}
private void button1_Click(object sender,
{
string suid = textBox1.Text;
string lid = textBox1.Text;
sda = new SqlDataAdapter();
sda.SelectCommand = new SqlCommand();
sda.SelectCommand.Connection = conn;
sda.SelectCommand.CommandText = "healt
sda.SelectCommand.CommandType = Comman
SqlParameter param = new SqlParameter(
param.Direction = ParameterDirection.I
param.Value = suid;
sda.SelectCommand.Parameters.Add(param
da = new DataSet();
sda.Fill(da, "student");
dataGridView1.DataSource = da.Tables["
}
private void Form11_Load(object sender, Ev
{
string constr = @"Data Source=(local);
conn = new SqlConnection(constr);
}
}
}
6 设计总结
参考文献