图5-3 系统主界面
5.3.3 货物管理模块
货物管理模块,由四个子模块构成,完成货物的进货入库,出库,借入借出,库存盘点的功能。
1.入库管理模块
货物入库管理模块完成货物信息的入库及删除功能。用户可以添加商品入库的信息,对无效的入库信息进行删除,进行入库时,输入入库的相关系统,如货物编号,名称,选择入库的他库,供应商信息,并填写入库数量及单价等信息。货物入库管理模块的页面设计如图5-4所示:
28
图5-4供应商管理模块页面
其中“入库”按钮的设计如下:
private void btnAdd_Click(object sender, EventArgs e) {
if (txtISGID.Text == \ {
MessageBox.Show(\货物编号不能为空!\\信息\MessageBoxButtons.OK, MessageBoxIcon.Information); }
if (txtGIPrice.Text == \ {
MessageBox.Show(\货物单价不能为空!\\信息\MessageBoxButtons.OK, MessageBoxIcon.Information); } else {
int P_int_returnValue = doperate.InsertGoods(Convert.ToInt32(txtISGID.Text.Trim()), txtISGName.Text.Trim(), cboxPName.Text.Trim(), cboxSName.Text.Trim(), txtGSpec.Text.Trim(), cboxGUnit.Text.Trim(),
Convert.ToInt32(txtISGNum.Text.Trim()),
Convert.ToDecimal(txtGIPrice.Text.Trim()), txtHPeople.Text.Trim(), txtISRemark.Text.Trim()); if (P_int_returnValue == 100) {
MessageBox.Show(\该货物号已经被占用!\\信息\MessageBoxButtons.OK, MessageBoxIcon.Information); }
else if (P_int_returnValue == 200) {
MessageBox.Show(\这类货物已经存在惟一编号!\\信息\MessageBoxButtons.OK, MessageBoxIcon.Information); } else {
MessageBox.Show(\货物入库成功!\\信息\MessageBoxButtons.OK, MessageBoxIcon.Information); frmISManage_Load(sender, e); } } }
2.货物出库管理
货物的出库管理完成货物信息的销售出库的功能,在商品出库时需要用户输入仓库名称,商品名称,系统会调出商品的相关信息,输入出库数量,提货人及单位的信息,即可进行货物出库处理。货物出库管理模块的界面设计如图5-5所示:
29
图5-5 货物出库管理界面
其中“出库”按钮的代码设计如下:
private void btnAdd_Click(object sender, EventArgs e) { try {
SqlDataReader sqlread = datacon.getread(\GoodsNum from tb_GoodsInfo\ + \where StoreName='\+ cboxSName.Text.Trim() + \and GoodsName='\ + cboxGName.Text.Trim() + \if (sqlread.Read()) { if (Convert.ToInt32(txtOSGNum.Text.Trim()) > Convert.ToInt32(sqlread[\{
MessageBox.Show(\仓库中没有足够的货物!\\提示\MessageBoxButtons.OK, MessageBoxIcon.Information); } else {
datacon.getcom(\+ \+ \+ \+ txtOSGNum.Text.Trim() + \+ txtOSUnit.Text.Trim() + \+ txtHPeople.Text.Trim() + \
MessageBox.Show(\货物出库成功!\\信息\MessageBoxButtons.OK, MessageBoxIcon.Information); frmOSManage_Load(sender, e); } }
sqlread.Close(); } }
30
3.借货管理
借货模块完成企业之间借货的管理功能,借货信息管理模块中,用户输入仓库名称,货物名称,货物规格,借出数量,借货人,借货单位,经手人等信息,点击借货完成借货的功能,借货管理模块的界面设计如图5-6所示:
图5-6借货管理模块
其中“借货”按钮的代码设计如下:
private void btnAdd_Click(object sender, EventArgs e) {
try {
if (!doperate.validateNum(txtBGNum.Text.Trim())) {
errorPrBGNum.SetError(txtBGNum, \输入必须为数字!\ } else {
errorPrBGNum.Clear();
SqlDataReader sqlread = datacon.getread(\GoodsName StoreName,GoodsNum from tb_GoodsInfo\
+ \where StoreName='\+ cboxSName.Text.Trim() + \and GoodsName='\
+ cboxGName.Text.Trim() + \and GoodsSpec='\+ cboxGSpec.Text.Trim() + \
if (sqlread.Read()) {
if (Convert.ToInt32(sqlread[\<= 1)
{
MessageBox.Show(\该货物库存已经不足!\\警告\MessageBoxButtons.OK, MessageBoxIcon.Warning); } else {
if (Convert.ToInt32(txtBGNum.Text.Trim()) >= Convert.ToInt32(sqlread[\
31
{ MessageBox.Show(\没有足够的货物供您借取!\警告\ txtBGNum.Text = \ txtBGNum.Focus();
} else {
datacon.getcom(\into tb_BorrowGoods(StoreName,GoodsName,GoodsSpec,\ +
\
+ \values('\+ cboxSName.Text.Trim() + \+ cboxGName.Text.Trim()
+ \+ cboxGSpec.Text.Trim() + \+ txtBGNum.Text.Trim() + \
+ txtHPeople.Text.Trim() + \+ txtBGPeople.Text.Trim() + \
+ txtBGDepart.Text.Trim() + \+ txtBGRemark.Text.Trim() + \
MessageBox.Show(\借货成功!\\信息\MessageBoxButtons.OK, MessageBoxIcon.Information);
frmBGManage_Load(sender, e); } } }
sqlread.Close(); } }
catch (Exception ex) }
4.还货管理模块
还货管理模块完成已借货物归还功能,用户可以只归还一部分,也可全部归还,货物借出和归还都会自动更新库存。还货管理模块的设计如图5-7所示:
图5-7 还货管理模块
32
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说教育文库库存管理系统论文(8)在线全文阅读。
相关推荐: