超市管理系统代码

上传人:hs****ma 文档编号:466722870 上传时间:2023-12-12 格式:DOC 页数:10 大小:64KB
返回 下载 相关 举报
超市管理系统代码_第1页
第1页 / 共10页
超市管理系统代码_第2页
第2页 / 共10页
超市管理系统代码_第3页
第3页 / 共10页
超市管理系统代码_第4页
第4页 / 共10页
超市管理系统代码_第5页
第5页 / 共10页
点击查看更多>>
资源描述

《超市管理系统代码》由会员分享,可在线阅读,更多相关《超市管理系统代码(10页珍藏版)》请在金锄头文库上搜索。

1、using System;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;namespace 超市管理信息系统public partial class f_ 供应商基本信息: Form/公有变量记录选定数据public string strOldNO = ;public string strOldName = ;public string strOldAdd = ;public f_ 供应商基本信息()InitializeComponent();private void f

2、_ 供应商基本信息_Load(object sender, EventArgs e)/ TODO:这行代码将数据加载到表“连锁超市管理信息数据库DataSet.供应商”中。您可以根据需要移动或移除它。this.供应商 TableAdapter.Fill(this. 连锁超市管理信息数据库DataSet.供应商 );/新增数据单击事件private void btnInsert_Click(object sender, EventArgs e)/ 获取前台数据string strName = txtName.Text;string strAdd = txtAdd.Text;string strN

3、O = txtNO.Text;int iNO = 0;int iErrCode = 0;/ 对前台编号数据的格式审核trycatch (Exception eINO)iErrCode = 1;/ 对前台名称数据的格式审核if (strName.Length 20)iErrCode = 2;if (strAdd.Length 30)iErrCode = 3;if (iErrCode != 0)MessageBox.Show( 你所输入的数据有误,请核查!);elsetry/新增写入数据库this.供应商 TableAdapter.Insert(iNO,strName, strAdd);catch

4、 (Exception exInsert)MessageBox.Show( 新增数据发生错误,请与管理员联系!);/ 刷新数据列数this.供应商 TableAdapter.Fill(this. 连锁超市管理信息数据库DataSet.供应商 );/单击数据表单元格触发事件private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)/ 获取对应行的各个单元格数据/ 填充回对应的文本框txtNO.Text = strNO;txtName.Text = strName;txtAdd.Text = st

5、rAdd;/ 将原数据值赋予公有变量strOldNO = strNO;strOldName = strName;strOldAdd = strAdd;/删除按钮事件private void btnDelete_Click(object sender, EventArgs e)/ 获取前台数据string strName = txtName.Text;string strAdd = txtAdd.Text;string strNO = txtNO.Text;int iNO = 0;int iErrCode = 0;/ 对前台编号数据的格式审核trycatch (Exception eINO)iE

6、rrCode = 1;/ 对前台名称数据的格式审核if (strName.Length 20)iErrCode = 2;if (strAdd.Length 30)iErrCode = 3;if (iErrCode != 0)MessageBox.Show( 你所输入的数据有误,请核查!);elsetry/新增写入数据库this.供应商 TableAdapter.Delete(iNO,strName, strAdd);catch (Exception exInsert)MessageBox.Show( 删除数据发生错误,请与管理员联系!);/ 刷新数据列数this.供应商 TableAdapte

7、r.Fill(this. 连锁超市管理信息数据库DataSet.供应商 );/修改按钮事件private void btnUpdate_Click(object sender, EventArgs e)/ 获取前台数据string strName = txtName.Text;string strAdd = txtAdd.Text;string strNO = txtNO.Text;int iNO = 0;int iErrCode = 0;/ 对前台编号数据的格式审核trycatch (Exception eINO)iErrCode = 1;/ 对前台名称数据的格式审核if (strName.

8、Length 20)iErrCode = 2;if (strAdd.Length 30)iErrCode = 3;if (iErrCode != 0)MessageBox.Show( 你所输入的数据有误,请核查!);elsetrythis.供应商TableAdapter.Update(iNO,strName,strAdd,Convert.ToInt32(strOldNO), strOldName, strOldAdd);catch (Exception exUpdate)MessageBox.Show( 修改数据发生错误,请与管理员联系!);/ 刷新数据列数this.供应商 TableAdap

9、ter.Fill(this. 连锁超市管理信息数据库DataSet.供应商 );using System;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;namespace 超市管理信息系统public partial class f_ 供应商基本信息: Form/公有变量记录选定数据public string strOldNO = ;public string strOldName = ;public string strOldAdd = ;public f_ 供应商基本

10、信息()InitializeComponent();private void f_供应商基本信息_Load(object sender, EventArgs e)/ TODO:这行代码将数据加载到表“连锁超市管理信息数据库DataSet.供应商”中。您可以根据需要移动或移除它。this.供应商 TableAdapter.Fill(this.连锁超市管理信息数据库DataSet.供应商 );/新增数据单击事件private void btnInsert_Click(object sender, EventArgs e)/ 获取前台数据string strName = txtName.Text;s

11、tring strAdd = txtAdd.Text;string strNO = txtNO.Text;int iNO = 0;int iErrCode = 0;/ 对前台编号数据的格式审核trycatch (Exception eINO)iErrCode = 1;/ 对前台名称数据的格式审核if (strName.Length 20)iErrCode = 2;if (strAdd.Length 30)iErrCode = 3;if (iErrCode != 0)MessageBox.Show( 你所输入的数据有误,请核查!);elsetry/新增写入数据库this.供应商 TableAdapter.Insert(iNO,strName, strAdd);catch (Exception exInsert)MessageBox.Show( 新增数据发生错误,请与管理员联系!);/ 刷新数据列数this.供应商 TableAdapter.Fill(this. 连锁超市管理信息数据库DataSet.供应商 );/

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 办公文档 > 演讲稿/致辞

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号