C#书店管理系统方案Word文件下载.docx
《C#书店管理系统方案Word文件下载.docx》由会员分享,可在线阅读,更多相关《C#书店管理系统方案Word文件下载.docx(15页珍藏版)》请在冰豆网上搜索。
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,
System.Collections.Generic;
EventArgse)
System.ComponentModel;
{
System.Data;
SaleOrderso=newSaleOrder();
System.Drawing;
so.Show();
System.Text;
}
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退出系统
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销售统计
tryEventArgse)
Global.Con.Close();
salestaticsat=newsalestatic();
}sat.Show();
catch(Exception)}
//saleorder
textBox_consumer.Text;
string
buyip=textBox_ip.Text;
isbn=textBox_isbn.Text;
price=textBox_price.Text;
buynum=textBox_num.Text;
title=textBox_title.Text;
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)
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:
publicstocktable()
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
jinCommand.Connection=
jinCommand.CommandText=
inlist(isbn,title,provider,buynum,price,dtime)
+textBox_isbn.Text+"
+
textBox_title.Text+"
+textBox_provider.Text
+"
+textBox_num.Text+"
textBox_price.Text+"
+textBox_date.Text+
intjin=
jinCommand.ExecuteNonQuery();
if(jin>
label_show.Text="
提交成功"
else
privatevoidstocktable_Load_1(objectsender,EventArgse)
privatevoidbutton_cancel_Click(objectsender,EventArgse)
publicpartialclassbookInput:
publicbookInput()
stringdtime=textBox_time.Text;
stringauthor=
textBox_author.Text;
stringpublisher=
textBox_publisher.Text;
stringcomment=
textBox_comment.Text;
book(isbn,title,dtime,author,publisher,price,com
ment)VALUES('
+textBox_time.Text+
+textBox_author.Text+"
textBox_publisher.Text+"
textBox_comment.Text+"
if(jin>
入库成
入库失
败!
"
privatevoidbookInput_Load(objectsender,EventArgse)
privatevoid
groupBox_input_Enter(objectsender,EventArgs
//gobal
publicstaticclassGlobal
publicstaticSqlConnectionCon;
七.设计心得
从一开使拿到题目不知道如何下手到看了大量的例子后开始动手尝
试是一个很长的过程。
一开遇到的问题是不知道用什么语言做。
后
来决定用c#,但是如何建立表格以及需要哪些变量对于没有经验的
我来说是一件茫然的事,然而在看了一些的例子后明白了如何建立
表格。
下面就是设计界面了。
C#提供了非常简单的界面设计方法,
如何设计完全看个人了,在界面的设计上并没有花太多的时但是在
代码的设计上遇到了问题。
由于对于c#语言并不是非常的熟悉所以
在代码的设计上借鉴了一些书上和别人的代码。
这次的设计让我得到了动手练习的机会,初步明白了网上售书系统的设计与分析,当然这只是最简单的情况,实际的一个售书系统要考虑的更全面,更复杂。
所及今后要更多的动手练习。
感谢老师辛勤指导!