教学文库网 - 权威文档分享云平台
您的当前位置:首页 > 文库大全 > 实用文档 >

软件工程课程设计报告(2)

来源:网络收集 时间:2026-08-28
导读: 系统登陆界面: 主界面: 用户管理: 系统信息: 4.3代码开发 在本次课程设计中,我们小组负责的是学生管理系统项目,其中,我承担的是开发人员 ,开发代码是我们开发人员的事情,先开发代码,然后交由测试人员测试

系统登陆界面:

主界面:

用户管理:

系统信息:

4.3代码开发

在本次课程设计中,我们小组负责的是学生管理系统项目,其中,我承担的是开发人员 ,开发代码是我们开发人员的事情,先开发代码,然后交由测试人员测试,如遇到问题,再由开发人员,进行修改,重复以上几步,直到将程序调整到令人满意的程度。

我和孙智斌负责我们这组的代码开发。我们分工完成了这个程序。

我负责编写登陆界面、主界面、用户管理模块、系统信息模块,退出系统等。并且将孙智斌编写的其他模块代码,连接结合起来,从而完成学生管理系统。

登陆界面代码:

using System;

using System.Collections.Generic; using ponentModel; using System.Data; using System.Drawing; using System.Text;

using System.Windows.Forms; using System.Data.SqlClient;

namespace 用户 {

public partial class Form1 : Form {

private info owner; public Form1(info owner) {

InitializeComponent(); this.CenterToScreen(); this.owner = owner; }

private void Form1_Load(object sender, EventArgs e) { }

private void button1_Click(object sender, EventArgs e) { try {

SqlConnection myconnection = new SqlConnection();

myconnection.ConnectionString = ("Server=LENOVO-3927D0AD\\SQLEXPRESS;Integrated Security=True;" +

"Database=stu"); myconnection.Open();

SqlCommand mycommand = new SqlCommand();

mandText = "select * from t_user where f_username='" + textBox1.Text.Trim() +

"'and " + "f_password='"+ textBox2.Text.Trim() + "'"; mycommand.Connection = myconnection;

SqlDataReader dr = mycommand.ExecuteReader(); while (dr.Read()) {

ERID = dr[0].ToString(); }

if (ERID != null) {

this.Close(); owner.Opacity = 1; } else {

MessageBox.Show("密码和用户输入有错误!"); } }

catch (SqlException se) {

MessageBox.Show("出现错误!" + se.Message); } }

private void button2_Click(object sender, EventArgs e) {

this.Close(); owner.Opacity = 0; }

private void label1_Click(object sender, EventArgs e) {

this.Close(); } }

}

主界面代码:

using System;

using System.Collections.Generic; using ponentModel; using System.Data; using System.Drawing; using System.Text;

using System.Windows.Forms; using System.Data.SqlClient;

namespace 用户 {

public partial class info : Form {

public string USERID; public info() {

InitializeComponent(); Form1 temp = new Form1(this); temp.ShowDialog(); }

private void tabPage1_Click(object sender, EventArgs e) { }

private void groupBox1_Enter(object sender, EventArgs e) { }

private void 帐户管理ToolStripMenuItem_Click(object sender, EventArgs e) {

课程信息 courseset = new 课程信息(this); courseset.Show(); }

private void 基本信息设置ToolStripMenuItem_Click(object sender, EventArgs e) {

基本信息 baseinfo = new 基本信息(this); baseinfo.Show(); }

private void 成绩查询ToolStripMenuItem1_Click(object sender, EventArgs e) {

成绩查询 scorerev = new 成绩查询(this); scorerev.Show(); }

private void 班级设置ToolStripMenuItem_Click(object sender, EventArgs e) {

班级设置 classset = new 班级设置(this); classset.Show(); }

private void 学院设置ToolStripMenuItem_Click(object sender, EventArgs e) {

学院设置 xueyset = new 学院设置(this); xueyset.Show(); }

private void 用户管理ToolStripMenuItem_Click(object sender, EventArgs e) {

用户管理 userms = new 用户管理(this); userms.Show(); }

private void 系统信息ToolStripMenuItem_Click(object sender, EventArgs e) {

系统信息 sysinfo = new 系统信息(this); sysinfo.Show(); }

private void 退出系统ToolStripMenuItem_Click(object sender, EventArgs e) {

if (MessageBox.Show("确实要退出系统吗?", "确定", MessageBoxButtons.YesNo) == DialogResult.Yes) {

this.Close(); } } }

}

用户管理模块:

using System;

using System.Collections.Generic; using ponentModel; using System.Data; using System.Drawing; using System.Text;

using System.Windows.Forms; using System.Data.SqlClient; namespace 用户 {

public partial class 用户管理 : Form {

SqlDataAdapter thisAdapter;

DataSet thisDataSet = new DataSet(); public 用户管理(info parent) {

InitializeComponent(); this.MdiParent = parent; userload(); }

public void userload() {

SqlConnection thisConnection = new SqlConnection(

"Server=LENOVO-3927D0AD\\SQLEXPRESS;Integrated Security=True;" + "Database=stu");

thisAdapter = new SqlDataAdapter("select f_username[用户名],f_password[密码],f_limit[权限] from t_user", thisConnection);

SqlCommandBuilder thisBuilder = new SqlCommandBuilder(thisAdapter); thisAdapter.Fill(thisDataSet, "t_user");

dataGridView1.DataSource = thisDataSet.Tables[0]; }

private void button1_Click(object sender, EventArgs e) { try {

SqlConnection thisConnection = new SqlConnection(

"Server=LENOVO-3927D0AD\\SQLEXPRESS;Integrated Security=True;" + …… 此处隐藏:3106字,全部文档内容请下载后查看。喜欢就下载吧 ……

软件工程课程设计报告(2).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.jiaowen.net/wenku/135149.html(转载请注明文章来源)
Copyright © 2020-2025 教文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:78024566 邮箱:78024566@qq.com
苏ICP备19068818号-2
Top
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)