.Net学生宿舍管理系统

.Net学生宿舍管理系统

图5-6管理员登陆

其核心代码为:

源码及文档下载地址:http://www.51aspx.com/Code/DormitoryManage

.Net学生宿舍管理系统

图5-6 后台首页

2.寝室信息管理(DormitoryInfo.aspx)

此页面供管理员对寝室信息进行添加、删除、编辑和有条件查询。如图5-7所示:

图5-7 寝室信息管理

其核心代码如下: UILayer

private void BindGvDormitoryInfo() {

if (this.rbtn_Style.Text == \楼房号\) {

string HouseId =

((DropDownList)this.Drop_HouseId.FindControl(\)).SelectedValue;

this.GV_DormitoryInfo.DataSource= myBUDormitoryInfo.BindByHouseId(HouseId); this.BindMessage(); }

if (this.rbtn_Style.Text == \楼房号和寝室号\) {

string HouseId =

((DropDownList)this.Drop_HouseId.FindControl(\)).SelectedValue;

源码及文档下载地址:http://www.51aspx.com/Code/DormitoryManage

.Net学生宿舍管理系统

string DormitoryId = this.Txt_DormitoryId.Text.Trim(); this.GV_DormitoryInfo.DataSource =

myBUDormitoryInfo.BindByHouseIdAndDormitoryId(HouseId, DormitoryId);

this.BindMessage(); }

if (this.rbtn_Style.Text == \文明寝室\) {

this.GV_DormitoryInfo.DataSource = myBUDormitoryInfo.BindByWenMing(); this.BindMessage(); }

if (this.rbtn_Style.Text == \评分\) {

string PingFen = this.Txt_DormitoryId.Text;

this.GV_DormitoryInfo.DataSource=myBUDormitoryInfo.BindByPingFen(PingFen); this.BindMessage(); } } BULayer

public IList BindByHouseIdAndDormitoryId(string HouseId, string DormitoryId) { try {

myDormitoryInfos =

myDADormitoryInfo.BindByHouseIdAndDormitoryId(HouseId,DormitoryId);

}

catch (Exception ex) {

throw new Exception(ex.ToString()); }

return myDormitoryInfos; } DALayer

public IList BindDormitoryInfo() {

using (SqlConnection conn = new SqlConnection(connectionString)) {

conn.Open();

SqlCommand cmd = new SqlCommand(\, conn); cmd.CommandType = CommandType.StoredProcedure; using (SqlDataReader DR =

cmd.ExecuteReader(CommandBehavior.CloseConnection)) {

while (DR.Read())

源码及文档下载地址:http://www.51aspx.com/Code/DormitoryManage

.Net学生宿舍管理系统

{

DormitoryInfo myDormitoryInfo = new DormitoryInfo(); myDormitoryInfo.Id = Convert.ToInt32(DR[\]);

myDormitoryInfo.HouseId = Convert.ToString(DR[\]); myDormitoryInfo.DormitoryId = Convert.ToString(DR[\]); myDormitoryInfo.Sex = Convert.ToString(DR[\]);

myDormitoryInfo.FactCounts = Convert.ToString(DR[\]); myDormitoryInfo.Counts = Convert.ToString(DR[\]); myDormitoryInfo.Phone = Convert.ToString(DR[\]); myDormitoryInfos.Add(myDormitoryInfo); }

DR.Close(); DR.Dispose(); }

conn.Close(); conn.Dispose(); }

return myDormitoryInfos; }

3.回复和删除留言(LiuYan.aspx)

管理员可以对用户添加的留言进行回复和删除。如图5-8所示:

图5-8留言信息管理

代码如下:

UILayer

protected void GV_LiuYanInfo_RowUpdating(object sender, GridViewUpdateEventArgs e) {

string Id = this.GV_LiuYanInfo.Rows[e.RowIndex].Cells[0].Text; string Replay =

((TextBox)this.GV_LiuYanInfo.Rows[e.RowIndex].FindControl(\)).Text;

源码及文档下载地址:http://www.51aspx.com/Code/DormitoryManage

联系客服:779662525#qq.com(#替换为@)