C#书店管理系统方案.docx
《C#书店管理系统方案.docx》由会员分享,可在线阅读,更多相关《C#书店管理系统方案.docx(15页珍藏版)》请在冰豆网上搜索。
C#书店管理系统方案
....
数据库课程设计
班级软件0601
学号3060605022
姓名
指导老师
二零零八年7月
.下载可编辑.
....
.下载可编辑.
....
一、概述
1、项目背景:
数据库原理课程设计
2、编写目的:
掌握数据库设计原理及相关软件的使用
3、软件定义:
书店管理系统
4、开发环境:
语言:
CSharp;
平台:
VisualStudio2005+Microsoft.Net2.0;
数据库:
MicrosoftSQLServer2000;
二、需求分析
1、问题的提出
2、完成的功能
1.售书管理:
销售订单和销售统计;
2.订购管理;
3.库存管理;
4.信息查询;
5.推出系统。
.下载可编辑.
....
3、E-R图
三数据表
Book(isbn,title,author,publisher,price,totalnum,comment,dtime)
.下载可编辑.
....
Inlist(isbn,title,price,provider,buynum,dtime)
Outlist(isbn,username,buyip,price,buynum,title)
四、表、视图、索引、存储过程、触发器的创建
Book表:
Inlist:
Outlist:
.下载可编辑.
....
五、软件功能设计
1.主界面:
负责调出资界面;
2.销售订单界面:
将销售订单的信息加入销售订单列表outlist;
3.进货单界面:
将进货单的信息加入进货单信息表inlist;
4.bookinput界面:
将新录入的图书信息家入book表;
5.storage界面:
从book表中查询图书信息;
6.退出按钮:
退出界面。
主界面:
.下载可编辑.
....
销售订单界面:
.下载可编辑.
....
进货单界面
.下载可编辑.
....
.下载可编辑.
....
bookinput界面:
.下载可编辑.
....
storage界面
.下载可编辑.
....
六、程序代码及控件描述
//form1.cs
privatevoid销售订单
using
System;
ToolStripMenuItem_Click(objectsender,
using
System.Collections.Generic;
EventArgse)
using
System.ComponentModel;
{
using
System.Data;
SaleOrderso=newSaleOrder();
using
System.Drawing;
so.Show();
using
System.Text;
}
using
System.Windows.Forms;
namespacebookmanagesysprivatevoid进书定单
{ToolStripMenuItem_Click(objectsender,
publicpartialclassForm1:
FormEventArgse)
{{
publicForm1()stocktablest=newstocktable();
{st.Show();
InitializeComponent();}
}
privatevoid信息查询
ToolStripMenuItem_Click(objectsender,privatevoid新书入库
EventArgse)ToolStripMenuItem_Click(objectsender,
{EventArgse)
storagesg=newstorage();{
sg.Show();bookInputbi=newbookInput();
}bi.Show();
}
privatevoidForm1_Load(objectsender,
EventArgse)privatevoid退出系统
{ToolStripMenuItem_Click(objectsender,
Global.Con=newEventArgse)
System.Data.SqlClient.SqlConnection("Data{
Source=JD-6B3825650DEA;Initialthis.Close();
Catalog=Booksale;IntegratedSecurity=True");}
Global.Con.Open();
}privatevoid
textBox1_TextChanged(objectsender,EventArgs
e)
.下载可编辑.
....
{{
return;
}}
}
privatevoidForm1_FormClosed(object
sender,FormClosedEventArgse)privatevoid销售统计
{ToolStripMenuItem_Click(objectsender,
tryEventArgse)
{{
Global.Con.Close();salestaticsat=newsalestatic();
}sat.Show();
catch(Exception)}
}
}
//saleorder
using
System;
textBox_consumer.Text;
using
System.Collections.Generic;
string
buyip=textBox_ip.Text;
using
System.ComponentModel;
string
isbn=textBox_isbn.Text;
using
System.Data;
string
price=textBox_price.Text;
using
System.Drawing;
string
buynum=textBox_num.Text;
using
System.Text;
string
title=textBox_title.Text;
using
System.Windows.Forms;
using
System.Data.SqlClient;
SqlCommand
jincommand=
new
namespace
bookmanagesys
SqlCommand();
{
jincommand.Connection=
public
partialclassSaleOrder:
Form
Global.Con;
{
jincommand.CommandText=
publicSaleOrder()
"INSERTINTO
{
outlist(username,buyip,isbn,price,buynum,title)
InitializeComponent();
VALUES('"+textBox_consumer.Text+
"','"
+
}
textBox_ip.Text+"','"
+textBox_isbn.Text+
"','"
+textBox_price.Text+
"','"
+textBox_num.Text
privatevoidbutton_cancel_Click(object+"','"+textBox_title.Text+"')";
sender,EventArgse)intjin=
{jincommand.ExecuteNonQuery();
this.Close();if(jin>0)
}label_show.Text="提交成
功";
privatevoidbutton_ok_Click(object
sender,EventArgse)else
{label_show.Text="提交失败!
stringusername=";
.下载可编辑.
..
}
privatevoidSaleOrder_Load(object
sender,EventArgse)
{
//stocktable
usingSystem;
usingSystem.Collections.Generic;
usingSystem.ComponentModel;
usingSystem.Data;
usingSystem.Drawing;
usingSystem.Text;
usingSystem.Windows.Forms;
usingSystem.Data.SqlClient;
namespacebookmanagesys
{
publicpartialclassstocktable:
Form
{
publicstocktable()
{
InitializeComponent();
}
privatevoidbutton_ok_Click(objectsender,EventArgse)
{
stringtitle=textBox_title.Text;
stringprovider=
textBox_provider.Text;
stringbuynum=textBox_num.Text;
stringprice=textBox_price.Text;
stringdtime=textBox_date.Text;
stringisbn=textBox_isbn.Text;
SqlCommandjinCommand=new
//bookInput
..
}
}
}
SqlCommand();
jinCommand.Connection=
Global.Con;
jinCommand.CommandText=
"INSERTINTO
inlist(isbn,title,provider,buynum,price,dtime)
VALUES('"+textBox_isbn.Text+"','"+
textBox_title.Text+"','"+textBox_provider.Text
+"','"+textBox_num.Text+"','"+
textBox_price.Text+"','"+textBox_date.Text+
"')";
intjin=
jinCommand.ExecuteNonQuery();
if(jin>0)
label_show.Text="提交成功";
else
label_show.Text="提交失败!
";
}
privatevoidstocktable_Load_1(objectsender,EventArgse)
{
}
privatevoidbutton_cancel_Click(objectsender,EventArgse)
{
this.Close();
}
.下载可编辑.
..
usingSystem;
usingSystem.Collections.Generic;
usingSystem.ComponentModel;
usingSystem.Data;
usingSystem.Drawing;
usingSystem.Text;
usingSystem.Windows.Forms;
usingSystem.Data.SqlClient;
namespacebookmanagesys
{
publicpartialclassbookInput:
Form
{
publicbookInput()
{
InitializeComponent();
}
privatevoidbutton_ok_Click(objectsender,EventArgse)
{
stringisbn=textBox_isbn.Text;
stringtitle=textBox_title.Text;
stringdtime=textBox_time.Text;
stringauthor=
textBox_author.Text;
stringpublisher=
textBox_publisher.Text;
stringprice=textBox_price.Text;
stringcomment=
textBox_comment.Text;
SqlCommandjinCommand=new
SqlCommand();
jinCommand.Connection=
Global.Con;
jinCommand.CommandText=
"INSERTINTO
book(isbn,title,dtime,author,publisher,price,com
ment)VALUES('"+textBox_isbn.Text+"','"+
textBox_title.Text+"','"+textBox_time.Text+
"','"+textBox_author.Text+"','"+
..
textBox_publisher.Text+"','"+
textBox_price.Text+"','"+
textBox_comment.Text+"')";
intjin=
jinCommand.ExecuteNonQuery();
if(jin>0)
label_show.Text="入库成
功";
else
label_show.Text="入库失
败!
";
}
privatevoidbutton_cancel_Click(objectsender,EventArgse)
{
this.Close();
}
privatevoidbookInput_Load(objectsender,EventArgse)
{
}
privatevoid
groupBox_input_Enter(objectsender,EventArgs
e)
{
}
}
}
.下载可编辑.
....
}
}
//gobal
using
System;
{
using
System.Collections.Generic;
publicstaticclassGlobal
using
System.Text;
{
publicstaticSqlConnectionCon;
using
System.Data.SqlClient;
}
}
namespacebookmanagesys
七.设计心得
从一开使拿到题目不知道如何下手到看了大量的例子后开始动手尝
.下载可编辑.
....
试是一个很长的过程。
一开遇到的问题是不知道用什么语言做。
后
来决定用c#,但是如何建立表格以及需要哪些变量对于没有经验的
我来说是一件茫然的事,然而在看了一些的例子后明白了如何建立
表格。
下面就是设计界面了。
C#提供了非常简单的界面设计方法,
如何设计完全看个人了,在界面的设计上并没有花太多的时但是在
代码的设计上遇到了问题。
由于对于c#语言并不是非常的熟悉所以
在代码的设计上借鉴了一些书上和别人的代码。
这次的设计让我得到了动手练习的机会,初步明白了网上售书系统的设计与分析,当然这只是最简单的情况,实际的一个售书系统要考虑的更全面,更复杂。
所及今后要更多的动手练习。
感谢老师辛勤指导!
.下载可编辑.