太原理工大学学生公寓管理系统 下载本文

checkModify.Tag=

ds.Tables[0].Rows[dataGrid1.CurrentCell.RowNumber][4].ToString().Trim(); checkModify.ShowDialog(); } } private void btDel_Click(object sender, System.EventArgs e) { if

(dataGrid1.DataSource!=null&&dataGrid1.CurrentRowIndex>=0&&dataGrid1[dataGrid1.CurrentCell]!=null) { oleConnection1.Open(); string sql = \* from checkinfo where CheckID=\ OleDbCommand cmd = new OleDbCommand(sql,oleConnection1); cmd.ExecuteNonQuery();

}

}

MessageBox.Show(\删除成功\提示\oleConnection1.Close();

private void btClose_Click(object sender, System.EventArgs e) { this.Close(); }

8.3 添加宿舍的窗体如下:

33

8.4 宿舍添加的部分代码实现

private void btAdd_Click(object sender, System.EventArgs e) { if (textDormID.Text.Trim()==\ MessageBox.Show(\填写完整信息\提示\ else { oleConnection1.Open(); string sql = \* from dorm where dormID='\ OleDbCommand cmd = new OleDbCommand(sql,oleConnection1); if (null == cmd.ExecuteScalar()) { sql = \into dorm values ('\\ \

34

xtRemark.Text.Trim()+\ cmd.CommandText=sql; cmd.ExecuteNonQuery(); MessageBox.Show(\添加成功\提示\ clear(); } else MessageBox.Show(\宿舍号重复\提示\ oleConnection1.Close(); } } private void btClose_Click(object sender, System.EventArgs e) { this.Close(); } private void clear() { textDormID.Text=\ textPhone.Text=\ textMoney.Text=\ textBed.Text=\ textChair.Text=\ textDesk.Text=\ textRemark.Text=\ }

35

第九章 系统测试

9.1所遇问题

一个系统功能的实现,需要经过这么几步,首先把大致的骨架给设计好,然后根据系统要求写代码,接着是调试程序,最后完善总结。其中最重要的两步就是中间的两步。但是这次作业不用编程实现,省下了不少功夫。 但是还是遇到了很多的问题。

1. 软件的需求分析,由于我们都不理解学生宿舍管理系统的具体要求,所以只能上网查找,获取资源。

2. 将各个功能模块化,那些能需要合并在一起,那些功能必需独立,这也是我们在设计的时候,比较难解决的问题。 9.2 系统测试

此次作业不要求编程实现,测试略。

36