> # ♻️ 资源
> **大小:** 12.7MB
> **文档链接:**[**https://www.yuque.com/sxbn/ks/100010444**](https://www.yuque.com/sxbn/ks/100010444)
> **➡️ 资源下载:**[**https://download.csdn.net/download/s1t16/87390789**](https://download.csdn.net/download/s1t16/87390789)
> **注:更多内容可关注微信公众号【神仙别闹】,如当前文章或代码侵犯了您的权益,请私信作者删除!**
> ![qrcode_for_gh_d52056803b9a_344.jpg](https://cdn.nlark.com/yuque/0/2023/jpeg/2469055/1692147256036-49ec7e0c-5434-4963-b805-47e7295c9cbc.jpeg#averageHue=%23a3a3a3&clientId=u8fb96484-770e-4&from=paste&height=140&id=u237e511a&originHeight=344&originWidth=344&originalType=binary&ratio=1.25&rotation=0&showTitle=false&size=8270&status=done&style=none&taskId=ud96bf5f7-fe85-4848-b9c2-82251181297&title=&width=140.1999969482422)
# **模块及对应代码说明**
![Aspose.Words.6bb383fa-43b9-4424-a91a-01e6652dda57.001.jpeg](https://cdn.nlark.com/yuque/0/2024/jpeg/2469055/1711507595959-b3e39971-ef76-4e42-8d44-2d1a631a93af.jpeg#averageHue=%23fdfdfb&clientId=u8bd51131-d7f7-4&from=paste&height=253&id=u7d1f24c0&originHeight=316&originWidth=546&originalType=binary&ratio=1.25&rotation=0&showTitle=false&size=67740&status=done&style=none&taskId=u535967af-dacf-46a1-87e1-5715d6e44b4&title=&width=436.8)
模块如下:
![Aspose.Words.6bb383fa-43b9-4424-a91a-01e6652dda57.002.png](https://cdn.nlark.com/yuque/0/2024/png/2469055/1711507613852-a1d99fe6-b825-4c83-a83c-444c747df543.png#averageHue=%23edf1f8&clientId=u8bd51131-d7f7-4&from=paste&height=342&id=uaa987004&originHeight=427&originWidth=344&originalType=binary&ratio=1.25&rotation=0&showTitle=false&size=58857&status=done&style=none&taskId=u46b06494-150f-4fa3-a014-80f895e6db0&title=&width=275.2)
**总的有效功能代码量1118,平均每一个模块有效功能代码70行**
部分主要逻辑代码:
```csharp
public partial class user_info : Form
{
public user_info()
{
InitializeComponent();
}
private void user_info_Load(object sender, EventArgs e)
{
//直接把信息填入到textbox中
string user_name = sign_in.sign_name;
string user_pass = sign_in.sign_password;
string query_text_find_user = "select * from user_info where
username = \'" + user_name + "\'";
NpgsqlConnection conn = new NpgsqlConnection(sign_in.connstr); NpgsqlCommand cmd = new NpgsqlCommand(query_text_find_user, conn); conn.Open();
NpgsqlDataReader reader = cmd.ExecuteReader();
reader.Read();
textBox1.Text = reader.GetString(0);
textBox2.Text = reader.GetString(1);
try
{
textBox3.Text = reader.GetString(2); }catch(Exception ex)
{
textBox3.Text = ""; }
try
{
textBox4.Text = reader.GetString(3);
}catch(Exception ex)
{
textBox4.Text = ""; }
try
{
textBox5.Text = reader.GetString(4);
}catch(Exception ex)
{
textBox5.Text = ""; }
if(reader.GetString(5) == "男") {
comboBox1.SelectedIndex = comboBox1.Items.IndexOf("男"); }else
{
comboBox1.SelectedIndex = comboBox1.Items.IndexOf("女");
}
try
{
richTextBox1.Text = reader.GetString(7);
}catch(Exception ex)
{
richTextBox1.Text = ""; }
}
private void button1_Click(object sender, EventArgs e)
{
string user_name = sign_in.sign_name;
string user_pass = sign_in.sign_password;
string query_text_update_user =
"update user_info set name = '" + textBox2.Text + "' , mail = '" +
textBox3.Text + "' , address = '" + textBox4.Text + "' , occupy = '" + textBox5.Text + "' , sex = '" + comboBox1.SelectedItem.ToString() + "' , self_info = '" + richTextBox1.Text + "' where username = '" + user_name + "'";
} }
NpgsqlConnection conn = new NpgsqlConnection(sign_in.connstr); NpgsqlCommand cmd = new NpgsqlCommand(query_text_update_user, conn); conn.Open();
cmd.ExecuteNonQuery();
MessageBox.Show("修改成功", "恭喜", MessageBoxButtons.OK); conn.Close();
//用户信息更新 user_info_Load(null,null);
public partial class book_manage : Form
{
public book_manage()
{
InitializeComponent();
}
private void label2_Click(object sender, EventArgs e)
{
}
private void book_manage_Load(object sender, EventArgs e)
{
string user_name = sign_in.sign_name; string user_pass = sign_in.sign_password; string query_text_find_books =
"select * from book_info";
NpgsqlConnection conn = new NpgsqlConnection(sign_in.connstr); DataSet dataSet = new DataSet();
NpgsqlDataAdapter adapter = new
NpgsqlDataAdapter(query_text_find_books, conn); adapter.Fill(dataSet, "图书");
dataGridView1.DataSource = dataSet.Tables["图书"]; dataGridView1.Columns[0].HeaderText = "序号"; dataGridView1.Columns[1].HeaderText = "书名"; dataGridView1.Columns[2].HeaderText = "作者"; dataGridView1.Columns[3].HeaderText = "出版社"; dataGridView1.Columns[4].HeaderText = "简介"; conn.Close();
}
private void dataGridView1_CellMouseUp(object sender,
DataGridViewCellMouseEventArgs e)
{
if (e.Button == MouseButtons.Right) {
if (e.RowIndex >= 0) {
dataGridView1.ClearSelection(); dataGridView1.Rows[e.RowIndex].Selected = true; dataGridView1.CurrentCell =
dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex]; contextMenuStrip1.Show(MousePosition.X, MousePosition.Y);
} }
}
private void 删除ToolStripMenuItem_Click(object sender, EventArgs e) {
//删除选定的图书
string user_name = sign_in.sign_name; string user_pass = sign_in.sign_password; string query_text_delete_book =
"delete from book_info where book_id = " +
int.Parse(dataGridView1.CurrentRow.Cells[0].Value.ToString());
if(MessageBox.Show("您确定要删除该书吗?","请确 认",MessageBoxButtons.YesNo) == DialogResult.Yes)
conn);
{
NpgsqlConnection conn = new NpgsqlConnection(sign_in.connstr); NpgsqlCommand cmd = new NpgsqlCommand(query_text_delete_book,
conn.Open();
cmd.ExecuteNonQuery();
conn.Close();
MessageBox.Show("删除成功", "恭喜", MessageBoxButtons.OK);
book_manage_Load(null, null);
}
else
{
return;
} }
private void button1_Click(object sender, EventArgs e)
{
string user_name = sign_in.sign_name; string user_pass = sign_in.sign_password;
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
详情介绍:https://www.yuque.com/sxbn/ks/100010444 主要功能: 管理员操作模块(图书管理模块、借书管理模块、用户管理模块); 用户操作模块(费用管理模块、个人信息模块、借书还书操作模块、借阅信息模块)
资源推荐
资源详情
资源评论
收起资源包目录
基于C#编写的图书管理系统【100010444】 (539个子文件)
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
图书管理系统V0.0.1.csprojAssemblyReference.cache 391KB
DesignTimeResolveAssemblyReferencesInput.cache 25KB
DesignTimeResolveAssemblyReferences.cache 8KB
图书管理系统V0.0.1.csproj.GenerateResource.cache 2KB
图书管理系统V0.0.1.csproj.CoreCompileInputs.cache 41B
图书管理系统V0.0.1.exe.config 18KB
图书管理系统V0.0.1.exe.config 18KB
App.config 1KB
packages.config 959B
图书管理系统V0.0.1.csproj.CopyComplete 0B
user_info.Designer.cs 12KB
book_manage.Designer.cs 12KB
brief_record_info.Designer.cs 8KB
balance.Designer.cs 8KB
register.Designer.cs 8KB
book_manage.cs 7KB
sign_in.Designer.cs 6KB
borrow.cs 6KB
user_op.Designer.cs 6KB
borrow.Designer.cs 6KB
book_brief_info.Designer.cs 6KB
borrow_manage.Designer.cs 5KB
return.Designer.cs 5KB
sign_in.cs 5KB
manager_op.Designer.cs 5KB
return.cs 5KB
borrow_and_return.Designer.cs 5KB
user_manage.Designer.cs 5KB
user_manage.cs 4KB
user_info.cs 4KB
register.cs 4KB
balance.cs 3KB
borrow_records.Designer.cs 3KB
Resources.Designer.cs 3KB
borrow_manage.cs 2KB
borrow_records.cs 2KB
user_op.cs 1KB
AssemblyInfo.cs 1KB
manager_op.cs 1KB
brief_record_info.cs 1KB
borrow_and_return.cs 1KB
Settings.Designer.cs 1KB
book_brief_info.cs 911B
Program.cs 579B
TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs 0B
TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs 0B
共 539 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
- wanglong12582023-06-23发现一个宝藏资源,资源有很高的参考价值,赶紧学起来~
神仙别闹
- 粉丝: 2687
- 资源: 7642
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功